register root workspace
This commit is contained in:
committed by
Niels Lyngsø
parent
63f0420477
commit
8ba77baa11
@@ -9,9 +9,10 @@ import { manifests as propertyEditorManifests } from './property-editor/manifest
|
||||
import { manifests as repositoryManifests } from './repository/manifests.js';
|
||||
import { manifests as sectionViewManifests } from './section-view/manifests.js';
|
||||
import { manifests as workspaceManifests } from './workspace/manifests.js';
|
||||
import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { manifests as menuItemManifests } from './menu-item/manifests.js';
|
||||
import type { UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [
|
||||
export const manifests: Array<UmbManifestTypes | UmbBackofficeManifestKind> = [
|
||||
...clientCredentialManifests,
|
||||
...collectionManifests,
|
||||
...conditionsManifests,
|
||||
@@ -23,4 +24,5 @@ export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [
|
||||
...repositoryManifests,
|
||||
...sectionViewManifests,
|
||||
...workspaceManifests,
|
||||
...menuItemManifests,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { UMB_USER_MANAGEMENT_MENU_ALIAS } from '../../section/menu/constants.js';
|
||||
import { UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js';
|
||||
import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<ManifestTypes> = [
|
||||
{
|
||||
type: 'menuItem',
|
||||
alias: 'Umb.MenuItem.Users',
|
||||
name: 'Users Menu Item',
|
||||
weight: 100,
|
||||
meta: {
|
||||
label: '#treeHeaders_users',
|
||||
icon: 'icon-user',
|
||||
entityType: UMB_USER_ROOT_ENTITY_TYPE,
|
||||
menus: [UMB_USER_MANAGEMENT_MENU_ALIAS],
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -1,25 +1,14 @@
|
||||
import { UMB_USER_MANAGEMENT_SECTION_ALIAS } from '../../section/index.js';
|
||||
import type { ManifestSectionView, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js';
|
||||
import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const sectionsViews: Array<ManifestSectionView> = [
|
||||
export const manifests: Array<ManifestTypes | UmbBackofficeManifestKind> = [
|
||||
{
|
||||
type: 'sectionView',
|
||||
alias: 'Umb.SectionView.Users',
|
||||
name: 'Users Section View',
|
||||
js: () => import('./users-section-view.element.js'),
|
||||
weight: 200,
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.UserRoot',
|
||||
name: 'User Root Workspace View',
|
||||
element: () => import('./user-root-workspace-view.element.js'),
|
||||
meta: {
|
||||
label: '#general_users',
|
||||
pathname: 'users',
|
||||
icon: 'icon-user',
|
||||
entityType: UMB_USER_ROOT_ENTITY_TYPE,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.SectionAlias',
|
||||
match: UMB_USER_MANAGEMENT_SECTION_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests: Array<ManifestTypes> = [...sectionsViews];
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
const elementName = 'umb-user-root-workspace';
|
||||
@customElement(elementName)
|
||||
export class UmbUserRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline="Users">
|
||||
<umb-collection alias=${UMB_USER_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbUserRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbUserRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import { UMB_USER_COLLECTION_ALIAS } from '../collection/index.js';
|
||||
import { UMB_USER_ENTITY_TYPE, UMB_USER_ROOT_ENTITY_TYPE } from '../entity.js';
|
||||
import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import type { UmbRoute } from '@umbraco-cms/backoffice/router';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UmbCollectionElement } from '@umbraco-cms/backoffice/collection';
|
||||
import { UmbWorkspaceElement } from '@umbraco-cms/backoffice/workspace';
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
|
||||
@customElement('umb-section-view-users')
|
||||
export class UmbSectionViewUsersElement extends UmbLitElement {
|
||||
#routes: UmbRoute[] = [
|
||||
{
|
||||
path: 'collection',
|
||||
component: () => {
|
||||
const element = new UmbCollectionElement();
|
||||
const entityContext = new UmbEntityContext(element);
|
||||
entityContext.setEntityType(UMB_USER_ROOT_ENTITY_TYPE);
|
||||
entityContext.setUnique(null);
|
||||
element.setAttribute('alias', UMB_USER_COLLECTION_ALIAS);
|
||||
return element;
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'user',
|
||||
component: () => {
|
||||
const element = new UmbWorkspaceElement();
|
||||
element.setAttribute('entity-type', UMB_USER_ENTITY_TYPE);
|
||||
return element;
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'collection',
|
||||
},
|
||||
{
|
||||
path: `**`,
|
||||
component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement,
|
||||
},
|
||||
];
|
||||
|
||||
override render() {
|
||||
return html` <umb-router-slot id="router-slot" .routes=${this.#routes}></umb-router-slot> `;
|
||||
}
|
||||
|
||||
static override styles = [
|
||||
UmbTextStyles,
|
||||
css`
|
||||
:host {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#router-slot {
|
||||
height: calc(100% - var(--umb-header-layout-height));
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
export default UmbSectionViewUsersElement;
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-section-view-users': UmbSectionViewUsersElement;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user