fix block workspace
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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}
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user