diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 60b8dfd78..2c6a85bbb 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -551,8 +551,9 @@ tooltip.want-assertions-signed=Want Assertions Signed tooltip.certificate-name=Certificate Name tooltip.certificate-type=Certificate Type tooltip.certificate=Certificate -tooltip.logout-endpoints-url=Logout Endpoints Url -tooltip.logout-endpoints-binding-type=Logout Endpoints Binding Type +tooltip.logout-endpoints=Logout Endpoints +tooltip.url=Logout Endpoints Url +tooltip.binding-type=Logout Endpoints Binding Type tooltip.mdui-display-name=Typically, the IdP Display Name field will be presented on IdP discovery service interfaces. tooltip.mdui-information-url=The IdP Information URL is a link to a comprehensive information page about the IdP. This page should expand on the content of the IdP Description field. tooltip.mdui-description=The IdP Description is a brief description of the IdP service. On a well-designed discovery interface, the IdP Description will be presented to the user in addition to the IdP Display Name, and so the IdP Description helps disambiguate duplicate or similar IdP Display Names. diff --git a/backend/src/main/resources/metadata-sources-ui-schema.json b/backend/src/main/resources/metadata-sources-ui-schema.json index e156a4c62..0f5b06d4c 100644 --- a/backend/src/main/resources/metadata-sources-ui-schema.json +++ b/backend/src/main/resources/metadata-sources-ui-schema.json @@ -22,8 +22,7 @@ "serviceEnabled": { "title": "label.enable-this-service", "description": "tooltip.enable-this-service-upon-saving", - "type": "boolean", - "default": false + "type": "boolean" }, "organization": { "$ref": "#/definitions/Organization" @@ -72,8 +71,7 @@ }, "properties": { "x509CertificateAvailable": { - "type": "boolean", - "default": true + "type": "boolean" }, "authenticationRequestsSigned": { "title": "label.authentication-requests-signed", diff --git a/ui/src/app/metadata/domain/source/SourceDefinition.js b/ui/src/app/metadata/domain/source/SourceDefinition.js index 2cbf83679..d3db4f603 100644 --- a/ui/src/app/metadata/domain/source/SourceDefinition.js +++ b/ui/src/app/metadata/domain/source/SourceDefinition.js @@ -64,6 +64,15 @@ export const SourceBase = { } } } + + if (formData?.securityInfo?.x509Certificates) { + if (formData.securityInfo.x509Certificates?.length > 0) { + d.securityInfo.x509CertificateAvailable = true; + } else { + d.securityInfo.x509CertificateAvailable = false; + } + } + return d; }, diff --git a/ui/src/app/metadata/editor/MetadataEditor.js b/ui/src/app/metadata/editor/MetadataEditor.js index d2ee2e56d..ffe6f01b6 100644 --- a/ui/src/app/metadata/editor/MetadataEditor.js +++ b/ui/src/app/metadata/editor/MetadataEditor.js @@ -18,6 +18,9 @@ import API_BASE_PATH from '../../App.constant'; import { MetadataObjectContext } from '../hoc/MetadataSelector'; import { FilterableProviders } from '../domain/provider'; +import { detailedDiff } from 'deep-object-diff'; +import { removeNull } from '../../core/utility/remove_null'; + export function MetadataEditor ({ current }) { const translator = useTranslator(); @@ -35,10 +38,16 @@ export function MetadataEditor ({ current }) { const { state, dispatch } = React.useContext(MetadataFormContext); const { metadata, errors } = state; + const checkChanges = (original, updates) => { + const diff = detailedDiff(original, removeNull(updates, true)); + const hasChanges = Object.keys(diff).some(d => Object.keys(diff[d]).length > 0); + return hasChanges; + }; + const onChange = (changes) => { dispatch(setFormDataAction(changes.formData)); dispatch(setFormErrorAction(changes.errors)); - setBlocking(true); + setBlocking(checkChanges(metadata, changes.formData)); }; function save(metadata) { diff --git a/ui/src/app/metadata/editor/MetadataEditorForm.js b/ui/src/app/metadata/editor/MetadataEditorForm.js index f1288fd16..eecd61530 100644 --- a/ui/src/app/metadata/editor/MetadataEditorForm.js +++ b/ui/src/app/metadata/editor/MetadataEditorForm.js @@ -34,8 +34,6 @@ export function MetadataEditorForm({ metadata, definition, schema, current, onCh onChange(definition.bindings ? { ...form, formData: definition.bindings(data, form.formData) }: form); }; - console.log(uiSchema); - return ( <> {step.locked &&