From 13c5fd84234fa8a03acc262cf01601d205e9473e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 6 Jan 2023 20:48:02 +0100 Subject: [PATCH] notes for next week --- .../views/edit/workspace-view-content-edit.element.ts | 11 +++++++++++ .../workspace-content/workspace-content.context.ts | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/edit/workspace-view-content-edit.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/edit/workspace-view-content-edit.element.ts index c45c5074b1..06f5900457 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/edit/workspace-view-content-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/views/edit/workspace-view-content-edit.element.ts @@ -40,11 +40,22 @@ export class UmbWorkspaceViewContentEditElement extends UmbLitElement { private _observeContent() { if (!this._workspaceContext) return; + /* + TODO: Property-Context: This observer gets all changes, We need to fix this. it should be simpler. + It should look at length and aliases? as long as they are identical nothing should change. + As they would update them selfs? + + Should use a Observable for this._workspaceContext.properties + */ this.observe( this._workspaceContext.data.pipe(distinctUntilChanged()), (content) => { this._properties = content.properties; this._data = content.data; + /* + Maybe we should not give the value, but the umb-content-property should get the context and observe its own data. + This would become a more specific Observer therefor better performance?.. Note to self: Debate with Mads how he sees this perspective. + */ } ); } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts index 4bbbb6245b..3ab1531a50 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts @@ -41,6 +41,9 @@ export class UmbWorkspaceContentContext< ) { this._host = host; + + //TODO: Use the UniqueBehaviorSubject, and separate observables for each part? + this._data = new BehaviorSubject(defaultData); this.data = this._data.asObservable(); this.entityType = entityType;