move editors to workspaces

This commit is contained in:
Niels Lyngsø
2022-12-16 09:27:42 +01:00
parent d176677de0
commit 2c81079f45
61 changed files with 62 additions and 62 deletions

View File

@@ -1,5 +1,5 @@
//TODO: we need to figure out what components should be available for extensions and load them upfront
import './editors/shared/editor-entity-layout/editor-entity-layout.element';
import './workspaces/shared/editor-entity-layout/editor-entity-layout.element';
import './components/ref-property-editor-ui/ref-property-editor-ui.element';
import './components/backoffice-frame/backoffice-header.element';
import './components/backoffice-frame/backoffice-main.element';
@@ -37,7 +37,7 @@ import { manifests as sectionManifests } from './sections/manifests';
import { manifests as propertyEditorModelManifests } from './property-editor-models/manifests';
import { manifests as propertyEditorUIManifests } from './property-editor-uis/manifests';
import { manifests as treeManifests } from './trees/manifests';
import { manifests as editorManifests } from './editors/manifests';
import { manifests as editorManifests } from './workspaces/manifests';
import { manifests as propertyActionManifests } from './property-actions/manifests';
import { manifests as externalLoginProviderManifests } from './external-login-providers/manifests';
import { manifests as userDashboards } from './user-dashboards/manifests';

View File

