fix block workspace

This commit is contained in:
Niels Lyngsø
2024-03-20 14:29:12 +01:00
parent ac8c20cc04
commit e05ad9791c
4 changed files with 30 additions and 36 deletions

View File

@@ -26,7 +26,6 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
// Just for context token safety:
public readonly IS_BLOCK_WORKSPACE_CONTEXT = true;
//
readonly workspaceAlias;
#blockManager?: typeof UMB_BLOCK_MANAGER_CONTEXT.TYPE;
#retrieveBlockManager;
@@ -66,9 +65,6 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
super(host, workspaceArgs.manifest.alias);
const manifest = workspaceArgs.manifest;
this.#entityType = manifest.meta?.entityType;
this.workspaceAlias = manifest.alias;
console.log('BLOCK WORKSPACE CONTEXT', this, manifest);
this.#retrieveModalContext = this.consumeContext(UMB_MODAL_CONTEXT, (context) => {
this.#modalContext = context;

View File

@@ -77,27 +77,25 @@ export class UmbBlockWorkspaceViewEditTabElement extends UmbLitElement {
}
render() {
return this._containerId
? html`
${this._hasProperties
? html` <umb-block-workspace-view-edit-properties
.managerName=${this.#managerName}
class="properties"
.containerId=${this._containerId}></umb-block-workspace-view-edit-properties>`
: ''}
${repeat(
this._groups,
(group) => group.name,
(group) =>
html` <uui-box .headline=${group.name || ''}
><umb-block-workspace-view-edit-properties
.managerName=${this.#managerName}
class="properties"
.containerId=${group.id}></umb-block-workspace-view-edit-properties
></uui-box>`,
)}
`
: '';
return html`
${this._hasProperties
? html` <umb-block-workspace-view-edit-properties
.managerName=${this.#managerName}
class="properties"
.containerId=${this._containerId}></umb-block-workspace-view-edit-properties>`
: ''}
${repeat(
this._groups,
(group) => group.id,
(group) =>
html` <uui-box .headline=${group.name || ''}
><umb-block-workspace-view-edit-properties
.managerName=${this.#managerName}
class="properties"
.containerId=${group.id}></umb-block-workspace-view-edit-properties
></uui-box>`,
)}
`;
}
static styles = [

View File

@@ -48,6 +48,14 @@ export class UmbBlockWorkspaceViewEditElement extends UmbLitElement implements U
this.#tabsStructureHelper.setIsRoot(true);
this.#tabsStructureHelper.setContainerChildType('Tab');
this.observe(
this.#tabsStructureHelper.mergedContainers,
(tabs) => {
this._tabs = tabs;
this._createRoutes();
},
null,
);
// _hasRootProperties can be gotten via _tabsStructureHelper.hasProperties. But we do not support root properties currently.
@@ -73,14 +81,6 @@ export class UmbBlockWorkspaceViewEditElement extends UmbLitElement implements U
},
'observeGroups',
);
this.observe(
this.#tabsStructureHelper.mergedContainers,
(tabs) => {
this._tabs = tabs;
this._createRoutes();
},
'observeTabs',
);
}
private _createRoutes() {

View File

@@ -95,7 +95,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
<slot name="footer-info"></slot>
<slot name="actions" slot="actions"></slot>
</umb-workspace-footer>
`}
`}
</umb-body-layout>
`;
}
@@ -119,7 +119,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
`,
)}
</uui-tab-group>
`
`
: nothing}
`;
}
@@ -137,7 +137,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
@change=${(event: UmbRouterSlotChangeEvent) => {
this._activePath = event.target.localActiveViewPath;
}}></umb-router-slot>
`
`
: nothing}
`;
}