diff --git a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts index 0c924e6458b7..2573aacf3c4d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts @@ -256,6 +256,16 @@ export class UmbDataTypeWorkspaceContext const mergedSettings = settings.flat(); + // check if there is alias duplicates: + const aliasSet = new Set(); + for (const setting of mergedSettings) { + if (aliasSet.has(setting.alias)) { + console.error(`There is a duplicate alias "${setting.alias}" in the Property Editor configuration.`); + continue; + } + aliasSet.add(setting.alias); + } + if (mergedSettings) { this.#properties.setValue(mergedSettings); @@ -294,17 +304,16 @@ export class UmbDataTypeWorkspaceContext const values: Array = []; // We want to keep the existing data, if it is not in the default data, and if it is in the default data, then we want to keep the default data. - for (const defaultDataItem of this.#properties.getValue()) { + for (const property of this.#properties.getValue()) { // We are matching on the alias, as we assume that the alias is unique for the data type. - // TODO: Consider if we should also match on the editorAlias just to be on the safe side [JOV] - const existingData = data.values?.find((x) => x.alias === defaultDataItem.alias); + const existingData = data.values?.find((x) => x.alias === property.alias); if (existingData) { values.push(existingData); continue; } // If the data is not in the existing data, then we want to add the default data if it exists. - const existingDefaultData = this.#settingsDefaultData.find((x) => x.alias === defaultDataItem.alias); + const existingDefaultData = this.#settingsDefaultData.find((x) => x.alias === property.alias); if (existingDefaultData) { values.push(existingDefaultData); } diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts index 91a18c373cec..7526b74a437a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/Umbraco.Slider.ts @@ -25,7 +25,8 @@ export const manifest: ManifestPropertyEditorSchema = { { alias: 'minimumRange', label: 'Minimum range', - description: '', + description: + 'Minimum difference between the low and high values when range is enabled. Set to 0 to allow equal values.', propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', config: [{ alias: 'step', value: '0.00001' }], }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts index a897981ed46a..18a1fe3f1555 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/property-editors/slider/manifests.ts @@ -48,14 +48,6 @@ export const manifests: Array = [ propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', config: [{ alias: 'step', value: '0.00001' }], }, - { - alias: 'minimumRange', - label: 'Minimum range', - description: - 'Minimum difference between the low and high values when range is enabled. Set to 0 to allow equal values.', - propertyEditorUiAlias: 'Umb.PropertyEditorUi.Decimal', - config: [{ alias: 'step', value: '0.00001' }], - }, ], defaultData: [ { @@ -70,10 +62,6 @@ export const manifests: Array = [ alias: 'step', value: 1.0, }, - { - alias: 'minimumRange', - value: 0.0, - }, ], }, },