@@ -8,7 +8,7 @@ import { UmbContextConsumerMixin } from '@umbraco-cms/context-api';
import type { ManifestPropertyEditorUI, ManifestTypes } from '@umbraco-cms/models';
import '../../property-actions/shared/property-action-menu/property-action-menu.element';
import '../../editors/shared/editor-property-layout/editor-property-layout.element';
import '../../workspaces/shared/editor-property-layout/editor-property-layout.element';
/**
* @element umb-entity-property

View File

@@ -1,7 +1,7 @@
import { html, LitElement } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { IRoute, IRoutingInfo } from 'router-slot';
import { UmbEditorEntityElement } from '../../../../editors/shared/editor-entity/editor-entity.element';
import { UmbWorkspaceEntityElement } from '../../../../workspaces/shared/workspace-entity/workspace-entity.element';
@customElement('umb-section-view-packages-created')
export class UmbSectionViewPackagesCreatedElement extends LitElement {
@@ -13,9 +13,9 @@ export class UmbSectionViewPackagesCreatedElement extends LitElement {
},
{
path: `:entityType/:key`,
component: () => import('../../../../editors/shared/editor-entity/editor-entity.element'),
component: () => import('../../../../workspaces/shared/workspace-entity/workspace-entity.element'),
setup: (component: HTMLElement, info: IRoutingInfo) => {
const element = component as UmbEditorEntityElement;
const element = component as UmbWorkspaceEntityElement;
element.entityKey = info.match.params.key;
element.entityType = info.match.params.entityType;
},

View File

@@ -1,7 +1,7 @@
import { html, LitElement } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { IRoute, IRoutingInfo } from 'router-slot';
import { UmbEditorEntityElement } from '../../../../editors/shared/editor-entity/editor-entity.element';
import { UmbWorkspaceEntityElement } from '../../../../workspaces/shared/workspace-entity/workspace-entity.element';
@customElement('umb-section-view-packages-installed')
export class UmbSectionViewPackagesInstalledElement extends LitElement {
@@ -13,9 +13,9 @@ export class UmbSectionViewPackagesInstalledElement extends LitElement {
},
{
path: `:entityType/:key`,
component: () => import('../../../../editors/shared/editor-entity/editor-entity.element'),
component: () => import('../../../../workspaces/shared/workspace-entity/workspace-entity.element'),
setup: (component: HTMLElement, info: IRoutingInfo) => {
const element = component as UmbEditorEntityElement;
const element = component as UmbWorkspaceEntityElement;
element.entityKey = info.match.params.key;
element.entityType = info.match.params.entityType;
},

View File

@@ -3,7 +3,7 @@ import { css, html, LitElement, nothing } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { map, switchMap, EMPTY, of } from 'rxjs';
import { UmbSectionContext } from '../section.context';
import { UmbEditorEntityElement } from '../../editors/shared/editor-entity/editor-entity.element';
import { UmbWorkspaceEntityElement } from '../../workspaces/shared/workspace-entity/workspace-entity.element';
import { UmbObserverMixin } from '@umbraco-cms/observable-api';
import { createExtensionElement } from '@umbraco-cms/extensions-api';
import { UmbContextConsumerMixin } from '@umbraco-cms/context-api';
@@ -85,16 +85,16 @@ export class UmbSectionElement extends UmbContextConsumerMixin(UmbObserverMixin(
},
{
path: `:entityType/:key`,
component: () => import('../../editors/shared/editor-entity/editor-entity.element'),
setup: (component: UmbEditorEntityElement, info: any) => {
component: () => import('../../workspaces/shared/workspace-entity/workspace-entity.element'),
setup: (component: UmbWorkspaceEntityElement, info: any) => {
component.entityKey = info.match.params.key;
component.entityType = info.match.params.entityType;
},
},
{
path: `:entityType`,
component: () => import('../../editors/shared/editor-entity/editor-entity.element'),
setup: (component: UmbEditorEntityElement, info: any) => {
component: () => import('../../workspaces/shared/workspace-entity/workspace-entity.element'),
setup: (component: UmbWorkspaceEntityElement, info: any) => {
component.entityType = info.match.params.entityType;
},
},

View File

@@ -3,7 +3,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement, state } from 'lit/decorators.js';
import { BehaviorSubject, Observable } from 'rxjs';
import type { IRoute, IRoutingInfo } from 'router-slot';
import UmbEditorEntityElement from '../../../../editors/shared/editor-entity/editor-entity.element';
import UmbWorkspaceEntityElement from '../../../../workspaces/shared/workspace-entity/workspace-entity.element';
import { UmbContextConsumerMixin, UmbContextProviderMixin } from '@umbraco-cms/context-api';
import './list-view-layouts/table/editor-view-users-table.element';
@@ -35,9 +35,9 @@ export class UmbSectionViewUsersElement extends UmbContextProviderMixin(
},
{
path: `:entityType/:key`,
component: () => import('../../../../editors/shared/editor-entity/editor-entity.element'),
component: () => import('../../../../workspaces/shared/workspace-entity/workspace-entity.element'),
setup: (component: HTMLElement, info: IRoutingInfo) => {
const element = component as UmbEditorEntityElement;
const element = component as UmbWorkspaceEntityElement;
element.entityKey = info.match.params.key;
element.entityType = info.match.params.entityType;
},

View File

@@ -139,9 +139,9 @@ export class UmbEditorDataTypeElement extends UmbContextProviderMixin(
render() {
return html`
<umb-editor-entity-layout alias="Umb.Editor.DataType">
<umb-workspace-entity-layout alias="Umb.Editor.DataType">
<uui-input id="header" slot="header" .value=${this._dataTypeName} @input="${this._handleInput}"></uui-input>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -127,7 +127,7 @@ export class UmbEditorDocumentTypeElement extends UmbContextProviderMixin(
render() {
return html`
<umb-editor-entity-layout alias="Umb.Editor.DocumentType">
<umb-workspace-entity-layout alias="Umb.Editor.DocumentType">
<div id="header" slot="header">
<umb-property-editor-ui-icon-picker></umb-property-editor-ui-icon-picker>
<uui-input id="name" .value=${this._documentType?.name} @input="${this._handleInput}">
@@ -136,7 +136,7 @@ export class UmbEditorDocumentTypeElement extends UmbContextProviderMixin(
</div>
<div slot="footer">Keyboard Shortcuts</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -24,7 +24,7 @@ export class UmbEditorExtensionsElement extends UmbContextConsumerMixin(UmbObser
render() {
return html`
<umb-editor-entity-layout headline="Extensions" alias="Umb.Editor.Extensions">
<umb-workspace-entity-layout headline="Extensions" alias="Umb.Editor.Extensions">
<uui-box>
<p>List of currently loaded extensions</p>
<uui-table>
@@ -49,7 +49,7 @@ export class UmbEditorExtensionsElement extends UmbContextConsumerMixin(UmbObser
)}
</uui-table>
</uui-box>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -21,7 +21,7 @@ export class UmbEditorMediaTypeElement extends LitElement {
id!: string;
render() {
return html` <umb-editor-entity-layout alias="Umb.Editor.MediaType">Media Type Editor</umb-editor-entity-layout> `;
return html` <umb-workspace-entity-layout alias="Umb.Editor.MediaType">Media Type Editor</umb-workspace-entity-layout> `;
}
}

View File

@@ -20,7 +20,7 @@ export class UmbEditorMemberGroupElement extends LitElement {
render() {
return html`
<umb-editor-entity-layout alias="Umb.Editor.MemberGroup">Member Group Editor</umb-editor-entity-layout>
<umb-workspace-entity-layout alias="Umb.Editor.MemberGroup">Member Group Editor</umb-workspace-entity-layout>
`;
}
}

View File

@@ -22,7 +22,7 @@ export class UmbEditorMemberTypeElement extends LitElement {
render() {
return html`
<umb-editor-entity-layout alias="Umb.Editor.MemberType">Member Type Editor</umb-editor-entity-layout>
<umb-workspace-entity-layout alias="Umb.Editor.MemberType">Member Type Editor</umb-workspace-entity-layout>
`;
}
}

View File

@@ -19,7 +19,7 @@ export class UmbEditorMemberElement extends LitElement {
id!: string;
render() {
return html` <umb-editor-entity-layout alias="Umb.Editor.Member">Member Editor</umb-editor-entity-layout> `;
return html` <umb-workspace-entity-layout alias="Umb.Editor.Member">Member Editor</umb-workspace-entity-layout> `;
}
}

View File

@@ -16,8 +16,8 @@ export class UmbEditorPackageBuilderElement extends LitElement {
];
render() {
return html`<umb-editor-entity-layout alias="Umb.Editor.PackageBuilder"
>PACKAGE BUILDER</umb-editor-entity-layout
return html`<umb-workspace-entity-layout alias="Umb.Editor.PackageBuilder"
>PACKAGE BUILDER</umb-workspace-entity-layout
> `;
}
}

View File

@@ -16,7 +16,7 @@ export class UmbEditorPackageElement extends LitElement {
];
render() {
return html`<umb-editor-entity-layout alias="Umb.Editor.Package">PACKAGE EDITOR</umb-editor-entity-layout> `;
return html`<umb-workspace-entity-layout alias="Umb.Editor.Package">PACKAGE EDITOR</umb-workspace-entity-layout> `;
}
}

View File

@@ -172,7 +172,7 @@ export class UmbEditorContentElement extends UmbContextProviderMixin(
render() {
return html`
<umb-editor-entity-layout alias=${this.alias}>
<umb-workspace-entity-layout alias=${this.alias}>
<div id="header" slot="header">
<uui-input id="name-input" .value=${this._content?.name} @input="${this._handleInput}">
<!-- Implement Variant Selector -->
@@ -215,7 +215,7 @@ export class UmbEditorContentElement extends UmbContextProviderMixin(
look="primary"
color="positive"
label="Save and publish"></uui-button>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -15,7 +15,7 @@ import '../../../components/extension-slot/extension-slot.element';
import '../editor-action-extension/editor-action-extension.element';
/**
* @element umb-editor-entity-layout
* @element umb-workspace-entity-layout
* @description
* @slot icon - Slot for rendering the entity icon
* @slot name - Slot for rendering the entity name
@@ -26,7 +26,7 @@ import '../editor-action-extension/editor-action-extension.element';
* @class UmbEditorEntityLayout
* @extends {UmbContextConsumerMixin(LitElement)}
*/
@customElement('umb-editor-entity-layout')
@customElement('umb-workspace-entity-layout')
export class UmbEditorEntityLayout extends UmbContextConsumerMixin(UmbObserverMixin(LitElement)) {
static styles = [
UUITextStyles,
@@ -171,6 +171,6 @@ export class UmbEditorEntityLayout extends UmbContextConsumerMixin(UmbObserverMi
declare global {
interface HTMLElementTagNameMap {
'umb-editor-entity-layout': UmbEditorEntityLayout;
'umb-workspace-entity-layout': UmbEditorEntityLayout;
}
}

View File

@@ -7,15 +7,15 @@ import type { UmbEditorEntityLayout } from './editor-entity-layout.element';
export default {
title: 'Editors/Shared/Editor Entity Layout',
component: 'umb-editor-entity-layout',
id: 'umb-editor-entity-layout',
component: 'umb-workspace-entity-layout',
id: 'umb-workspace-entity-layout',
} as Meta;
export const AAAOverview: Story<UmbEditorEntityLayout> = () => html` <umb-editor-entity-layout>
export const AAAOverview: Story<UmbEditorEntityLayout> = () => html` <umb-workspace-entity-layout>
<div slot="icon"><uui-button color="" look="placeholder">Icon slot</uui-button></div>
<div slot="name"><uui-button color="" look="placeholder">Name slot</uui-button></div>
<div slot="footer"><uui-button color="" look="placeholder">Footer slot</uui-button></div>
<div slot="actions"><uui-button color="" look="placeholder">Actions slot</uui-button></div>
<uui-button color="" look="placeholder">Default slot</uui-button>
</umb-editor-entity-layout>`;
</umb-workspace-entity-layout>`;
AAAOverview.storyName = 'Overview';

View File

@@ -9,8 +9,8 @@ import { umbExtensionsRegistry } from '@umbraco-cms/extensions-registry';
import { UmbContextConsumerMixin } from '@umbraco-cms/context-api';
import type { ManifestEditor } from '@umbraco-cms/models';
@customElement('umb-editor-entity')
export class UmbEditorEntityElement extends UmbContextConsumerMixin(UmbObserverMixin(LitElement)) {
@customElement('umb-workspace-entity')
export class UmbWorkspaceEntityElement extends UmbContextConsumerMixin(UmbObserverMixin(LitElement)) {
static styles = [
UUITextStyles,
css`
@@ -84,10 +84,10 @@ export class UmbEditorEntityElement extends UmbContextConsumerMixin(UmbObserverM
}
}
export default UmbEditorEntityElement;
export default UmbWorkspaceEntityElement;
declare global {
interface HTMLElementTagNameMap {
'umb-editor-entity': UmbEditorEntityElement;
'umb-workspace-entity': UmbWorkspaceEntityElement;
}
}

View File

@@ -377,13 +377,13 @@ export class UmbEditorUserGroupElement extends UmbContextProviderMixin(
if (!this._userGroup) return nothing;
return html`
<umb-editor-entity-layout alias="Umb.Editor.UserGroup">
<umb-workspace-entity-layout alias="Umb.Editor.UserGroup">
<uui-input id="name" slot="header" .value=${this._userGroup.name} @input="${this._handleInput}"></uui-input>
<div id="main">
<div id="left-column">${this.renderLeftColumn()}</div>
<div id="right-column">${this.renderRightColumn()}</div>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -372,13 +372,13 @@ export class UmbEditorUserElement extends UmbContextProviderMixin(
if (!this._user) return html`User not found`;
return html`
<umb-editor-entity-layout alias="Umb.Editor.User">
<umb-workspace-entity-layout alias="Umb.Editor.User">
<uui-input id="name" slot="name" .value=${this._userName} @input="${this._handleInput}"></uui-input>
<div id="main">
<div id="left-column">${this._renderLeftColumn()}</div>
<div id="right-column">${this._renderRightColumn()}</div>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -73,7 +73,7 @@ export class UmbModalLayoutContentPickerElement extends UmbModalLayoutElement<Um
render() {
return html`
<umb-editor-entity-layout headline="Select Content">
<umb-workspace-entity-layout headline="Select Content">
<uui-box>
<uui-input></uui-input>
<hr />
@@ -87,7 +87,7 @@ export class UmbModalLayoutContentPickerElement extends UmbModalLayoutElement<Um
<uui-button label="Close" @click=${this._close}></uui-button>
<uui-button label="Submit" look="primary" color="positive" @click=${this._submit}></uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -233,7 +233,7 @@ export class UmbModalLayoutIconPickerElement extends UmbModalLayoutElement<UmbMo
render() {
return html`
<umb-editor-entity-layout headline="Select Icon">
<umb-workspace-entity-layout headline="Select Icon">
<div id="container">
${this.renderSearchbar()}
<hr />
@@ -247,7 +247,7 @@ export class UmbModalLayoutIconPickerElement extends UmbModalLayoutElement<UmbMo
<uui-button slot="actions" color="positive" look="primary" @click="${this._save}" label="save">
Save
</uui-button>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}

View File

@@ -20,7 +20,7 @@ export class UmbModalLayoutCurrentUserElement extends UmbContextConsumerMixin(Um
display: block;
}
:host,
umb-editor-entity-layout {
umb-workspace-entity-layout {
width: 100%;
height: 100%;
}
@@ -183,7 +183,7 @@ export class UmbModalLayoutCurrentUserElement extends UmbContextConsumerMixin(Um
render() {
return html`
<umb-editor-entity-layout headline="${this._currentUser?.name || ''}">
<umb-workspace-entity-layout headline="${this._currentUser?.name || ''}">
<div id="main">
<uui-box>
<b slot="headline">Your profile</b>
@@ -215,7 +215,7 @@ export class UmbModalLayoutCurrentUserElement extends UmbContextConsumerMixin(Um
<uui-button @click=${this._close} look="secondary">Close</uui-button>
<uui-button @click=${this._logout} look="primary" color="danger">Logout</uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -67,7 +67,7 @@ export class UmbPickerLayoutSectionElement extends UmbContextConsumerMixin(UmbOb
render() {
return html`
<umb-editor-entity-layout headline="Select sections">
<umb-workspace-entity-layout headline="Select sections">
<uui-box>
<uui-input label="search"></uui-input>
<hr />
@@ -88,7 +88,7 @@ export class UmbPickerLayoutSectionElement extends UmbContextConsumerMixin(UmbOb
<uui-button label="Close" @click=${this._close}></uui-button>
<uui-button label="Submit" look="primary" color="positive" @click=${this._submit}></uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -78,7 +78,7 @@ export class UmbPickerLayoutUserGroupElement extends UmbContextConsumerMixin(Umb
render() {
return html`
<umb-editor-entity-layout headline="Select user groups">
<umb-workspace-entity-layout headline="Select user groups">
<uui-box>
<uui-input label="search"></uui-input>
<hr />
@@ -100,7 +100,7 @@ export class UmbPickerLayoutUserGroupElement extends UmbContextConsumerMixin(Umb
<uui-button label="Close" @click=${this._close}></uui-button>
<uui-button label="Submit" look="primary" color="positive" @click=${this._submit}></uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -80,7 +80,7 @@ export class UmbPickerLayoutUserElement extends UmbContextConsumerMixin(UmbObser
render() {
return html`
<umb-editor-entity-layout headline="Select users">
<umb-workspace-entity-layout headline="Select users">
<uui-box>
<uui-input label="search"></uui-input>
<hr />
@@ -102,7 +102,7 @@ export class UmbPickerLayoutUserElement extends UmbContextConsumerMixin(UmbObser
<uui-button label="Close" @click=${this._close}></uui-button>
<uui-button label="Submit" look="primary" color="positive" @click=${this._submit}></uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}
}

View File

@@ -158,13 +158,13 @@ export class UmbModalLayoutPropertyEditorUIPickerElement extends UmbContextConsu
render() {
return html`
<umb-editor-entity-layout headline="Select Property Editor UI">
<umb-workspace-entity-layout headline="Select Property Editor UI">
<uui-box> ${this._renderFilter()} ${this._renderGrid()} </uui-box>
<div slot="actions">
<uui-button label="Close" @click=${this._close}></uui-button>
<uui-button label="${this._submitLabel}" look="primary" color="positive" @click=${this._submit}></uui-button>
</div>
</umb-editor-entity-layout>
</umb-workspace-entity-layout>
`;
}