From 8d6a4339f7f66e631f24da00294d09f2aefa7eeb Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Mon, 22 Oct 2018 11:28:47 -0700 Subject: [PATCH] [SHIBUI-905] A little Groovy cleanup. --- .../MetadataSourcesUiDefinitionController.groovy | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy index 9d54e5ac0..aeedd07e7 100644 --- a/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy +++ b/backend/src/main/groovy/edu/internet2/tier/shibboleth/admin/ui/controller/MetadataSourcesUiDefinitionController.groovy @@ -38,15 +38,10 @@ class MetadataSourcesUiDefinitionController { ResponseEntity getUiDefinitionJsonSchema() { try { def parsedJson = jacksonObjectMapper.readValue(this.jsonSchemaLocation.url, Map) - def widget = parsedJson["properties"]["attributeRelease"]["widget"] - def data = [] - customAttributesConfiguration.getAttributes().each { - def attribute = [:] - attribute["key"] = it["name"] - attribute["label"] = it["displayName"] - data << attribute + parsedJson['properties']['attributeRelease']['widget']['data'] = + customAttributesConfiguration.getAttributes().collect { + [key: it['name'], label: it['displayName']] } - widget["data"] = data return ResponseEntity.ok(parsedJson) } catch (Exception e) {