diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 50049f5cb..5ed4a9874 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -104,9 +104,17 @@ value.template=Template value.string=String value.boolean=Boolean value.list=List +value.long=Long +value.double=Double +value.duration=Duration +value.spring-bean-id=Spring Bean ID value.BOOLEAN=Boolean value.SELECTION_LIST=List value.STRING=String +value.LONG=Long +value.DOUBLE=Double +value.DURATION=Duration +value.SPRING_BEAN_ID=Spring Bean ID brand.header.title=Source Management brand.logo-link-label=Shibboleth @@ -140,11 +148,23 @@ label.entity-attribute-default=Default Value tooltip.entity-attribute-default=Default Value label.entity-attribute-list-options=List options tooltip.entity-attribute-list-options=List options +label.entity-attribute-friendly-name=Friendly name +tooltip.entity-attribute-friendly-name=Friendly name +label.entity-attribute-attr-name=Attribute name +tooltip.entity-attribute-attr-name=This is normally a uri or urn +label.entity-attribute-display-name=Display name +tooltip.entity-attribute-display-name=Display name + +label.entity-attribute-persist-friendly-name=Persist Friendly Name +label.entity-attribute-persist-type=Persist Type +tooltip.entity-attribute-persist-friendly-name=Persist Friendly Name +tooltip.entity-attribute-persist-type=Persist Type label.entity-attributes=Entity Attributes label.custom-entity-attributes=Custom Entity Attributes label.help-text=Help text label.default-value=Default Value +label.new-attribute=New Custom Entity Attribute label.metadata-source=Metadata Source label.metadata-sources=Metadata Sources diff --git a/ui/public/assets/schema/attribute/attribute.schema.json b/ui/public/assets/schema/attribute/attribute.schema.json index cc99dc3a6..bb731f20b 100644 --- a/ui/public/assets/schema/attribute/attribute.schema.json +++ b/ui/public/assets/schema/attribute/attribute.schema.json @@ -2,7 +2,10 @@ "type": "object", "required": [ "name", - "attributeType" + "attributeType", + "attributeFriendlyName", + "attributeName", + "displayName" ], "properties": { "name": { @@ -19,14 +22,67 @@ "enum": [ "STRING", "BOOLEAN", - "SELECTION_LIST" + "SELECTION_LIST", + "LONG", + "DOUBLE", + "DURATION", + "SPRING_BEAN_ID" ], "enumNames": [ "value.string", "value.boolean", - "value.list" + "value.list", + "value.long", + "value.double", + "value.duration", + "value.spring-bean-id" ] }, + "attributeFriendlyName": { + "type": "string", + "title": "label.entity-attribute-friendly-name", + "description": "tooltip.entity-attribute-friendly-name", + "minLength": 1, + "maxLength": 255 + }, + "attributeName": { + "type": "string", + "title": "label.entity-attribute-attr-name", + "description": "tooltip.entity-attribute-attr-name", + "minLength": 1, + "maxLength": 255 + }, + "persistFriendlyName": { + "type": "string", + "title": "label.entity-attribute-persist-friendly-name", + "description": "tooltip.entity-attribute-persist-friendly-name", + "minLength": 1, + "maxLength": 255 + }, + "persistType": { + "type": "string", + "title": "label.entity-attribute-persist-type", + "description": "tooltip.entity-attribute-persist-type", + "minLength": 1, + "maxLength": 255, + "enum": [ + "boolean", + "string", + "number" + ], + "enumNames": [ + "boolean", + "string", + "number" + ] + }, + "displayName": { + "type": "string", + "title": "label.entity-attribute-display-name", + "description": "tooltip.entity-attribute-display-name", + "minLength": 1, + "maxLength": 255 + }, "helpText": { "title": "label.entity-attribute-help", "description": "tooltip.entity-attribute-help", @@ -45,7 +101,7 @@ "STRING" ] }, - "defaultValueString": { + "defaultValue": { "title": "label.entity-attribute-default", "description": "tooltip.entity-attribute-default", "type": "string" @@ -59,12 +115,73 @@ "BOOLEAN" ] }, - "defaultValueBoolean": { + "defaultValue": { + "title": "label.entity-attribute-default", + "description": "tooltip.entity-attribute-default", + "type": "string", + "default": "true", + "enumNames": [ + "True", + "False" + ] + } + } + }, + { + "properties": { + "attributeType": { + "enum": [ + "DURATION" + ] + }, + "defaultValue": { + "title": "label.entity-attribute-default", + "description": "tooltip.entity-attribute-default", + "type": "string", + "pattern": "^(R\\d*\\/)?P(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$" + } + } + }, + { + "properties": { + "attributeType": { + "enum": [ + "LONG" + ] + }, + "defaultValue": { + "title": "label.entity-attribute-default", + "description": "tooltip.entity-attribute-default", + "type": "string" + } + } + }, + { + "properties": { + "attributeType": { + "enum": [ + "DOUBLE" + ] + }, + "defaultValue": { + "title": "label.entity-attribute-default", + "description": "tooltip.entity-attribute-default", + "type": "string" + } + } + }, + { + "properties": { + "attributeType": { + "enum": [ + "INTEGER" + ] + }, + "defaultValue": { "title": "label.entity-attribute-default", "description": "tooltip.entity-attribute-default", - "type": "boolean", - "default": true, - "enumNames": ["True", "False"] + "type": "string", + "pattern": "^\\d+$" } } }, diff --git a/ui/src/app/form/component/fields/FilterTargetField.js b/ui/src/app/form/component/fields/FilterTargetField.js index bad90052e..2bfd8484d 100644 --- a/ui/src/app/form/component/fields/FilterTargetField.js +++ b/ui/src/app/form/component/fields/FilterTargetField.js @@ -74,7 +74,7 @@ const FilterTargetField = ({ /*eslint-disable react-hooks/exhaustive-deps*/ React.useEffect(() => { - if (term && term.length >= 4) { + if (term?.length >= 4) { searchIds(term); } }, [term]); diff --git a/ui/src/app/form/component/templates/FieldTemplate.js b/ui/src/app/form/component/templates/FieldTemplate.js index 1e2b8f7eb..1203d543a 100644 --- a/ui/src/app/form/component/templates/FieldTemplate.js +++ b/ui/src/app/form/component/templates/FieldTemplate.js @@ -24,8 +24,8 @@ export function FieldTemplate ({ {children}