From 20152d36075a218c033efbd0cf6fa236f9b6aeb4 Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:16:47 +0200 Subject: [PATCH 01/11] auto generate alias --- .../input-with-alias.element.ts | 11 +++-- ...ent-type-design-editor-property.element.ts | 28 ++++++----- .../template-workspace-editor.element.ts | 47 ++++++------------- 3 files changed, 38 insertions(+), 48 deletions(-) diff --git a/src/packages/core/components/input-with-alias/input-with-alias.element.ts b/src/packages/core/components/input-with-alias/input-with-alias.element.ts index f4adf36945..5036dba3c1 100644 --- a/src/packages/core/components/input-with-alias/input-with-alias.element.ts +++ b/src/packages/core/components/input-with-alias/input-with-alias.element.ts @@ -66,6 +66,9 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin - - ${this.aliasReadonly @@ -98,7 +99,7 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin `} - + `; } diff --git a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index f080a295e8..7512ea7a20 100644 --- a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -27,6 +27,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { #dataTypeDetailRepository = new UmbDataTypeDetailRepository(this); #settingsModal; #dataTypeUnique?: string; + #propertyUnique?: string; #context = new UmbPropertyTypeContext(this); @property({ attribute: false }) @@ -57,6 +58,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { this.#context.setAlias(value?.alias); this.#context.setLabel(value?.name); this.#checkInherited(); + this.#checkAliasAutoGenerate(this._property?.id); this.#settingsModal.setUniquePathValue('propertyId', value?.id); this.#setDataType(this._property?.dataType?.unique); this.requestUpdate('property', oldValue); @@ -84,8 +86,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { @state() private _dataTypeName?: string; - @state() - private _aliasLocked = true; + #autoGenerateAlias = true; constructor() { super(); @@ -108,6 +109,15 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { }); } + #checkAliasAutoGenerate(unique: string | undefined) { + if (unique === this.#propertyUnique) return; + this.#propertyUnique = unique; + + if (this.#context.getAlias()) { + this.#autoGenerateAlias = false; + } + } + async #checkInherited() { if (this._propertyStructureHelper && this._property) { // We can first match with something if we have a name [NL] @@ -140,7 +150,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { } #onToggleAliasLock() { - this._aliasLocked = !this._aliasLocked; + this.#autoGenerateAlias = false; } async #setDataType(dataTypeUnique: string | undefined) { @@ -183,7 +193,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { const oldName = this.property?.name ?? ''; const oldAlias = this.property?.alias ?? ''; const newName = event.target.value.toString(); - if (this._aliasLocked) { + if (this.#autoGenerateAlias) { const expectedOldAlias = generateAlias(oldName ?? ''); // Only update the alias if the alias matches a generated alias of the old name (otherwise the alias is considered one written by the user.) if (expectedOldAlias === oldAlias) { @@ -295,22 +305,18 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { renderPropertyAlias() { return this.property - ? html` { if (e.target) this.#singleValueUpdate('alias', (e.target as HTMLInputElement).value); }}> - -
''} id="alias-lock" slot="prepend"> - -
-
` + ` : ''; } diff --git a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts index cdc9e97eb6..1a8f27755a 100644 --- a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts +++ b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts @@ -3,8 +3,6 @@ import type { UmbTemplatingInsertMenuElement } from '../../local-components/inse import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '../modals/query-builder/index.js'; import { getQuerySnippet } from '../../utils/index.js'; import { UMB_TEMPLATE_WORKSPACE_CONTEXT } from './template-workspace.context-token.js'; -import { toCamelCase } from '@umbraco-cms/backoffice/utils'; -import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui'; import { css, html, customElement, query, state, nothing, ifDefined } from '@umbraco-cms/backoffice/external/lit'; import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; @@ -12,6 +10,7 @@ import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import { Subject, debounceTime } from '@umbraco-cms/backoffice/external/rxjs'; import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; import { UMB_TEMPLATE_PICKER_MODAL } from '@umbraco-cms/backoffice/template'; +import { UmbInputWithAliasElement } from '@umbraco-cms/backoffice/components'; // import local components import '../../local-components/insert-menu/index.js'; @@ -43,9 +42,6 @@ export class UmbTemplateWorkspaceEditorElement extends UmbLitElement { #masterTemplateUnique: string | null = null; - // TODO: Revisit this code, to not use RxJS directly: - private inputQuery$ = new Subject(); - constructor() { super(); @@ -79,27 +75,9 @@ export class UmbTemplateWorkspaceEditorElement extends UmbLitElement { this.observe(this.#templateWorkspaceContext.isCodeEditorReady, (isReady) => { this._ready = isReady; }); - - this.inputQuery$.pipe(debounceTime(250)).subscribe((nameInputValue) => { - this.#templateWorkspaceContext?.setName(nameInputValue); - if (this.#isNew) this.#templateWorkspaceContext?.setAlias(toCamelCase(nameInputValue)); - }); }); } - #onNameInput(event: Event) { - const target = event.target as UUIInputElement; - const value = target.value as string; - this.inputQuery$.next(value); - } - - #onAliasInput(event: Event) { - event.stopPropagation(); - const target = event.target as UUIInputElement; - const value = target.value as string; - this.#templateWorkspaceContext?.setAlias(value); - } - #onCodeEditorInput(event: Event) { const target = event.target as UmbCodeEditorElement; const value = target.code as string; @@ -190,18 +168,24 @@ export class UmbTemplateWorkspaceEditorElement extends UmbLitElement { @input=${this.#onCodeEditorInput}>`; } + #onNameAndAliasChange(event: InputEvent & { target: UmbInputWithAliasElement }) { + this.#templateWorkspaceContext?.setName(event.target.value ?? ''); + this.#templateWorkspaceContext?.setAlias(event.target.alias ?? ''); + } + override render() { // TODO: add correct UI elements return html` - - - +
${this.#renderMasterTemplatePicker()}
@@ -258,9 +242,8 @@ export class UmbTemplateWorkspaceEditorElement extends UmbLitElement { --uui-color-divider-standalone: transparent; } - uui-input { + umb-input-with-alias { width: 100%; - margin: 1em; } #code-editor-menu-container uui-icon:not([name='icon-delete']) { From 5e27efc00c841d91005b537bfc26676773cbd059 Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:27:55 +0200 Subject: [PATCH 02/11] remove import --- .../templates/workspace/template-workspace-editor.element.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts index 1a8f27755a..9a9c3ec556 100644 --- a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts +++ b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts @@ -7,7 +7,6 @@ import { css, html, customElement, query, state, nothing, ifDefined } from '@umb import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; -import { Subject, debounceTime } from '@umbraco-cms/backoffice/external/rxjs'; import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; import { UMB_TEMPLATE_PICKER_MODAL } from '@umbraco-cms/backoffice/template'; import { UmbInputWithAliasElement } from '@umbraco-cms/backoffice/components'; From 7338d392299b8ec60a81a7274063b8dd0a9838e3 Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Thu, 4 Jul 2024 14:34:19 +0200 Subject: [PATCH 03/11] type --- .../templates/workspace/template-workspace-editor.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts index 9a9c3ec556..7d747f111f 100644 --- a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts +++ b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts @@ -9,7 +9,7 @@ import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; import { UMB_TEMPLATE_PICKER_MODAL } from '@umbraco-cms/backoffice/template'; -import { UmbInputWithAliasElement } from '@umbraco-cms/backoffice/components'; +import type { UmbInputWithAliasElement } from '@umbraco-cms/backoffice/components'; // import local components import '../../local-components/insert-menu/index.js'; From 8bf9cade46927624315b801cf4693d31265a3b00 Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:42:50 +0200 Subject: [PATCH 04/11] re-enable auto generate alias on empty and locked --- .../input-with-alias.element.ts | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/packages/core/components/input-with-alias/input-with-alias.element.ts b/src/packages/core/components/input-with-alias/input-with-alias.element.ts index 5036dba3c1..17d905e7be 100644 --- a/src/packages/core/components/input-with-alias/input-with-alias.element.ts +++ b/src/packages/core/components/input-with-alias/input-with-alias.element.ts @@ -40,12 +40,8 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin - ${this.aliasReadonly - ? nothing - : html` -
''} id="alias-lock" slot="prepend"> - -
- `} `; From c490191dca6daab4bcedde8912fec2fab406520f Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:44:33 +0200 Subject: [PATCH 05/11] unused --- .../views/design/content-type-design-editor-property.element.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index a262def060..0de7e83908 100644 --- a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -25,7 +25,6 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { // #dataTypeDetailRepository = new UmbDataTypeDetailRepository(this); #dataTypeUnique?: string; - #propertyUnique?: string; #context = new UmbPropertyTypeContext(this); @property({ attribute: false }) From bf9fc3402094f578217317cb36967bea93976d0b Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:11:47 +0200 Subject: [PATCH 06/11] property alias generate --- ...ent-type-design-editor-property.element.ts | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index 0de7e83908..30f368c45c 100644 --- a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -1,6 +1,6 @@ import { UmbPropertyTypeContext } from './content-type-design-editor-property.context.js'; import { UmbDataTypeDetailRepository } from '@umbraco-cms/backoffice/data-type'; -import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui'; +import type { UUIInputElement, UUIInputLockElement } from '@umbraco-cms/backoffice/external/uui'; import { UUIInputEvent } from '@umbraco-cms/backoffice/external/uui'; import { css, html, customElement, property, state, nothing } from '@umbraco-cms/backoffice/external/lit'; import { umbConfirmModal } from '@umbraco-cms/backoffice/modal'; @@ -25,6 +25,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { // #dataTypeDetailRepository = new UmbDataTypeDetailRepository(this); #dataTypeUnique?: string; + #propertyUnique?: string; #context = new UmbPropertyTypeContext(this); @property({ attribute: false }) @@ -55,6 +56,7 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { this.#context.setAlias(value?.alias); this.#context.setLabel(value?.name); this.#checkInherited(); + this.#checkAliasAutoGenerate(this._property?.id); this.#setDataType(this._property?.dataType?.unique); this.requestUpdate('property', oldValue); } @@ -83,6 +85,25 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { #autoGenerateAlias = true; + #checkAliasAutoGenerate(unique: string | undefined) { + if (unique === this.#propertyUnique) return; + this.#propertyUnique = unique; + + // TODO: We are only getting what is auto-generated back, not what is written by the user?? + // Test: Add new property. Give it name "Amazing". See that the alias is "amazing". + // Change alias to "cookie". Change name to "AmazingTour". Submit it and see we receive the "amazing" alias. Not "cookie" nor "amazingTour". + const name = this.property?.name ?? ''; + const alias = this.property?.alias ?? ''; + + const expectedAlias = generateAlias(name ?? ''); + if (expectedAlias === alias) { + // If the alias is the same as the expected alias, we assume it's untouched and will continue auto generating alias here. + this.#autoGenerateAlias = true; + } else { + this.#autoGenerateAlias = false; + } + } + async #checkInherited() { if (this._propertyStructureHelper && this._property) { // We can first match with something if we have a name [NL] @@ -114,8 +135,12 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { this._propertyStructureHelper.partialUpdateProperty(this._property.id, partialObject); } - #onToggleAliasLock() { - this.#autoGenerateAlias = false; + #onToggleAliasLock(e: CustomEvent) { + if (!this.property?.alias && (e.target as UUIInputLockElement).locked) { + this.#autoGenerateAlias = true; + } else { + this.#autoGenerateAlias = false; + } } async #setDataType(dataTypeUnique: string | undefined) { @@ -155,15 +180,9 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { const target = event.composedPath()[0] as UUIInputElement; if (typeof target?.value === 'string') { - const oldName = this.property?.name ?? ''; - const oldAlias = this.property?.alias ?? ''; const newName = event.target.value.toString(); if (this.#autoGenerateAlias) { - const expectedOldAlias = generateAlias(oldName ?? ''); - // Only update the alias if the alias matches a generated alias of the old name (otherwise the alias is considered one written by the user.) - if (expectedOldAlias === oldAlias) { - this.#singleValueUpdate('alias', generateAlias(newName ?? '')); - } + this.#singleValueUpdate('alias', generateAlias(newName ?? '')); } this.#singleValueUpdate('name', newName); } From ea1dab574f389fc5b13d4c890acd871e001caffe Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:36:06 +0200 Subject: [PATCH 07/11] property modal - auto gen alias --- ...roperty-workspace-view-settings.element.ts | 54 +++++++++++-------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/src/packages/core/property-type/workspace/views/settings/property-workspace-view-settings.element.ts b/src/packages/core/property-type/workspace/views/settings/property-workspace-view-settings.element.ts index 1ea69dacd3..4c08ad59ad 100644 --- a/src/packages/core/property-type/workspace/views/settings/property-workspace-view-settings.element.ts +++ b/src/packages/core/property-type/workspace/views/settings/property-workspace-view-settings.element.ts @@ -1,11 +1,16 @@ import { UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT } from '../../../index.js'; -import { css, html, customElement, state, nothing } from '@umbraco-cms/backoffice/external/lit'; +import { css, html, customElement, state, nothing, query } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/extension-registry'; import type { UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type'; import { UMB_CONTENT_TYPE_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/content-type'; -import type { UUIBooleanInputEvent, UUIInputEvent, UUISelectEvent } from '@umbraco-cms/backoffice/external/uui'; +import type { + UUIBooleanInputEvent, + UUIInputEvent, + UUIInputLockElement, + UUISelectEvent, +} from '@umbraco-cms/backoffice/external/uui'; import { generateAlias } from '@umbraco-cms/backoffice/utils'; @customElement('umb-property-type-workspace-view-settings') @@ -42,18 +47,28 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i @state() private _aliasLocked = true; + @state() + private _autoGenerateAlias = true; + @state() private _contentTypeVariesByCulture?: boolean; @state() private _contentTypeVariesBySegment?: boolean; + @query('#alias-input') + private _aliasInput!: UUIInputLockElement; + constructor() { super(); this.consumeContext(UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT, (instance) => { this.#context = instance; this.observe(instance.data, (data) => { + if (!this._data && data?.alias) { + // Initial. Loading existing property + this._autoGenerateAlias = false; + } this._data = data; }); }); @@ -69,23 +84,16 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i } #onNameChange(event: UUIInputEvent) { - const oldName = this._data?.name; - const oldAlias = this._data?.alias; this.updateValue({ name: event.target.value.toString() }); - if (this._aliasLocked) { - const expectedOldAlias = generateAlias(oldName ?? ''); - // Only update the alias if the alias matches a generated alias of the old name (otherwise the alias is considered one written by the user.) [NL] - if (expectedOldAlias === oldAlias) { - this.updateValue({ alias: generateAlias(this._data?.name ?? '') }); - } + if (this._aliasLocked && this._autoGenerateAlias) { + this.updateValue({ alias: generateAlias(this._data?.name ?? '') }); } } - #onAliasChange(event: UUIInputEvent) { - const alias = generateAlias(event.target.value.toString()); - if (this._aliasLocked) { - this.updateValue({ alias }); - } + #onAliasChange() { + // TODO: Why can I not get the correct value via event? Is it an issue in uui library too? + const alias = generateAlias(this._aliasInput.value.toString()); + this.updateValue({ alias }); } #onDescriptionChange(event: UUIInputEvent) { @@ -130,6 +138,12 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i #onToggleAliasLock() { this._aliasLocked = !this._aliasLocked; + if (this._aliasLocked && !this._data?.alias) { + // Reenable auto-generate if alias is empty and locked. + this._autoGenerateAlias = true; + } else { + this._autoGenerateAlias = false; + } } #onCustomValidationChange(event: UUISelectEvent) { @@ -186,19 +200,17 @@ export class UmbPropertyTypeWorkspaceViewSettingsElement extends UmbLitElement i ${umbFocus()}> - + ?locked=${this._aliasLocked}> -
''} id="alias-lock" slot="prepend"> - -
-
+ Date: Wed, 10 Jul 2024 13:49:18 +0200 Subject: [PATCH 08/11] auto generate property off for existing properties --- ...tent-type-design-editor-property.element.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index 30f368c45c..b3f0566a5e 100644 --- a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -55,8 +55,8 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { this._property = value; this.#context.setAlias(value?.alias); this.#context.setLabel(value?.name); - this.#checkInherited(); this.#checkAliasAutoGenerate(this._property?.id); + this.#checkInherited(); this.#setDataType(this._property?.dataType?.unique); this.requestUpdate('property', oldValue); } @@ -88,20 +88,26 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { #checkAliasAutoGenerate(unique: string | undefined) { if (unique === this.#propertyUnique) return; this.#propertyUnique = unique; + this.#autoGenerateAlias; - // TODO: We are only getting what is auto-generated back, not what is written by the user?? - // Test: Add new property. Give it name "Amazing". See that the alias is "amazing". - // Change alias to "cookie". Change name to "AmazingTour". Submit it and see we receive the "amazing" alias. Not "cookie" nor "amazingTour". - const name = this.property?.name ?? ''; - const alias = this.property?.alias ?? ''; + if (this.#context.getAlias()) { + this.#autoGenerateAlias = false; + } + + /* TODO: Do we know if we are loading an existing property (do not auto generate alias) or added a new property (auto-generate only if matching expected alias)? + Maybe its fine and we don't want to automatically auto-generate alias anymore at this stage. Can still auto-generate by deleting the alias + locking it. + const alias = this.property?.alias ?? ''; + const name = this.property?.name ?? ''; const expectedAlias = generateAlias(name ?? ''); + if (expectedAlias === alias) { // If the alias is the same as the expected alias, we assume it's untouched and will continue auto generating alias here. this.#autoGenerateAlias = true; } else { this.#autoGenerateAlias = false; } + */ } async #checkInherited() { From 2d16a528c8f9f48f12e38a3310908d4f566b2184 Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:57:18 +0200 Subject: [PATCH 09/11] unused --- .../components/input-with-alias/input-with-alias.element.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/packages/core/components/input-with-alias/input-with-alias.element.ts b/src/packages/core/components/input-with-alias/input-with-alias.element.ts index 17d905e7be..2cff7d3c81 100644 --- a/src/packages/core/components/input-with-alias/input-with-alias.element.ts +++ b/src/packages/core/components/input-with-alias/input-with-alias.element.ts @@ -36,8 +36,6 @@ export class UmbInputWithAliasElement extends UmbFormControlMixin Date: Wed, 10 Jul 2024 14:00:02 +0200 Subject: [PATCH 10/11] unused import --- .../components/input-with-alias/input-with-alias.element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/core/components/input-with-alias/input-with-alias.element.ts b/src/packages/core/components/input-with-alias/input-with-alias.element.ts index 2cff7d3c81..b680e0359a 100644 --- a/src/packages/core/components/input-with-alias/input-with-alias.element.ts +++ b/src/packages/core/components/input-with-alias/input-with-alias.element.ts @@ -1,4 +1,4 @@ -import { css, customElement, html, nothing, property, state } from '@umbraco-cms/backoffice/external/lit'; +import { css, customElement, html, property, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbChangeEvent } from '@umbraco-cms/backoffice/event'; import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; From fb4af23bcd54d8ac2059e2ae890331bfdd92c214 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 20 Aug 2024 16:57:39 +0100 Subject: [PATCH 11/11] Removed TODO note as v13 didn't perform that logic. --- ...content-type-design-editor-property.element.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts index 410ab341fc..cde5a28ab9 100644 --- a/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/packages/core/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -93,21 +93,6 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { if (this.#context.getAlias()) { this.#autoGenerateAlias = false; } - - /* TODO: Do we know if we are loading an existing property (do not auto generate alias) or added a new property (auto-generate only if matching expected alias)? - Maybe its fine and we don't want to automatically auto-generate alias anymore at this stage. Can still auto-generate by deleting the alias + locking it. - - const alias = this.property?.alias ?? ''; - const name = this.property?.name ?? ''; - const expectedAlias = generateAlias(name ?? ''); - - if (expectedAlias === alias) { - // If the alias is the same as the expected alias, we assume it's untouched and will continue auto generating alias here. - this.#autoGenerateAlias = true; - } else { - this.#autoGenerateAlias = false; - } - */ } async #checkInherited() {