Skip to content

Commit 3b5c709

Browse files
committed
correct settings condition plus route fix
1 parent 1a83313 commit 3b5c709

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/packages/block/block/workspace/manifests.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { UMB_BLOCK_WORKSPACE_ALIAS } from './index.js';
21
import { UmbSubmitWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
32
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
3+
import { UMB_BLOCK_WORKSPACE_ALIAS } from './index.js';
44

55
export const manifests: Array<ManifestTypes> = [
66
{
@@ -73,8 +73,6 @@ export const manifests: Array<ManifestTypes> = [
7373
alias: 'Umb.Condition.WorkspaceAlias',
7474
match: UMB_BLOCK_WORKSPACE_ALIAS,
7575
},
76-
],
77-
TODO_conditions: [
7876
{
7977
alias: 'Umb.Condition.BlockWorkspaceHasSettings',
8078
},

src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
5656
}
5757

5858
private _createRoutes() {
59-
this._routes = [];
59+
let newRoutes: UmbRoute[] = [];
6060

6161
if (this._workspaceViews.length > 0) {
62-
this._routes = this._workspaceViews.map((manifest) => {
62+
newRoutes = this._workspaceViews.map((manifest) => {
6363
return {
6464
path: `view/${manifest.meta.pathname}`,
6565
component: () => createExtensionElement(manifest),
@@ -72,14 +72,17 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
7272
});
7373

7474
// If we have a post fix then we need to add a direct from the empty url of the split-view-index:
75-
const firstView = this._workspaceViews[0];
76-
if (firstView) {
77-
this._routes.push({
75+
// TODO: This is problematic, cause if a workspaceView appears later, then this takes over. And it is also a problem if it does not use redirect, but just a view defined with and empty path.
76+
/*const firstRoute = newRoutes[0];
77+
if (firstRoute) {
78+
newRoutes.push({
7879
path: ``,
79-
redirectTo: `view/${firstView.meta.pathname}`,
80+
redirectTo: firstRoute.path,
8081
});
81-
}
82+
}*/
8283
}
84+
85+
this._routes = newRoutes;
8386
}
8487

8588
override render() {

0 commit comments

Comments
 (0)