Merge pull request #2309 from umbraco/v15/feature/collection-kind-workspace-view
Feature: Default Workspace Kind + Collection Workspace View Kind
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import type { UmbExtensionManifestKind } from '../extension-registry/registry.js';
|
||||
import { manifest as collectionAliasCondition } from './collection-alias.manifest.js';
|
||||
import { manifest as collectionBulkActionPermissionCondition } from './collection-bulk-action-permission.manifest.js';
|
||||
import { manifests as workspaceViewManifests } from './workspace-view/manifests.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
|
||||
...workspaceViewManifests,
|
||||
collectionAliasCondition,
|
||||
collectionBulkActionPermissionCondition,
|
||||
];
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import type { ManifestWorkspaceViewCollectionKind } from './types.js';
|
||||
import { html, customElement, property } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
const elementName = 'umb-collection-workspace-view';
|
||||
@customElement(elementName)
|
||||
export class UmbCollectionWorkspaceViewElement extends UmbLitElement {
|
||||
@property({ type: Object, attribute: false })
|
||||
manifest?: ManifestWorkspaceViewCollectionKind;
|
||||
|
||||
override render() {
|
||||
if (!this.manifest) return html` <div>No Manifest</div>`;
|
||||
if (!this.manifest.meta.collectionAlias) return html` <div>No Collection Alias in Manifest</div>`;
|
||||
return html`<umb-collection alias=${this.manifest.meta.collectionAlias}></umb-collection>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbCollectionWorkspaceViewElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbCollectionWorkspaceViewElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './collection-workspace-view.element.js';
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifestKind> = [
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
|
||||
{
|
||||
type: 'kind',
|
||||
alias: 'Umb.Kind.WorkspaceView.Collection',
|
||||
@@ -9,12 +9,11 @@ export const manifests: Array<UmbExtensionManifestKind> = [
|
||||
manifest: {
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
element: () => import('./workspace-view-collection.element.js'),
|
||||
weight: 300,
|
||||
element: () => import('./collection-workspace-view.element.js'),
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-grid',
|
||||
icon: 'icon-layers',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { ManifestWorkspaceView, MetaWorkspaceView } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export interface ManifestWorkspaceViewCollectionKind extends ManifestWorkspaceView {
|
||||
type: 'workspaceView';
|
||||
kind: 'collection';
|
||||
meta: MetaWorkspaceViewCollectionKind;
|
||||
}
|
||||
|
||||
export interface MetaWorkspaceViewCollectionKind extends MetaWorkspaceView {
|
||||
collectionAlias: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface UmbExtensionManifestMap {
|
||||
umbManifestWorkspaceViewCollectionKind: ManifestWorkspaceViewCollectionKind;
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ export class UmbEntityActionsBundleElement extends UmbLitElement {
|
||||
protected override updated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
|
||||
if (_changedProperties.has('entityType') && _changedProperties.has('unique')) {
|
||||
this.#entityContext.setEntityType(this.entityType);
|
||||
this.#entityContext.setUnique(this.unique);
|
||||
this.#entityContext.setUnique(this.unique ?? null);
|
||||
this.#observeEntityActions();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { UmbEntityWorkspaceContext } from './entity-workspace-context.interface.js';
|
||||
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
import type { UmbContentTypeModel, UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbEntityWorkspaceContext } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export interface UmbCollectionWorkspaceContext<T extends UmbContentTypeModel> extends UmbEntityWorkspaceContext {
|
||||
export interface UmbContentCollectionWorkspaceContext<T extends UmbContentTypeModel> extends UmbEntityWorkspaceContext {
|
||||
contentTypeHasCollection: Observable<boolean>;
|
||||
getCollectionAlias(): string;
|
||||
structure: UmbContentTypeStructureManager<T>;
|
||||
@@ -1,14 +1,15 @@
|
||||
import type { UmbCollectionBulkActionPermissions, UmbCollectionConfiguration } from '../../../collection/types.js';
|
||||
import type { UmbCollectionBulkActionPermissions, UmbCollectionConfiguration } from '../../collection/types.js';
|
||||
import { UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT } from './content-collection-workspace.context-token.js';
|
||||
import { customElement, html, nothing, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UmbDataTypeDetailRepository } from '@umbraco-cms/backoffice/data-type';
|
||||
import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor';
|
||||
import { UMB_COLLECTION_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
|
||||
import type { UmbDataTypeDetailModel } from '@umbraco-cms/backoffice/data-type';
|
||||
import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
@customElement('umb-workspace-view-collection')
|
||||
export class UmbWorkspaceViewCollectionElement extends UmbLitElement implements UmbWorkspaceViewElement {
|
||||
const elementName = 'umb-content-collection-workspace-view';
|
||||
@customElement('umb-content-collection-workspace-view')
|
||||
export class UmbContentCollectionWorkspaceViewElement extends UmbLitElement implements UmbWorkspaceViewElement {
|
||||
@state()
|
||||
private _loading = true;
|
||||
|
||||
@@ -29,7 +30,7 @@ export class UmbWorkspaceViewCollectionElement extends UmbLitElement implements
|
||||
}
|
||||
|
||||
async #observeConfig() {
|
||||
this.consumeContext(UMB_COLLECTION_WORKSPACE_CONTEXT, (workspaceContext) => {
|
||||
this.consumeContext(UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT, (workspaceContext) => {
|
||||
this._collectionAlias = workspaceContext.getCollectionAlias();
|
||||
this._documentUnique = workspaceContext.getUnique() ?? '';
|
||||
|
||||
@@ -78,10 +79,10 @@ export class UmbWorkspaceViewCollectionElement extends UmbLitElement implements
|
||||
}
|
||||
}
|
||||
|
||||
export default UmbWorkspaceViewCollectionElement;
|
||||
export { UmbContentCollectionWorkspaceViewElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-workspace-view-collection': UmbWorkspaceViewCollectionElement;
|
||||
[elementName]: UmbContentCollectionWorkspaceViewElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { UmbContentCollectionWorkspaceContext } from './content-collection-workspace-context.interface.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import type { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbWorkspaceContext } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export const UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT = new UmbContextToken<
|
||||
UmbWorkspaceContext,
|
||||
UmbContentCollectionWorkspaceContext<UmbContentTypeModel>
|
||||
>(
|
||||
'UmbWorkspaceContext',
|
||||
undefined,
|
||||
(context): context is UmbContentCollectionWorkspaceContext<UmbContentTypeModel> =>
|
||||
(context as UmbContentCollectionWorkspaceContext<UmbContentTypeModel>).contentTypeHasCollection !== undefined,
|
||||
);
|
||||
@@ -0,0 +1,2 @@
|
||||
export type * from './content-collection-workspace-context.interface.js';
|
||||
export * from './content-collection-workspace.context-token.js';
|
||||
@@ -0,0 +1,21 @@
|
||||
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifestKind> = [
|
||||
{
|
||||
type: 'kind',
|
||||
alias: 'Umb.Kind.WorkspaceView.Content.Collection',
|
||||
matchKind: 'contentCollection',
|
||||
matchType: 'workspaceView',
|
||||
manifest: {
|
||||
type: 'workspaceView',
|
||||
kind: 'contentCollection',
|
||||
element: () => import('./content-collection-workspace-view.element.js'),
|
||||
weight: 300,
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-grid',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { ManifestWorkspaceView, MetaWorkspaceView } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export interface ManifestWorkspaceViewContentCollectionKind extends ManifestWorkspaceView<MetaWorkspaceView> {
|
||||
type: 'workspaceView';
|
||||
kind: 'contentCollection';
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface UmbExtensionManifestMap {
|
||||
umbManifestWorkspaceViewContentCollectionKind: ManifestWorkspaceViewContentCollectionKind;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
export { UMB_CONTENT_PROPERTY_CONTEXT } from './content-property.context-token.js';
|
||||
export { UmbContentPropertyContext } from './content-property.context.js';
|
||||
|
||||
export * from './property-dataset-context/content-property-dataset.context.js';
|
||||
export * from './workspace/index.js';
|
||||
export * from './collection/index.js';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { UMB_ENTITY_CONTEXT } from './entity.context-token.js';
|
||||
import type { UmbEntityUnique } from './types.js';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbStringState } from '@umbraco-cms/backoffice/observable-api';
|
||||
@@ -12,7 +13,7 @@ export class UmbEntityContext extends UmbContextBase<UmbEntityContext> {
|
||||
#entityType = new UmbStringState<string | undefined>(undefined);
|
||||
public readonly entityType = this.#entityType.asObservable();
|
||||
|
||||
#unique = new UmbStringState<string | null | undefined>(undefined);
|
||||
#unique = new UmbStringState<UmbEntityUnique>(null);
|
||||
public readonly unique = this.#unique.asObservable();
|
||||
|
||||
/**
|
||||
@@ -44,16 +45,16 @@ export class UmbEntityContext extends UmbContextBase<UmbEntityContext> {
|
||||
|
||||
/**
|
||||
* Set the unique
|
||||
* @param {string | null | undefined} unique
|
||||
* @param {string | null} unique
|
||||
* @memberof UmbEntityContext
|
||||
*/
|
||||
setUnique(unique: string | null | undefined) {
|
||||
setUnique(unique: string | null) {
|
||||
this.#unique.setValue(unique);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unique
|
||||
* @returns {string | null | undefined}
|
||||
* @returns {string | null}
|
||||
* @memberof UmbEntityContext
|
||||
*/
|
||||
getUnique() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { manifests as workspaceActionManifests } from './workspace-action/manifests.js';
|
||||
import { manifests as workspaceActionMenuItemManifests } from './workspace-action-menu-item/manifests.js';
|
||||
import { manifests as workspaceBreadcrumbManifests } from './workspace-breadcrumb/manifests.js';
|
||||
import { manifests as workspaceViewManifests } from './workspace-collection/manifests.js';
|
||||
import { manifests as workspaceViewManifests } from '../../content/collection/manifests.js';
|
||||
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { UMB_WORKSPACE_CONTEXT, type UmbWorkspaceContext } from '../contexts/index.js';
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../workspace.context-token.js';
|
||||
import type { UmbWorkspaceContext } from '../workspace-context.interface.js';
|
||||
import type { WorkspaceAliasConditionConfig } from './types.js';
|
||||
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../contexts/index.js';
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../workspace.context-token.js';
|
||||
import type { WorkspaceEntityTypeConditionConfig } from './types.js';
|
||||
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UMB_COLLECTION_WORKSPACE_CONTEXT } from '../contexts/tokens/collection-workspace.context-token.js';
|
||||
import { UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT } from '../../content/collection/content-collection-workspace.context-token.js';
|
||||
import type { WorkspaceHasCollectionConditionConfig } from './types.js';
|
||||
import { UMB_WORKSPACE_HAS_COLLECTION_CONDITION } from './const.js';
|
||||
import { UmbConditionBase } from '@umbraco-cms/backoffice/extension-registry';
|
||||
@@ -18,7 +18,7 @@ export class UmbWorkspaceHasCollectionCondition
|
||||
constructor(host: UmbControllerHost, args: UmbConditionControllerArguments<WorkspaceHasCollectionConditionConfig>) {
|
||||
super(host, args);
|
||||
|
||||
this.consumeContext(UMB_COLLECTION_WORKSPACE_CONTEXT, (context) => {
|
||||
this.consumeContext(UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT, (context) => {
|
||||
this.observe(
|
||||
context.contentTypeHasCollection,
|
||||
(hasCollection) => {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { UMB_WORKSPACE_CONTEXT } from './tokens/workspace.context-token.js';
|
||||
import type { UmbWorkspaceContext } from './tokens/workspace-context.interface.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { ManifestWorkspace } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export abstract class UmbDefaultWorkspaceContext
|
||||
extends UmbContextBase<UmbDefaultWorkspaceContext>
|
||||
implements UmbWorkspaceContext
|
||||
{
|
||||
public workspaceAlias!: string;
|
||||
#entityType!: string;
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, UMB_WORKSPACE_CONTEXT.toString());
|
||||
}
|
||||
|
||||
set manifest(manifest: ManifestWorkspace) {
|
||||
this.workspaceAlias = manifest.alias;
|
||||
this.#entityType = manifest.meta.entityType;
|
||||
}
|
||||
|
||||
getUnique(): string | undefined {
|
||||
return undefined;
|
||||
}
|
||||
getEntityType(): string {
|
||||
return this.#entityType;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbDefaultWorkspaceContext as api };
|
||||
@@ -1,2 +1 @@
|
||||
export * from './default-workspace.context.js';
|
||||
export * from './tokens/index.js';
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
import type { UmbContentTypeModel } from '@umbraco-cms/backoffice/content-type';
|
||||
import type { UmbWorkspaceContext, UmbCollectionWorkspaceContext } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export const UMB_COLLECTION_WORKSPACE_CONTEXT = new UmbContextToken<
|
||||
UmbWorkspaceContext,
|
||||
UmbCollectionWorkspaceContext<UmbContentTypeModel>
|
||||
>(
|
||||
'UmbWorkspaceContext',
|
||||
undefined,
|
||||
(context): context is UmbCollectionWorkspaceContext<UmbContentTypeModel> =>
|
||||
(context as UmbCollectionWorkspaceContext<UmbContentTypeModel>).contentTypeHasCollection !== undefined,
|
||||
);
|
||||
|
||||
/**
|
||||
* @deprecated Use `UMB_COLLECTION_WORKSPACE_CONTEXT` instead. This token will be removed in the RC version.
|
||||
* TODO: Remove in RC
|
||||
*/
|
||||
export const UMB_WORKSPACE_COLLECTION_CONTEXT = UMB_COLLECTION_WORKSPACE_CONTEXT;
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbWorkspaceUniqueType } from './../../types.js';
|
||||
import type { Observable } from '@umbraco-cms/backoffice/external/rxjs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbEntityWorkspaceContext } from './entity-workspace-context.interface.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
export * from './collection-workspace.context-token.js';
|
||||
export * from './entity-workspace.context-token.js';
|
||||
export * from './property-structure-workspace.context-token.js';
|
||||
export * from './publishable-workspace.context-token.js';
|
||||
export * from './routable-workspace.context-token.js';
|
||||
export * from './submittable-workspace.context-token.js';
|
||||
export * from './variant-workspace.context-token.js';
|
||||
export * from './workspace.context-token.js';
|
||||
export type * from './collection-workspace-context.interface.js';
|
||||
export type * from './entity-workspace-context.interface.js';
|
||||
export type * from './invariant-dataset-workspace-context.interface.js';
|
||||
export type * from './property-structure-workspace-context.interface.js';
|
||||
@@ -14,4 +11,4 @@ export type * from './publishable-workspace-context.interface.js';
|
||||
export type * from './routable-workspace-context.interface.js';
|
||||
export type * from './submittable-workspace-context.interface.js';
|
||||
export type * from './variant-dataset-workspace-context.interface.js';
|
||||
export type * from './workspace-context.interface.js';
|
||||
export type * from '../../workspace-context.interface.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbPropertyStructureWorkspaceContext } from './property-structure-workspace-context.interface.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbWorkspaceRouteManager } from '../../index.js';
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
|
||||
export interface UmbRoutableWorkspaceContext extends UmbWorkspaceContext {
|
||||
readonly routes: UmbWorkspaceRouteManager;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbRoutableWorkspaceContext } from './routable-workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
export const UMB_ROUTABLE_WORKSPACE_CONTEXT = new UmbContextToken<UmbWorkspaceContext, UmbRoutableWorkspaceContext>(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { UmbWorkspaceContext } from './workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbVariantDatasetWorkspaceContext } from './variant-dataset-workspace-context.interface.js';
|
||||
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
||||
|
||||
|
||||
@@ -18,11 +18,6 @@ export interface ManifestWorkspaceView<MetaType extends MetaWorkspaceView = Meta
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface MetaWorkspaceView extends MetaManifestWithView {}
|
||||
|
||||
export interface ManifestWorkspaceViewCollectionKind extends ManifestWorkspaceView<MetaWorkspaceView> {
|
||||
type: 'workspaceView';
|
||||
kind: 'collection';
|
||||
}
|
||||
|
||||
export interface ManifestWorkspaceViewContentTypeDesignEditorKind extends ManifestWorkspaceView {
|
||||
type: 'workspaceView';
|
||||
kind: 'contentTypeDesignEditor';
|
||||
@@ -36,7 +31,6 @@ export interface MetaWorkspaceViewContentTypeDesignEditorKind extends MetaWorksp
|
||||
declare global {
|
||||
interface UmbExtensionManifestMap {
|
||||
ManifestWorkspaceView: ManifestWorkspaceView;
|
||||
ManifestWorkspaceViewCollectionKind: ManifestWorkspaceViewCollectionKind;
|
||||
ManifestWorkspaceViewContentTypeDesignEditorKind: ManifestWorkspaceViewContentTypeDesignEditorKind;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { UmbRoutableWorkspaceContext } from '../contexts/tokens/routable-workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../contexts/tokens/workspace-context.interface.js';
|
||||
import type { UmbWorkspaceContext } from '../workspace-context.interface.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
import type { ManifestElementAndApi } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
|
||||
@@ -12,3 +12,7 @@ export * from './workspace.element.js';
|
||||
|
||||
export type * from './conditions/index.js';
|
||||
export type * from './types.js';
|
||||
|
||||
export * from './workspace.context-token.js';
|
||||
export * from './workspace-context.interface.js';
|
||||
export * from './workspace.element.js';
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../../workspace.context-token.js';
|
||||
import type { UmbWorkspaceContext } from '../../workspace-context.interface.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
import type { ManifestWorkspace } from '@umbraco-cms/backoffice/workspace';
|
||||
import { UmbEntityContext, type UmbEntityUnique } from '@umbraco-cms/backoffice/entity';
|
||||
|
||||
export class UmbDefaultWorkspaceContext
|
||||
extends UmbContextBase<UmbDefaultWorkspaceContext>
|
||||
implements UmbWorkspaceContext
|
||||
{
|
||||
public workspaceAlias!: string;
|
||||
|
||||
#entityContext = new UmbEntityContext(this);
|
||||
|
||||
constructor(host: UmbControllerHost) {
|
||||
super(host, UMB_WORKSPACE_CONTEXT.toString());
|
||||
}
|
||||
|
||||
set manifest(manifest: ManifestWorkspace) {
|
||||
this.workspaceAlias = manifest.alias;
|
||||
this.setEntityType(manifest.meta.entityType);
|
||||
}
|
||||
|
||||
setUnique(unique: UmbEntityUnique): void {
|
||||
this.#entityContext.setUnique(unique);
|
||||
}
|
||||
|
||||
getUnique(): UmbEntityUnique {
|
||||
return this.#entityContext.getUnique();
|
||||
}
|
||||
|
||||
setEntityType(entityType: string): void {
|
||||
this.#entityContext.setEntityType(entityType);
|
||||
}
|
||||
|
||||
getEntityType(): string {
|
||||
return this.#entityContext.getEntityType()!;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbDefaultWorkspaceContext as api };
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { ManifestWorkspaceDefaultKind } from './types.js';
|
||||
import { customElement, html, ifDefined, property } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
|
||||
@customElement('umb-default-workspace')
|
||||
export class UmbDefaultWorkspaceElement extends UmbLitElement {
|
||||
@property({ type: Object, attribute: false })
|
||||
manifest?: ManifestWorkspaceDefaultKind;
|
||||
|
||||
override render() {
|
||||
if (this.manifest === undefined) return html` <div>No Manifest</div> `;
|
||||
const headline = this.manifest?.meta.headline;
|
||||
|
||||
return html` <umb-workspace-editor
|
||||
alias=${this.manifest.alias}
|
||||
headline=${ifDefined(headline ? this.localize.string(headline) : undefined)}></umb-workspace-editor>`;
|
||||
}
|
||||
|
||||
static override styles = [UmbTextStyles];
|
||||
}
|
||||
|
||||
export { UmbDefaultWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-default-workspace': UmbDefaultWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './default-workspace.context.js';
|
||||
export * from './default-workspace.element.js';
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
|
||||
{
|
||||
type: 'kind',
|
||||
alias: 'Umb.Kind.Workspace.Default',
|
||||
matchKind: 'default',
|
||||
matchType: 'workspace',
|
||||
manifest: {
|
||||
type: 'workspace',
|
||||
kind: 'default',
|
||||
element: () => import('./default-workspace.element.js'),
|
||||
api: () => import('./default-workspace.context.js'),
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { ManifestWorkspace, MetaWorkspace } from '../../extensions/types.js';
|
||||
import type { UmbDefaultWorkspaceContext } from './default-workspace.context.js';
|
||||
import type { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
|
||||
|
||||
export interface ManifestWorkspaceDefaultKind
|
||||
extends ManifestWorkspace<MetaWorkspaceDefaultKind, UmbControllerHostElement, UmbDefaultWorkspaceContext> {
|
||||
type: 'workspace';
|
||||
kind: 'default';
|
||||
}
|
||||
|
||||
export interface MetaWorkspaceDefaultKind extends MetaWorkspace {
|
||||
headline: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface UmbExtensionManifestMap {
|
||||
umbManifestWorkspaceDefaultKind: ManifestWorkspaceDefaultKind;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
import { manifest as routableKindManifest } from './routable/routable-workspace.kind.js';
|
||||
import { manifests as defaultManifests } from './default/manifests.js';
|
||||
|
||||
import type { UmbExtensionManifestKind } from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [routableKindManifest];
|
||||
export const manifests: Array<UmbExtensionManifest | UmbExtensionManifestKind> = [
|
||||
routableKindManifest,
|
||||
...defaultManifests,
|
||||
];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { UmbWorkspaceRouteManager } from '../controllers/workspace-route-manager.controller.js';
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../contexts/tokens/workspace.context-token.js';
|
||||
import { UMB_WORKSPACE_CONTEXT } from '../workspace.context-token.js';
|
||||
import type { UmbSubmittableWorkspaceContext } from '../contexts/tokens/submittable-workspace-context.interface.js';
|
||||
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
||||
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
|
||||
|
||||
@@ -16,7 +16,7 @@ export class UmbWorkspaceElement extends UmbLitElement {
|
||||
if (!this.entityType) return nothing;
|
||||
return html`<umb-extension-with-api-slot
|
||||
type="workspace"
|
||||
.defaultApi=${() => import('./contexts/default-workspace.context.js')}
|
||||
.defaultApi=${() => import('./kinds/default/default-workspace.context.js')}
|
||||
.apiArgs=${apiArgsCreator}
|
||||
.filter=${(manifest: ManifestWorkspace) =>
|
||||
manifest.meta.entityType === this.entityType}></umb-extension-with-api-slot>`;
|
||||
|
||||
@@ -31,7 +31,6 @@ import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
import { UMB_INVARIANT_CULTURE, UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
|
||||
import {
|
||||
type UmbCollectionWorkspaceContext,
|
||||
type UmbPublishableWorkspaceContext,
|
||||
UmbSubmittableWorkspaceContextBase,
|
||||
UmbWorkspaceIsNewRedirectController,
|
||||
@@ -64,7 +63,7 @@ import {
|
||||
} from '@umbraco-cms/backoffice/validation';
|
||||
import { UmbDocumentBlueprintDetailRepository } from '@umbraco-cms/backoffice/document-blueprint';
|
||||
import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification';
|
||||
import type { UmbContentWorkspaceContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbContentCollectionWorkspaceContext, UmbContentWorkspaceContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbDocumentTypeDetailModel } from '@umbraco-cms/backoffice/document-type';
|
||||
import { UmbIsTrashedEntityContext } from '@umbraco-cms/backoffice/recycle-bin';
|
||||
import { UmbReadOnlyVariantStateManager } from '@umbraco-cms/backoffice/utils';
|
||||
@@ -75,7 +74,7 @@ export class UmbDocumentWorkspaceContext
|
||||
implements
|
||||
UmbContentWorkspaceContext<UmbDocumentTypeDetailModel, UmbDocumentVariantModel>,
|
||||
UmbPublishableWorkspaceContext,
|
||||
UmbCollectionWorkspaceContext<UmbDocumentTypeDetailModel>
|
||||
UmbContentCollectionWorkspaceContext<UmbDocumentTypeDetailModel>
|
||||
{
|
||||
public readonly IS_CONTENT_WORKSPACE_CONTEXT = true as const;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export const manifests: Array<UmbExtensionManifest> = [
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
kind: 'contentCollection',
|
||||
alias: 'Umb.WorkspaceView.Document.Collection',
|
||||
name: 'Document Workspace Collection View',
|
||||
meta: {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
export const UMB_EXTENSION_ENTITY_TYPE = 'extension';
|
||||
export const UMB_EXTENSION_ROOT_ENTITY_TYPE = 'extension-root';
|
||||
|
||||
export type UmbExtensionEntityType = typeof UMB_EXTENSION_ENTITY_TYPE;
|
||||
export type UmbExtensionRootEntityType = typeof UMB_EXTENSION_ROOT_ENTITY_TYPE;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_EXTENSION_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.ExtensionRoot';
|
||||
@@ -1,26 +0,0 @@
|
||||
import { UMB_EXTENSION_COLLECTION_ALIAS } from '../collection/manifests.js';
|
||||
import { UMB_EXTENSION_ROOT_WORKSPACE_ALIAS } from './manifests.js';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
@customElement('umb-extension-root-workspace')
|
||||
export class UmbExtensionRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html`
|
||||
<umb-workspace-editor
|
||||
headline="Extension Insights"
|
||||
alias=${UMB_EXTENSION_ROOT_WORKSPACE_ALIAS}
|
||||
.enforceNoFooter=${true}>
|
||||
<umb-collection alias=${UMB_EXTENSION_COLLECTION_ALIAS}></umb-collection>
|
||||
</umb-workspace-editor>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbExtensionRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-extension-root-workspace': UmbExtensionRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import './extension-root-workspace.element.js';
|
||||
|
||||
import type { UmbExtensionRootWorkspaceElement } from './extension-root-workspace.element.js';
|
||||
import type { Meta, Story } from '@storybook/web-components';
|
||||
import { html } from '@umbraco-cms/backoffice/external/lit';
|
||||
|
||||
export default {
|
||||
title: 'Workspaces/Extensions',
|
||||
component: 'umb-workspace-extension-root',
|
||||
id: 'umb-workspace-extension-root',
|
||||
} as Meta;
|
||||
|
||||
export const AAAOverview: Story<UmbExtensionRootWorkspaceElement> = () =>
|
||||
html` <umb-workspace-extension-root></umb-workspace-extension-root>`;
|
||||
AAAOverview.storyName = 'Overview';
|
||||
@@ -1,13 +1,34 @@
|
||||
export const UMB_EXTENSION_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.ExtensionRoot';
|
||||
import { UMB_EXTENSION_COLLECTION_ALIAS } from '../collection/manifests.js';
|
||||
import { UMB_EXTENSION_ROOT_ENTITY_TYPE } from '../entity.js';
|
||||
import { UMB_EXTENSION_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.ExtensionRoot',
|
||||
name: 'Extension Root Workspace',
|
||||
element: () => import('./extension-root-workspace.element.js'),
|
||||
kind: 'default',
|
||||
alias: UMB_EXTENSION_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'Extension Insights Root Workspace',
|
||||
meta: {
|
||||
entityType: 'extension-root',
|
||||
entityType: UMB_EXTENSION_ROOT_ENTITY_TYPE,
|
||||
headline: 'Extension Insights',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.Extension.Collection',
|
||||
name: 'Extension Insights Root Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_EXTENSION_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_EXTENSION_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_LANGUAGE_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.LanguageRoot';
|
||||
@@ -1,20 +0,0 @@
|
||||
import { UMB_LANGUAGE_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
@customElement('umb-language-root-workspace')
|
||||
export class UmbLanguageRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline="Languages">
|
||||
<umb-collection alias=${UMB_LANGUAGE_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbLanguageRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-language-root-workspace': UmbLanguageRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,34 @@
|
||||
import { UMB_LANGUAGE_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { UMB_LANGUAGE_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_LANGUAGE_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.LanguageRoot',
|
||||
kind: 'default',
|
||||
alias: UMB_LANGUAGE_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'Language Root Workspace',
|
||||
element: () => import('./language-root-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: 'language-root',
|
||||
entityType: UMB_LANGUAGE_ROOT_ENTITY_TYPE,
|
||||
headline: '#treeHeaders_languages',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.LanguageRoot.Collection',
|
||||
name: 'Webhook Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_LANGUAGE_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_LANGUAGE_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -17,7 +17,7 @@ export const manifests: Array<UmbExtensionManifest> = [
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
kind: 'contentCollection',
|
||||
alias: 'Umb.WorkspaceView.Media.Collection',
|
||||
name: 'Media Workspace Collection View',
|
||||
meta: {
|
||||
|
||||
@@ -6,7 +6,6 @@ import type { UmbMediaDetailModel, UmbMediaVariantModel, UmbMediaVariantOptionMo
|
||||
import { UMB_INVARIANT_CULTURE, UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
||||
import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type';
|
||||
import {
|
||||
type UmbCollectionWorkspaceContext,
|
||||
UmbSubmittableWorkspaceContextBase,
|
||||
UmbWorkspaceIsNewRedirectController,
|
||||
UmbWorkspaceSplitViewManager,
|
||||
@@ -25,7 +24,7 @@ import {
|
||||
UmbRequestReloadStructureForEntityEvent,
|
||||
} from '@umbraco-cms/backoffice/entity-action';
|
||||
import type { UmbMediaTypeDetailModel } from '@umbraco-cms/backoffice/media-type';
|
||||
import type { UmbContentWorkspaceContext } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbContentCollectionWorkspaceContext, UmbContentWorkspaceContext } from '@umbraco-cms/backoffice/content';
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
import { UmbIsTrashedEntityContext } from '@umbraco-cms/backoffice/recycle-bin';
|
||||
import { UmbReadOnlyVariantStateManager } from '@umbraco-cms/backoffice/utils';
|
||||
@@ -35,7 +34,7 @@ export class UmbMediaWorkspaceContext
|
||||
extends UmbSubmittableWorkspaceContextBase<EntityType>
|
||||
implements
|
||||
UmbContentWorkspaceContext<UmbMediaTypeDetailModel, UmbMediaVariantModel>,
|
||||
UmbCollectionWorkspaceContext<UmbMediaTypeDetailModel>
|
||||
UmbContentCollectionWorkspaceContext<UmbMediaTypeDetailModel>
|
||||
{
|
||||
public readonly IS_CONTENT_WORKSPACE_CONTEXT = true as const;
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_MEMBER_GROUP_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.MemberGroupRoot';
|
||||
@@ -1,13 +1,34 @@
|
||||
import { UMB_MEMBER_GROUP_COLLECTION_ALIAS } from '../../collection/manifests.js';
|
||||
import { UMB_MEMBER_GROUP_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_MEMBER_GROUP_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.MemberGroupRoot',
|
||||
kind: 'default',
|
||||
alias: UMB_MEMBER_GROUP_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'Member Group Root Workspace View',
|
||||
element: () => import('./member-group-root-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: UMB_MEMBER_GROUP_ROOT_ENTITY_TYPE,
|
||||
headline: '#treeHeaders_memberGroups',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.MemberGroupRoot.Collection',
|
||||
name: 'Member Group Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_MEMBER_GROUP_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_MEMBER_GROUP_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { UMB_MEMBER_GROUP_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-member-group-root-workspace';
|
||||
@customElement(elementName)
|
||||
export class UmbMemberGroupRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline=${this.localize.term('treeHeaders_memberGroups')}>
|
||||
<umb-collection alias=${UMB_MEMBER_GROUP_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbMemberGroupRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbMemberGroupRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_MEMBER_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.MemberRoot';
|
||||
@@ -1,13 +1,34 @@
|
||||
import { UMB_MEMBER_COLLECTION_ALIAS } from '../../collection/manifests.js';
|
||||
import { UMB_MEMBER_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_MEMBER_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.MemberRoot',
|
||||
name: 'Member Root Workspace View',
|
||||
element: () => import('./member-root-workspace.element.js'),
|
||||
kind: 'default',
|
||||
alias: UMB_MEMBER_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'Member Root Workspace',
|
||||
meta: {
|
||||
entityType: UMB_MEMBER_ROOT_ENTITY_TYPE,
|
||||
headline: '#treeHeaders_member',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.MemberRoot.Collection',
|
||||
name: 'Member Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_MEMBER_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_MEMBER_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { UMB_MEMBER_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { UMB_MEMBER_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
const elementName = 'umb-member-root-workspace';
|
||||
@customElement(elementName)
|
||||
export class UmbMemberRootWorkspaceElement extends UmbLitElement {
|
||||
constructor() {
|
||||
super();
|
||||
// TODO: this.should happen automatically
|
||||
const entityContext = new UmbEntityContext(this);
|
||||
entityContext.setEntityType(UMB_MEMBER_ROOT_ENTITY_TYPE);
|
||||
entityContext.setUnique(null);
|
||||
}
|
||||
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline=${this.localize.term('treeHeaders_member')}>
|
||||
<umb-collection alias=${UMB_MEMBER_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbMemberRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbMemberRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import { html, customElement, property, state } from '@umbraco-cms/backoffice/ex
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import { UMB_DOCUMENT_COLLECTION_ALIAS } from '@umbraco-cms/backoffice/document';
|
||||
import { UMB_PROPERTY_CONTEXT } from '@umbraco-cms/backoffice/property';
|
||||
import { UMB_COLLECTION_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
|
||||
import { UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/content';
|
||||
import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type {
|
||||
UmbCollectionBulkActionPermissions,
|
||||
@@ -31,7 +31,7 @@ export class UmbPropertyEditorUICollectionElement extends UmbLitElement implemen
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.consumeContext(UMB_COLLECTION_WORKSPACE_CONTEXT, (workspaceContext) => {
|
||||
this.consumeContext(UMB_CONTENT_COLLECTION_WORKSPACE_CONTEXT, (workspaceContext) => {
|
||||
this._collectionAlias = workspaceContext.getCollectionAlias();
|
||||
|
||||
this.consumeContext(UMB_PROPERTY_CONTEXT, (propertyContext) => {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { manifests as menuManifests } from './menu/manifests.js';
|
||||
import { manifests as relationManifests } from './relations/manifests.js';
|
||||
import { manifests as relationTypeManifests } from './relation-types/manifests.js';
|
||||
import { manifests as workspaceManifests } from './workspace/manifests.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
...relationTypeManifests,
|
||||
...relationManifests,
|
||||
...menuManifests,
|
||||
...relationManifests,
|
||||
...relationTypeManifests,
|
||||
...workspaceManifests,
|
||||
];
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { UMB_RELATION_TYPE_ROOT_ENTITY_TYPE } from '../relation-types/index.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'menuItem',
|
||||
@@ -9,7 +7,7 @@ export const manifests: Array<UmbExtensionManifest> = [
|
||||
meta: {
|
||||
label: '#treeHeaders_relations',
|
||||
icon: 'icon-trafic',
|
||||
entityType: UMB_RELATION_TYPE_ROOT_ENTITY_TYPE,
|
||||
entityType: 'relations-root',
|
||||
menus: ['Umb.Menu.AdvancedSettings'],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './repository/index.js';
|
||||
export * from './collection/index.js';
|
||||
export * from './entity.js';
|
||||
export * from './repository/index.js';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { manifests as relationTypeManifests } from './relation-type/manifests.js';
|
||||
import { manifests as relationTypeRootManifests } from './relation-type-root/manifests.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [...relationTypeManifests, ...relationTypeRootManifests];
|
||||
export const manifests: Array<UmbExtensionManifest> = [...relationTypeManifests];
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.RelationTypeRoot',
|
||||
name: 'Relation Type Root Workspace',
|
||||
element: () => import('./relation-type-root-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: 'relation-type-root',
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -1,22 +0,0 @@
|
||||
import { UMB_RELATION_TYPE_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
@customElement('umb-relation-type-root-workspace')
|
||||
export class UmbRelationTypeRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html`
|
||||
<umb-body-layout main-no-padding headline=${this.localize.term('relationType_relations')}>
|
||||
<umb-collection alias=${UMB_RELATION_TYPE_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbRelationTypeRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-relation-type-root-workspace': UmbRelationTypeRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { UMB_RELATIONS_ROOT_WORKSPACE_PATH } from '../../../workspace/paths.js';
|
||||
import { UMB_RELATION_TYPE_WORKSPACE_CONTEXT } from './relation-type-workspace.context-token.js';
|
||||
import { observeMultiple } from '@umbraco-cms/backoffice/observable-api';
|
||||
import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit';
|
||||
@@ -36,11 +37,9 @@ export class UmbRelationTypeWorkspaceEditorElement extends UmbLitElement {
|
||||
|
||||
override render() {
|
||||
return html`
|
||||
<umb-workspace-editor
|
||||
alias="Umb.Workspace.RelationType"
|
||||
back-path="section/settings/workspace/relation-type-root">
|
||||
<umb-workspace-editor alias="Umb.Workspace.RelationType" back-path="${UMB_RELATIONS_ROOT_WORKSPACE_PATH}">
|
||||
<div id="header" slot="header">
|
||||
<uui-input id="name" .value=${this._name} readonly>
|
||||
<uui-input id="name" .value=${this._name ?? ''} readonly>
|
||||
<div id="alias" slot="append">${this._alias}</div>
|
||||
</uui-input>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { UMB_RELATION_TYPE_COLLECTION_ALIAS } from '@umbraco-cms/backoffice/relation-type';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
kind: 'default',
|
||||
alias: 'Umb.Workspace.RelationsRoot',
|
||||
name: 'Relations Root Workspace',
|
||||
meta: {
|
||||
entityType: 'relations-root',
|
||||
headline: 'Relations',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.Workspace.RelationsRoot.Collection',
|
||||
name: 'Relations Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_RELATION_TYPE_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: 'Umb.Workspace.RelationsRoot',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,7 @@
|
||||
import { UMB_SETTINGS_SECTION_PATHNAME } from '@umbraco-cms/backoffice/settings';
|
||||
import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
export const UMB_RELATIONS_ROOT_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({
|
||||
sectionName: UMB_SETTINGS_SECTION_PATHNAME,
|
||||
entityType: 'relations-root',
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_USER_GROUP_WORKSPACE_ALIAS = 'Umb.Workspace.UserGroupRoot';
|
||||
@@ -1,13 +1,34 @@
|
||||
import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { UMB_USER_GROUP_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_USER_GROUP_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.UserGroupRoot',
|
||||
kind: 'default',
|
||||
alias: UMB_USER_GROUP_WORKSPACE_ALIAS,
|
||||
name: 'User Group Root Workspace View',
|
||||
element: () => import('./user-group-root-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: UMB_USER_GROUP_ROOT_ENTITY_TYPE,
|
||||
headline: '#user_usergroups',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.UserGroupRoot.Collection',
|
||||
name: 'User Group Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_USER_GROUP_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_USER_GROUP_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { UMB_USER_GROUP_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-group-root-workspace';
|
||||
@customElement(elementName)
|
||||
export class UmbUserGroupRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline=${this.localize.term('user_usergroups')}>
|
||||
<umb-collection alias=${UMB_USER_GROUP_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbUserGroupRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbUserGroupRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_USER_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.UserRoot';
|
||||
@@ -1,13 +1,34 @@
|
||||
import { UMB_USER_COLLECTION_ALIAS } from '../../collection/constants.js';
|
||||
import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_USER_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.UserRoot',
|
||||
name: 'User Root Workspace View',
|
||||
element: () => import('./user-root-workspace.element.js'),
|
||||
kind: 'default',
|
||||
alias: UMB_USER_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'User Root Workspace',
|
||||
meta: {
|
||||
entityType: UMB_USER_ROOT_ENTITY_TYPE,
|
||||
headline: '#treeHeaders_users',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.UserRoot.Collection',
|
||||
name: 'User Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
icon: 'icon-layers',
|
||||
pathname: 'collection',
|
||||
collectionAlias: UMB_USER_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_USER_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { UMB_USER_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { UMB_USER_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UmbEntityContext } from '@umbraco-cms/backoffice/entity';
|
||||
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 {
|
||||
constructor() {
|
||||
super();
|
||||
// TODO: this.should happen automatically
|
||||
const entityContext = new UmbEntityContext(this);
|
||||
entityContext.setEntityType(UMB_USER_ROOT_ENTITY_TYPE);
|
||||
entityContext.setUnique(null);
|
||||
}
|
||||
|
||||
override render() {
|
||||
return html` <umb-body-layout main-no-padding headline=${this.localize.term('treeHeaders_users')}>
|
||||
<umb-collection alias=${UMB_USER_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbUserRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
[elementName]: UmbUserRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const UMB_WEBHOOK_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.WebhookRoot';
|
||||
@@ -1,11 +1,34 @@
|
||||
import { UMB_WEBHOOK_COLLECTION_ALIAS } from '../../collection/manifests.js';
|
||||
import { UMB_WEBHOOK_ROOT_ENTITY_TYPE } from '../../entity.js';
|
||||
import { UMB_WEBHOOK_ROOT_WORKSPACE_ALIAS } from './constants.js';
|
||||
|
||||
export const manifests: Array<UmbExtensionManifest> = [
|
||||
{
|
||||
type: 'workspace',
|
||||
alias: 'Umb.Workspace.WebhookRoot',
|
||||
kind: 'default',
|
||||
alias: UMB_WEBHOOK_ROOT_WORKSPACE_ALIAS,
|
||||
name: 'Webhook Root Workspace',
|
||||
element: () => import('./webhook-root-workspace.element.js'),
|
||||
meta: {
|
||||
entityType: 'webhook-root',
|
||||
entityType: UMB_WEBHOOK_ROOT_ENTITY_TYPE,
|
||||
headline: '#treeHeaders_webhooks',
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'workspaceView',
|
||||
kind: 'collection',
|
||||
alias: 'Umb.WorkspaceView.WebhookRoot.Collection',
|
||||
name: 'Webhook Root Collection Workspace View',
|
||||
meta: {
|
||||
label: 'Collection',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-layers',
|
||||
collectionAlias: UMB_WEBHOOK_COLLECTION_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: UMB_WEBHOOK_ROOT_WORKSPACE_ALIAS,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { UMB_WEBHOOK_COLLECTION_ALIAS } from '../../collection/index.js';
|
||||
import { html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
|
||||
@customElement('umb-webhook-root-workspace')
|
||||
export class UmbWebhookRootWorkspaceElement extends UmbLitElement {
|
||||
override render() {
|
||||
return html`
|
||||
<umb-body-layout main-no-padding headline=${this.localize.term('treeHeaders_webhooks')}>
|
||||
<umb-collection alias=${UMB_WEBHOOK_COLLECTION_ALIAS}></umb-collection>;
|
||||
</umb-body-layout>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
export { UmbWebhookRootWorkspaceElement as element };
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-webhook-root-workspace': UmbWebhookRootWorkspaceElement;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user