Skip to content

Commit b68a6a9

Browse files
authored
Data Type: use Property Editor UI label instead over name (#20716)
Prioritize using the property editor ui label and localize it.
1 parent a4d893a commit b68a6a9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/Umbraco.Web.UI.Client/src/packages/data-type/modals/data-type-picker-flow/data-type-picker-flow-modal.element.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement<
142142
}
143143
this.removeUmbController(contentContextConsumer);
144144
this.removeUmbController(propContextConsumer);
145-
const propertyEditorName = this.#propertyEditorUIs.find((ui) => ui.alias === params.uiAlias)?.name;
145+
const propertyEditorUiManifest = this.#propertyEditorUIs.find((ui) => ui.alias === params.uiAlias);
146+
const propertyEditorName = this.localize.string(
147+
propertyEditorUiManifest?.meta?.label || propertyEditorUiManifest?.name || '#general_notFound',
148+
);
146149
const dataTypeName = `${contentContext?.getName() ?? ''} - ${propContext.getName() ?? ''} - ${propertyEditorName}`;
147150

148151
return {

src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class UmbDataTypeWorkspaceContext
208208
umbExtensionsRegistry.byTypeAndAlias('propertyEditorUi', propertyEditorUIAlias),
209209
(manifest) => {
210210
this.#propertyEditorUiIcon.setValue(manifest?.meta.icon || null);
211-
this.#propertyEditorUiName.setValue(manifest?.name || null);
211+
this.#propertyEditorUiName.setValue(manifest?.meta?.label || manifest?.name || null);
212212

213213
// Maps properties to have a weight, so they can be sorted, notice UI properties have a +1000 weight compared to schema properties.
214214
this.#propertyEditorUISettingsProperties = (manifest?.meta.settings?.properties ?? []).map((x, i) => ({

src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/views/details/data-type-details-workspace-property-editor-picker.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class UmbDataTypeDetailsWorkspacePropertyEditorPickerElement extends UmbF
8383
#renderPropertyEditorReference() {
8484
if (!this.propertyEditorUiAlias || !this.propertyEditorSchemaAlias) return nothing;
8585

86-
let name = this.propertyEditorUiName;
86+
let name = this.localize.string(this.propertyEditorUiName);
8787
let alias = this.propertyEditorUiAlias;
8888
let error = false;
8989

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataType/RichTextEditor.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import {expect} from "@playwright/test";
33

44
const dataTypeName = 'Richtext editor';
5-
const tipTapPropertyEditorName = 'Rich Text Editor [Tiptap] Property Editor UI';
65
const tipTapAlias = 'Umbraco.RichText';
76
const tipTapUiAlias = 'Umb.PropertyEditorUi.Tiptap';
87
const extensionsDefaultValue = [
@@ -81,10 +80,9 @@ test('tiptap is the default property editor in rich text editor', async ({umbrac
8180
// Act
8281
await umbracoUi.dataType.goToDataType(dataTypeName);
8382

84-
// Assert
83+
// Assert
8584
await umbracoUi.dataType.doesSettingHaveValue(ConstantHelper.tipTapSettings);
8685
await umbracoUi.dataType.doesSettingItemsHaveCount(ConstantHelper.tipTapSettings);
87-
await umbracoUi.dataType.doesPropertyEditorHaveName(tipTapPropertyEditorName);
8886
await umbracoUi.dataType.doesPropertyEditorHaveAlias(tipTapAlias);
8987
await umbracoUi.dataType.doesPropertyEditorHaveUiAlias(tipTapUiAlias);
9088
const dataTypeData = await umbracoApi.dataType.getByName(dataTypeName);
@@ -95,4 +93,4 @@ test('tiptap is the default property editor in rich text editor', async ({umbrac
9593
expect(await umbracoApi.dataType.doesTiptapExtensionsItemsMatchCount(dataTypeName, extensionsDefaultValue.length)).toBeTruthy();
9694
expect(await umbracoApi.dataType.doesTiptapExtensionsHaveItems(dataTypeName, extensionsDefaultValue)).toBeTruthy();
9795
expect(await umbracoApi.dataType.doesTiptapToolbarHaveItems(dataTypeName, toolbarDefaultValue)).toBeTruthy();
98-
});
96+
});

0 commit comments

Comments
 (0)