Skip to content

Commit

Permalink
Merge branch 'feature/shibui-1788' of bitbucket.org:unicon/shib-idp-u…
Browse files Browse the repository at this point in the history
…i into feature/shibui-1788
  • Loading branch information
rmathis committed Jun 28, 2021
2 parents ec6dfa4 + 058bacb commit 00f1779
Show file tree
Hide file tree
Showing 4 changed files with 25 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,13 @@ public interface IRelyingPartyOverrideProperty {
public String getPersistType();

public String getPersistValue();

/**
* When the override actually is used in the UI, the "type" list is fairly limited, so each implementing class
* should adjust the real value so the UI gets a value it expects. For actual file configured overrides, this
* means doing nothing, but UI defined attributes have to do some work.
*/
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 00f1779

Please sign in to comment.