show workspace
This commit is contained in:
committed by
Jacob Overgaard
parent
58d812657e
commit
b343f2d194
@@ -1,13 +1,14 @@
|
||||
import { SCRIPTS_ENTITY_TYPE } from '../config.js';
|
||||
import { UmbSaveWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
|
||||
import type { ManifestWorkspace, ManifestWorkspaceAction } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const workspace: ManifestWorkspace = {
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.Scripts',
|
||||
name: 'Partial View Workspace',
|
||||
name: 'Scripts Workspace',
|
||||
loader: () => import('./scripts-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: 'partial-view',
|
||||
entityType: SCRIPTS_ENTITY_TYPE,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -15,7 +16,7 @@ const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
{
|
||||
type: 'workspaceAction',
|
||||
alias: 'Umb.WorkspaceAction.Scripts.Save',
|
||||
name: 'Save Partial View',
|
||||
name: 'Save Scripts Workspace Action',
|
||||
weight: 70,
|
||||
meta: {
|
||||
look: 'primary',
|
||||
|
||||
@@ -3,22 +3,16 @@ import { UUITextStyles } from '@umbraco-cms/backoffice/external/uui';
|
||||
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
|
||||
import { UmbRoute, IRoutingInfo, PageComponent } from '@umbraco-cms/backoffice/router';
|
||||
|
||||
import './scripts-workspace-edit.element.js';
|
||||
|
||||
import { UmbWorkspaceIsNewRedirectController } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
@customElement('umb-scripts-workspace')
|
||||
export class UmbScriptsWorkspaceElement extends UmbLitElement {
|
||||
#scriptsWorkspaceContext = new UmbScriptsWorkspaceContext(this);
|
||||
|
||||
#element = document.createElement('umb-scripts-workspace-edit');
|
||||
|
||||
@state()
|
||||
_routes: UmbRoute[] = [
|
||||
{
|
||||
path: 'create/:parentKey',
|
||||
component: () => this.#element,
|
||||
component: import('./scripts-workspace-edit.element.js'),
|
||||
setup: async (component: PageComponent, info: IRoutingInfo) => {
|
||||
const parentKey = info.match.params.parentKey;
|
||||
const decodePath = decodeURIComponent(parentKey);
|
||||
@@ -33,7 +27,7 @@ export class UmbScriptsWorkspaceElement extends UmbLitElement {
|
||||
},
|
||||
{
|
||||
path: 'edit/:key',
|
||||
component: () => this.#element,
|
||||
component: import('./scripts-workspace-edit.element.js'),
|
||||
setup: (component: PageComponent, info: IRoutingInfo) => {
|
||||
const key = info.match.params.key;
|
||||
const decodePath = decodeURIComponent(key).replace('-js', '.js');
|
||||
|
||||
Reference in New Issue
Block a user