diff --git a/src/Umbraco.Web.UI.Client/src/mocks/data/stylesheet.data.ts b/src/Umbraco.Web.UI.Client/src/mocks/data/stylesheet.data.ts index 2893fbe822..1fcfd1b7fb 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/data/stylesheet.data.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/data/stylesheet.data.ts @@ -93,33 +93,6 @@ export const data: Array = [ color: pink; }`, }, - { - path: 'Folder 1/Stylesheet File 3.css', - isFolder: false, - icon: 'style', - - name: 'Stylesheet File 3.css', - type: 'stylesheet', - hasChildren: false, - content: ` h1 { - color: red; - } - - /**umb_name:bjjh*/ - h1 { - color: red; - } - - /**umb_name:comeone*/ - h1 { - color: red; - } - - /**umb_name:lol*/ - h1 { - color: red; - }`, - }, ]; // Temp mocked database diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/manifests.ts index f20d29a5d6..1e342aeae9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/manifests.ts @@ -27,9 +27,12 @@ const workspaceEditorViews: Array = [ pathname: 'code', icon: 'umb:brackets', }, - conditions: { - workspaces: ['Umb.Workspace.StyleSheet'], - }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + match: 'Umb.Workspace.StyleSheet', + }, + ], }, { type: 'workspaceEditorView', @@ -42,9 +45,12 @@ const workspaceEditorViews: Array = [ pathname: 'rich-text-editor', icon: 'umb:font', }, - conditions: { - workspaces: ['Umb.Workspace.StyleSheet'], - }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + match: 'Umb.Workspace.StyleSheet', + }, + ], }, ]; const workspaceActions: Array = [ @@ -58,9 +64,12 @@ const workspaceActions: Array = [ color: 'positive', api: UmbSaveWorkspaceAction, }, - conditions: { - workspaces: ['Umb.Workspace.StyleSheet'], - }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + match: 'Umb.Workspace.StyleSheet', + }, + ], }, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-edit.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-edit.element.ts index fa5970de99..20f7bcc45b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-edit.element.ts @@ -1,8 +1,8 @@ import { UUIInputElement, UUIInputEvent, UUITextStyles } from '@umbraco-cms/backoffice/external/uui'; -import { css, html, LitElement, customElement, state } from '@umbraco-cms/backoffice/external/lit'; +import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbStylesheetWorkspaceContext } from './stylesheet-workspace.context.js'; import { UMB_MODAL_MANAGER_CONTEXT_TOKEN, UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; -import { UMB_ENTITY_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace'; +import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace'; import { UmbLitElement } from '@umbraco-cms/internal/lit-element'; @customElement('umb-stylesheet-workspace-edit') @@ -20,7 +20,7 @@ export class UmbStylesheetWorkspaceEditElement extends UmbLitElement { constructor() { super(); - this.consumeContext(UMB_ENTITY_WORKSPACE_CONTEXT, (instance) => { + this.consumeContext(UMB_WORKSPACE_CONTEXT, (instance) => { this.#workspaceContext = instance as UmbStylesheetWorkspaceContext; this.#observeNameAndPath(); }); @@ -50,7 +50,7 @@ export class UmbStylesheetWorkspaceEditElement extends UmbLitElement { return html` diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.element.ts index 5bc8de5657..444c06101a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.element.ts @@ -14,20 +14,31 @@ export class UmbStylesheetWorkspaceElement extends UmbLitElement { @state() _routes: UmbRoute[] = [ + // { + // path: 'create/:parentId', + // component: () => this.#element, + // setup: async (_component, info) => { + // const path = info.match.params.path; + // const serverPath = serverFilePathFromUrlFriendlyPath(path); + // this.#workspaceContext.setIsNew(false); + // console.log('load'); + // await this.#workspaceContext.load(serverPath); + + // new UmbWorkspaceIsNewRedirectController( + // this, + // this.#workspaceContext, + // this.shadowRoot!.querySelector('umb-router-slot')! + // ); + // }, + // }, { path: 'edit/:path', component: () => this.#element, setup: (_component, info) => { + this.removeControllerByAlias('_observeIsNew'); const path = info.match.params.path; const serverPath = serverFilePathFromUrlFriendlyPath(path); - console.log('load'); this.#workspaceContext.load(serverPath); - - new UmbWorkspaceIsNewRedirectController( - this, - this.#workspaceContext, - this.shadowRoot!.querySelector('umb-router-slot')! - ); }, }, ];