From 8f1a07deb1b08dd6e68077d67bf7cfcb5753f49a Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 11 Nov 2024 12:35:40 +0100 Subject: [PATCH 01/38] remove custom implementation from data type --- .../workspace/data-type-workspace.context.ts | 13 ------------- 1 file changed, 13 deletions(-) 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 243e17d46bcb..eb2f69532f1e 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 @@ -114,19 +114,6 @@ export class UmbDataTypeWorkspaceContext ]); } - override async load(unique: string) { - const response = await super.load(unique); - this.observe(response.asObservable?.(), (entity) => this.#onStoreChange(entity), 'umbDataTypeStoreObserver'); - return response; - } - - #onStoreChange(entity: EntityType | undefined) { - if (!entity) { - //TODO: This solution is alright for now. But reconsider when we introduce signal-r - history.pushState(null, '', 'section/settings/workspace/data-type-root'); - } - } - override resetState() { super.resetState(); this.#propertyEditorSchemaSettingsProperties = []; From e571a7bd4bee1d67adfab1d5a00cd1eab28c9e53 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 11 Nov 2024 12:36:10 +0100 Subject: [PATCH 02/38] clear workspace data when entity gets removed from the store --- .../entity-detail/entity-detail-workspace-base.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts index 855370f93a2a..4981bd756fee 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/entity-detail/entity-detail-workspace-base.ts @@ -133,11 +133,24 @@ export abstract class UmbEntityDetailWorkspaceContextBase< this._data.setPersisted(data); this._data.setCurrent(data); this.setIsNew(false); + + this.observe( + response.asObservable(), + (entity) => this.#onStoreChange(entity), + 'umbEntityDetailTypeStoreObserver', + ); } return response; } + #onStoreChange(entity: DetailModelType | undefined) { + if (!entity) { + this._data.setPersisted(undefined); + this._data.setCurrent(undefined); + } + } + /** * Method to check if the workspace data is loaded. * @returns { Promise | undefined } true if the workspace data is loaded. From a603379b0dc23a03eb1564eaf45ae908d43b1ff5 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 11 Nov 2024 13:50:27 +0100 Subject: [PATCH 03/38] remove unused alias --- ...ck-grid-area-type-workspace-editor.element.ts | 16 ++++------------ .../block-grid-area-type-workspace.context.ts | 2 -- .../block-type-workspace-editor.element.ts | 16 ++++------------ .../workspace/block-type-workspace.context.ts | 4 ---- .../workspace/block-workspace-editor.element.ts | 7 +------ .../block/workspace/block-workspace.context.ts | 3 --- .../property-type-workspace-editor.element.ts | 7 +------ .../workspace/property-type-workspace.context.ts | 4 ---- .../workspace-footer/workspace-footer.element.ts | 1 - .../workspace-split-view.element.ts | 4 ---- .../kinds/default/default-workspace.element.ts | 1 - .../data-type-workspace-editor.element.ts | 2 +- ...ent-blueprint-workspace-split-view.element.ts | 1 - .../document-type-workspace-editor.element.ts | 2 +- .../document-workspace-split-view.element.ts | 1 - .../language-workspace-editor.element.ts | 4 +--- .../media-type-workspace-editor.element.ts | 2 +- .../media-workspace-split-view.element.ts | 1 - .../member-group-workspace-editor.element.ts | 2 +- .../member-type-workspace-editor.element.ts | 2 +- .../member-workspace-split-view.element.ts | 1 - .../workspace-package-builder.element.ts | 6 +----- .../workspace/workspace-package.element.ts | 2 +- .../created-packages-section-view.element.ts | 6 ------ .../relation-type-workspace-editor.element.ts | 2 +- ...rtial-view-folder-workspace-editor.element.ts | 3 +-- .../partial-view-workspace-editor.element.ts | 2 +- .../script-folder-workspace-editor.element.ts | 4 +--- .../workspace/script-workspace-editor.element.ts | 2 +- ...stylesheet-folder-workspace-editor.element.ts | 4 +--- .../stylesheet-workspace-editor.element.ts | 2 +- .../template-workspace-editor.element.ts | 2 +- .../user-group-workspace-editor.element.ts | 6 +----- .../user/user-workspace-editor.element.ts | 6 +----- .../webhook/webhook-workspace-editor.element.ts | 6 +----- 35 files changed, 29 insertions(+), 107 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace-editor.element.ts index 20056eaf6ecd..5ddfa4ad5ac1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace-editor.element.ts @@ -5,15 +5,11 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-block-grid-area-type-workspace-editor') export class UmbBlockGridAreaTypeWorkspaceEditorElement extends UmbLitElement { - // #workspaceContext?: typeof UMB_BLOCK_GRID_AREA_TYPE_WORKSPACE_CONTEXT.TYPE; @state() _name?: string; - @property({ type: String, attribute: false }) - workspaceAlias?: string; - constructor() { super(); @@ -28,14 +24,10 @@ export class UmbBlockGridAreaTypeWorkspaceEditorElement extends UmbLitElement { // TODO: Localization, make it so that the headline is about area configuration? override render() { - return this.workspaceAlias - ? html` - - - ` - : ''; + return html` + + + `; } static override styles = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace.context.ts index 906c503a5713..4599a17cd889 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-area-config-entry/workspace/block-grid-area-type-workspace.context.ts @@ -56,7 +56,6 @@ export class UmbBlockGridAreaTypeWorkspaceContext component: () => import('./block-grid-area-type-workspace-editor.element.js'), setup: (component, info) => { const id = info.match.params.id; - (component as any).workspaceAlias = manifest.alias; this.load(id); }, }, @@ -64,7 +63,6 @@ export class UmbBlockGridAreaTypeWorkspaceContext path: 'create', component: () => import('./block-grid-area-type-workspace-editor.element.js'), setup: (component) => { - (component as any).workspaceAlias = manifest.alias; this.create(); }, }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace-editor.element.ts index 18a5dacd63a9..d51e9efc2865 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace-editor.element.ts @@ -8,7 +8,6 @@ import { UMB_DOCUMENT_TYPE_ITEM_REPOSITORY_ALIAS } from '@umbraco-cms/backoffice @customElement('umb-block-type-workspace-editor') export class UmbBlockTypeWorkspaceEditorElement extends UmbLitElement { - // #itemManager = new UmbRepositoryItemsManager( this, UMB_DOCUMENT_TYPE_ITEM_REPOSITORY_ALIAS, @@ -20,9 +19,6 @@ export class UmbBlockTypeWorkspaceEditorElement extends UmbLitElement { @state() _name?: string; - @property({ type: String, attribute: false }) - workspaceAlias?: string; - constructor() { super(); @@ -45,14 +41,10 @@ export class UmbBlockTypeWorkspaceEditorElement extends UmbLitElement { } override render() { - return this.workspaceAlias - ? html` - - - ` - : ''; + return html` + + + `; } static override styles = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts index 4b99ed1c3b0c..e9e6d295af05 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts @@ -50,8 +50,6 @@ export class UmbBlockTypeWorkspaceContext { - (component as UmbBlockTypeWorkspaceEditorElement).workspaceAlias = manifest.alias; - const elementTypeKey = info.match.params.elementTypeKey; const groupKey = info.match.params.groupKey === 'null' ? null : info.match.params.groupKey; await this.create(elementTypeKey, groupKey); @@ -67,8 +65,6 @@ export class UmbBlockTypeWorkspaceContext { - (component as UmbBlockTypeWorkspaceEditorElement).workspaceAlias = manifest.alias; - const id = info.match.params.id; this.load(id); }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts index 1e8cefd58591..529074a07990 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace-editor.element.ts @@ -6,9 +6,6 @@ import { observeMultiple } from '@umbraco-cms/backoffice/observable-api'; @customElement('umb-block-workspace-editor') export class UmbBlockWorkspaceEditorElement extends UmbLitElement { - @property({ type: String, attribute: false }) - workspaceAlias?: string; - constructor() { super(); this.consumeContext(UMB_BLOCK_WORKSPACE_CONTEXT, (context) => { @@ -30,9 +27,7 @@ export class UmbBlockWorkspaceEditorElement extends UmbLitElement { _headline: string = ''; override render() { - return this.workspaceAlias - ? html` ` - : nothing; + return html` `; } static override readonly styles = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts index d7f83662feae..f7c829e4b0fc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/block-workspace.context.ts @@ -176,8 +176,6 @@ export class UmbBlockWorkspaceContext { - (component as UmbBlockWorkspaceEditorElement).workspaceAlias = manifest.alias; - const elementTypeKey = info.match.params.elementTypeKey; await this.create(elementTypeKey); @@ -192,7 +190,6 @@ export class UmbBlockWorkspaceContext { - (component as UmbBlockWorkspaceEditorElement).workspaceAlias = manifest.alias; const key = decodeFilePath(info.match.params.key); this.load(key); }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts index a68efbee13a0..5ff7d607e351 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-type/workspace/property-type-workspace-editor.element.ts @@ -4,7 +4,6 @@ import { customElement, css, html, state, property } from '@umbraco-cms/backoffi import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-property-type-workspace-editor') export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { - // #workspaceContext?: typeof UMB_PROPERTY_TYPE_WORKSPACE_CONTEXT.TYPE; @state() @@ -13,9 +12,6 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { @state() _name?: string; - @property({ type: String, attribute: false }) - workspaceAlias?: string; - constructor() { super(); @@ -32,10 +28,9 @@ export class UmbPropertyTypeWorkspaceEditorElement extends UmbLitElement { } override render() { - return this.workspaceAlias && this._isNew !== undefined + return this._isNew !== undefined ? html` { - (component as UmbPropertyTypeWorkspaceEditorElement).workspaceAlias = manifest.alias; - const containerUnique = info.match.params.containerUnique === 'null' ? null : info.match.params.containerUnique; await this.create(containerUnique); @@ -85,8 +83,6 @@ export class UmbPropertyTypeWorkspaceContext { - (component as UmbPropertyTypeWorkspaceEditorElement).workspaceAlias = manifest.alias; - const unique = info.match.params.unique; this.load(unique); }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-footer/workspace-footer.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-footer/workspace-footer.element.ts index b34f61e59d47..180c74525d5d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-footer/workspace-footer.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-footer/workspace-footer.element.ts @@ -24,7 +24,6 @@ function ExtensionApiArgsMethod( /** * @element umb-workspace-footer - * @description Uses the alias to insert extensions that targets this workspace-alias. * @slot - Slot for workspace footer items * @slot actions - Slot for workspace actions * @class UmbWorkspaceFooterLayout diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts index d20565411268..6283dd66177a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts @@ -14,9 +14,6 @@ import './workspace-split-view-variant-selector.element.js'; */ @customElement('umb-workspace-split-view') export class UmbWorkspaceSplitViewElement extends UmbLitElement { - @property() - alias!: string; - @property({ type: Boolean }) displayNavigation = false; @@ -43,7 +40,6 @@ export class UmbWorkspaceSplitViewElement extends UmbLitElement { override render() { return html` diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/default/default-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/default/default-workspace.element.ts index 59596972ce80..ba2875f9ac8c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/default/default-workspace.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/default/default-workspace.element.ts @@ -13,7 +13,6 @@ export class UmbDefaultWorkspaceElement extends UmbLitElement { const headline = this.manifest?.meta.headline; return html` `; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace-editor.element.ts index ef4b4ddeda63..7456daa033c2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace-editor.element.ts @@ -17,7 +17,7 @@ export class UmbDataTypeWorkspaceEditorElement extends UmbLitElement { override render() { return html` - + `; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-split-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-split-view.element.ts index 35723116aeaf..3b9e61341fbe 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-split-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-split-view.element.ts @@ -42,7 +42,6 @@ export class UmbDocumentBlueprintWorkspaceSplitViewElement extends UmbLitElement view.index + '_' + (view.culture ?? '') + '_' + (view.segment ?? '') + '_' + this._variants!.length, (view) => html` `, diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts index 275fd2aacc8b..6fe2558d9d88 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type/document-type-workspace-editor.element.ts @@ -78,7 +78,7 @@ export class UmbDocumentTypeWorkspaceEditorElement extends UmbLitElement { override render() { return html` - +