workspace working with nested blocks

This commit is contained in:
Niels Lyngsø
2024-02-09 21:54:49 +01:00
parent 6ea67225e9
commit 5373187170
2 changed files with 8 additions and 4 deletions

View File

@@ -23,11 +23,13 @@ export class UmbBlockGridEntriesContext extends UmbBlockEntriesContext<
#areaKey?: string | null;
setParentUnique(contentUdi: string | null) {
this._workspaceModal.setUniquePathValue('parentUnique', contentUdi ?? 'null');
this.#catalogueModal.setUniquePathValue('parentUnique', contentUdi ?? 'null');
}
setAreaKey(areaKey: string | null) {
this.#areaKey = areaKey;
this._workspaceModal.setUniquePathValue('areaKey', areaKey ?? 'null');
this.#catalogueModal.setUniquePathValue('areaKey', areaKey ?? 'null');
this.#gotAreaKey();
}
@@ -35,6 +37,8 @@ export class UmbBlockGridEntriesContext extends UmbBlockEntriesContext<
constructor(host: UmbControllerHost) {
super(host, UMB_BLOCK_GRID_MANAGER_CONTEXT);
this._workspaceModal.addUniquePaths(['parentUnique', 'areaKey']);
this.#retrieveParentEntry = this.consumeContext(UMB_BLOCK_GRID_ENTRY_CONTEXT, (blockGridEntry) => {
this.#parentEntry = blockGridEntry;
this.#gotBlockParentEntry();

View File

@@ -21,7 +21,7 @@ export abstract class UmbBlockEntriesContext<
_manager?: BlockManagerContextType;
_retrieveManager;
#workspaceModal: UmbModalRouteRegistrationController;
_workspaceModal: UmbModalRouteRegistrationController;
#workspacePath = new UmbStringState(undefined);
workspacePath = this.#workspacePath.asObservable();
@@ -41,7 +41,7 @@ export abstract class UmbBlockEntriesContext<
this.observe(
this._manager.propertyAlias,
(alias) => {
this.#workspaceModal.setUniquePathValue('propertyAlias', alias);
this._workspaceModal.setUniquePathValue('propertyAlias', alias);
},
'observePropertyAlias',
);
@@ -49,13 +49,13 @@ export abstract class UmbBlockEntriesContext<
this._manager.variantId,
(variantId) => {
// TODO: This might not be the property variant ID, but the content variant ID. Check up on what makes most sense?
this.#workspaceModal.setUniquePathValue('variantId', variantId?.toString());
this._workspaceModal.setUniquePathValue('variantId', variantId?.toString());
},
'observePropertyVariantId',
);
}).asPromise();
this.#workspaceModal = new UmbModalRouteRegistrationController(this, UMB_BLOCK_WORKSPACE_MODAL)
this._workspaceModal = new UmbModalRouteRegistrationController(this, UMB_BLOCK_WORKSPACE_MODAL)
.addUniquePaths(['propertyAlias', 'variantId'])
.addAdditionalPath('block')
.onSetup(() => {