Skip to content

Commit

Permalink
SHIBUI-1980
Browse files Browse the repository at this point in the history
fixing issue with the types translating to the UI when adding custom
entity attributes of certain "types" in the relying party overrides
screens
  • Loading branch information
chasegawa committed Jun 28, 2021
1 parent 5b2633b commit d350b3b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.internet2.tier.shibboleth.admin.ui.service

import edu.internet2.tier.shibboleth.admin.ui.configuration.CustomPropertiesConfiguration
import edu.internet2.tier.shibboleth.admin.ui.domain.IRelyingPartyOverrideProperty
import edu.internet2.tier.shibboleth.admin.ui.security.model.User
import edu.internet2.tier.shibboleth.admin.ui.security.service.UserService
import org.springframework.beans.factory.annotation.Autowired
Expand Down Expand Up @@ -35,7 +36,7 @@ class JsonSchemaBuilderService {
property =
[title : it['displayName'],
description : it['helpText'],
type : it['displayType'],
type : ((IRelyingPartyOverrideProperty)it).getTypeForUI(),
default : it['displayType'] == 'boolean' ? Boolean.getBoolean(it['defaultValue']) : it['defaultValue'],
examples : it['examples']]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ public Boolean getFromConfigFile() {
return Boolean.FALSE;
}

public String getTypeForUI() {
switch (attributeType) {
case BOOLEAN:
case INTEGER:
return getDisplayType();
case SELECTION_LIST:
return "list";
default: // DOUBLE, DURATION, LONG, SPRING_BEAN_ID, STRING
return "string";
}
}

@Override
public void setDefaultValues(Set<String> defaultValues) {
// This is here to comply with the interface only and should not be used to change the set of values in this implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public interface IRelyingPartyOverrideProperty {
public String getPersistType();

public String getPersistValue();

public String getTypeForUI();

public void setAttributeFriendlyName(String attributeFriendlyName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public CustomAttributeType getAttributeType() {
}
}

public String getTypeForUI() {
return getDisplayType();
}

public void setDefaultValues(Set<String> defaults) {
defaultValues = defaults;
examples = defaults;
Expand Down

0 comments on commit d350b3b

Please sign in to comment.