reintroduce other splitViewElements

This commit is contained in:
Niels Lyngsø
2024-06-28 13:38:18 +02:00
parent 67144b463e
commit 7d859b91d2
3 changed files with 15 additions and 6 deletions

View File

@@ -8,6 +8,9 @@ import { UmbDocumentBlueprintWorkspaceSplitViewElement } from './document-bluepr
@customElement('umb-document-blueprint-workspace-editor')
export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement {
//
// TODO: Refactor: when having a split view/variants context token, we can rename the split view/variants component to a generic and make this component generic as well. [NL]
private splitViewElement = new UmbDocumentBlueprintWorkspaceSplitViewElement();
#workspaceContext?: typeof UMB_DOCUMENT_BLUEPRINT_WORKSPACE_CONTEXT.TYPE;
@@ -46,7 +49,7 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variantA.unique + '_&_' + variantB.unique,
component: UmbDocumentBlueprintWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// Set split view/active info..
const variantSplit = info.match.fragments.consumed.split('_&_');
@@ -63,7 +66,7 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variant.unique,
component: UmbDocumentBlueprintWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// cause we might come from a split-view, we need to reset index 1.
this.#workspaceContext?.splitView.removeActiveVariant(1);

View File

@@ -7,6 +7,9 @@ import { customElement, state, css, html } from '@umbraco-cms/backoffice/externa
import type { UmbRoute, UmbRouterSlotInitEvent } from '@umbraco-cms/backoffice/router';
@customElement('umb-media-workspace-editor')
export class UmbMediaWorkspaceEditorElement extends UmbLitElement {
//
// TODO: Refactor: when having a split view/variants context token, we can rename the split view/variants component to a generic and make this component generic as well. [NL]
private splitViewElement = new UmbMediaWorkspaceSplitViewElement();
@state()
_routes?: Array<UmbRoute>;
@@ -46,7 +49,7 @@ export class UmbMediaWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variantA.unique + '_&_' + variantB.unique,
component: UmbMediaWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// Set split view/active info..
const variantSplit = info.match.fragments.consumed.split('_&_');
@@ -63,7 +66,7 @@ export class UmbMediaWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variant.unique,
component: UmbMediaWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// cause we might come from a split-view, we need to reset index 1.
this.#workspaceContext?.splitView.removeActiveVariant(1);

View File

@@ -8,6 +8,9 @@ import type { UmbRoute, UmbRouterSlotInitEvent } from '@umbraco-cms/backoffice/r
@customElement('umb-member-workspace-editor')
export class UmbMemberWorkspaceEditorElement extends UmbLitElement {
//
// TODO: Refactor: when having a split view/variants context token, we can rename the split view/variants component to a generic and make this component generic as well. [NL]
private splitViewElement = new UmbMemberWorkspaceSplitViewElement();
#workspaceContext?: typeof UMB_MEMBER_WORKSPACE_CONTEXT.TYPE;
@@ -48,7 +51,7 @@ export class UmbMemberWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variantA.unique + '_&_' + variantB.unique,
component: UmbMemberWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// Set split view/active info..
const variantSplit = info.match.fragments.consumed.split('_&_');
@@ -65,7 +68,7 @@ export class UmbMemberWorkspaceEditorElement extends UmbLitElement {
routes.push({
// TODO: When implementing Segments, be aware if using the unique is URL Safe... [NL]
path: variant.unique,
component: UmbMemberWorkspaceSplitViewElement,
component: this.splitViewElement,
setup: (_component, info) => {
// cause we might come from a split-view, we need to reset index 1.
this.#workspaceContext?.splitView.removeActiveVariant(1);