Removes workspaceViewCollection extension type
The `workspaceView` type will be used moving forwards.
This commit is contained in:
@@ -31,7 +31,6 @@ import type { ManifestWorkspace } from './workspace.model.js';
|
||||
import type { ManifestWorkspaceAction } from './workspace-action.model.js';
|
||||
import type { ManifestWorkspaceContext } from './workspace-context.model.js';
|
||||
import type { ManifestWorkspaceView } from './workspace-view.model.js';
|
||||
import type { ManifestWorkspaceViewCollection } from './workspace-view-collection.model.js';
|
||||
import type { ManifestUserPermission } from './user-permission.model.js';
|
||||
import type { ManifestUserGranularPermission } from './user-granular-permission.model.js';
|
||||
import type { ManifestCollectionAction } from './collection-action.model.js';
|
||||
@@ -77,7 +76,6 @@ export type * from './user-profile-app.model.js';
|
||||
export type * from './workspace-action.model.js';
|
||||
export type * from './workspace-context.model.js';
|
||||
export type * from './workspace-view.model.js';
|
||||
export type * from './workspace-view-collection.model.js';
|
||||
export type * from './workspace.model.js';
|
||||
|
||||
export type ManifestTypes =
|
||||
@@ -125,7 +123,6 @@ export type ManifestTypes =
|
||||
| ManifestWorkspaceAction
|
||||
| ManifestWorkspaceContext
|
||||
| ManifestWorkspaceView
|
||||
| ManifestWorkspaceViewCollection
|
||||
| ManifestUserPermission
|
||||
| ManifestUserGranularPermission
|
||||
| ManifestBase;
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import type { ConditionTypes } from '../conditions/types.js';
|
||||
import type {
|
||||
ManifestWithDynamicConditions,
|
||||
ManifestWithView,
|
||||
MetaManifestWithView,
|
||||
} from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
export interface ManifestWorkspaceViewCollection
|
||||
extends ManifestWithView,
|
||||
ManifestWithDynamicConditions<ConditionTypes> {
|
||||
type: 'workspaceViewCollection';
|
||||
meta: MetaEditorViewCollection;
|
||||
}
|
||||
|
||||
export interface MetaEditorViewCollection extends MetaManifestWithView {
|
||||
/**
|
||||
* The entity type that this view collection should be available in
|
||||
*
|
||||
* @examples [
|
||||
* "media"
|
||||
* ]
|
||||
*/
|
||||
entityType: string;
|
||||
|
||||
/**
|
||||
* The repository alias that this view collection should be available in
|
||||
* @examples [
|
||||
* "Umb.Repository.Media"
|
||||
* ]
|
||||
*/
|
||||
repositoryAlias: string;
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import { css, html, nothing, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit';
|
||||
import type { UmbRoute, UmbRouterSlotInitEvent, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router';
|
||||
import type {
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
import type { ManifestWorkspaceView } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UmbExtensionsManifestInitializer, createExtensionElement } from '@umbraco-cms/backoffice/extension-api';
|
||||
|
||||
@@ -37,7 +34,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
|
||||
public enforceNoFooter = false;
|
||||
|
||||
@state()
|
||||
private _workspaceViews: Array<ManifestWorkspaceView | ManifestWorkspaceViewCollection> = [];
|
||||
private _workspaceViews: Array<ManifestWorkspaceView> = [];
|
||||
|
||||
@state()
|
||||
private _routes?: UmbRoute[];
|
||||
@@ -50,16 +47,10 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
new UmbExtensionsManifestInitializer(
|
||||
this,
|
||||
umbExtensionsRegistry,
|
||||
['workspaceView', 'workspaceViewCollection'],
|
||||
null,
|
||||
(workspaceViews) => {
|
||||
this._workspaceViews = workspaceViews.map((view) => view.manifest);
|
||||
this._createRoutes();
|
||||
},
|
||||
);
|
||||
new UmbExtensionsManifestInitializer(this, umbExtensionsRegistry, ['workspaceView'], null, (workspaceViews) => {
|
||||
this._workspaceViews = workspaceViews.map((view) => view.manifest);
|
||||
this._createRoutes();
|
||||
});
|
||||
}
|
||||
|
||||
private _createRoutes() {
|
||||
@@ -69,14 +60,7 @@ export class UmbWorkspaceEditorElement extends UmbLitElement {
|
||||
this._routes = this._workspaceViews.map((manifest) => {
|
||||
return {
|
||||
path: `view/${manifest.meta.pathname}`,
|
||||
component: () => {
|
||||
if (manifest.type === 'workspaceViewCollection') {
|
||||
return import(
|
||||
'../../workspace-content/views/collection/workspace-view-collection.element.js'
|
||||
) as unknown as Promise<HTMLElement>;
|
||||
}
|
||||
return createExtensionElement(manifest);
|
||||
},
|
||||
component: () => createExtensionElement(manifest),
|
||||
setup: (component) => {
|
||||
if (component && componentHasManifestProperty(component)) {
|
||||
component.manifest = manifest;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit';
|
||||
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
|
||||
import type { UmbDefaultCollectionContext } from '@umbraco-cms/backoffice/collection';
|
||||
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
||||
import type { ManifestWorkspaceViewCollection } from '@umbraco-cms/backoffice/extension-registry';
|
||||
import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
|
||||
|
||||
import '../../../../collection/dashboards/dashboard-collection.element.js';
|
||||
import type { UmbTreeItemModelBase } from '@umbraco-cms/backoffice/tree';
|
||||
|
||||
@customElement('umb-workspace-view-collection')
|
||||
export class UmbWorkspaceViewCollectionElement extends UmbLitElement {
|
||||
public manifest!: ManifestWorkspaceViewCollection;
|
||||
|
||||
private _workspaceContext?: typeof UMB_WORKSPACE_CONTEXT.TYPE;
|
||||
|
||||
// TODO: add type for the collection context.
|
||||
private _collectionContext?: UmbDefaultCollectionContext<UmbTreeItemModelBase, any>;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.consumeContext(UMB_WORKSPACE_CONTEXT, (nodeContext) => {
|
||||
this._workspaceContext = nodeContext;
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
// TODO: figure out what the collection to render
|
||||
return html`<umb-collection></umb-collection>`;
|
||||
}
|
||||
|
||||
static styles = [
|
||||
UmbTextStyles,
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
export default UmbWorkspaceViewCollectionElement;
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'umb-workspace-view-collection': UmbWorkspaceViewCollectionElement;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import type {
|
||||
ManifestWorkspace,
|
||||
ManifestWorkspaceAction,
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const workspace: ManifestWorkspace = {
|
||||
@@ -60,25 +59,6 @@ const workspaceViews: Array<ManifestWorkspaceView> = [
|
||||
},
|
||||
];
|
||||
|
||||
const workspaceViewCollections: Array<ManifestWorkspaceViewCollection> = [
|
||||
/*
|
||||
// TODO: Reenable this:
|
||||
{
|
||||
type: 'workspaceViewCollection',
|
||||
alias: 'Umb.WorkspaceView.Document.Collection',
|
||||
name: 'Document Workspace Collection View',
|
||||
weight: 300,
|
||||
meta: {
|
||||
label: 'Documents',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-grid',
|
||||
entityType: UMB_DOCUMENT_ENTITY_TYPE,
|
||||
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
|
||||
}
|
||||
},
|
||||
*/
|
||||
];
|
||||
|
||||
const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
{
|
||||
type: 'workspaceAction',
|
||||
@@ -152,4 +132,4 @@ const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
*/
|
||||
];
|
||||
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceViewCollections, ...workspaceActions];
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceActions];
|
||||
|
||||
@@ -2,7 +2,6 @@ import type {
|
||||
ManifestWorkspace,
|
||||
ManifestWorkspaceAction,
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
import { UmbSaveWorkspaceAction } from '@umbraco-cms/backoffice/workspace';
|
||||
@@ -55,7 +54,7 @@ const workspaceViews: Array<ManifestWorkspaceView> = [
|
||||
],
|
||||
},
|
||||
];
|
||||
const workspaceViewCollections: Array<ManifestWorkspaceViewCollection> = [];
|
||||
|
||||
const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
{
|
||||
type: 'workspaceAction',
|
||||
@@ -76,4 +75,4 @@ const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceViewCollections, ...workspaceActions];
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceActions];
|
||||
|
||||
@@ -4,7 +4,6 @@ import type {
|
||||
ManifestWorkspace,
|
||||
ManifestWorkspaceAction,
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const workspace: ManifestWorkspace = {
|
||||
@@ -19,6 +18,24 @@ const workspace: ManifestWorkspace = {
|
||||
};
|
||||
|
||||
const workspaceViews: Array<ManifestWorkspaceView> = [
|
||||
// {
|
||||
// type: 'workspaceView',
|
||||
// alias: 'Umb.WorkspaceView.Media.Collection',
|
||||
// name: 'Media Workspace Collection View',
|
||||
// element: () => import('./views/collection/media-collection-workspace-view.element.js'),
|
||||
// weight: 300,
|
||||
// meta: {
|
||||
// label: 'Media',
|
||||
// pathname: 'collection',
|
||||
// icon: 'icon-grid',
|
||||
// },
|
||||
// conditions: [
|
||||
// {
|
||||
// alias: 'Umb.Condition.WorkspaceAlias',
|
||||
// match: workspace.alias,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
type: 'workspaceView',
|
||||
alias: 'Umb.WorkspaceView.Media.Edit',
|
||||
@@ -57,28 +74,6 @@ const workspaceViews: Array<ManifestWorkspaceView> = [
|
||||
},
|
||||
];
|
||||
|
||||
const workspaceViewCollections: Array<ManifestWorkspaceViewCollection> = [
|
||||
{
|
||||
type: 'workspaceViewCollection',
|
||||
alias: 'Umb.WorkspaceView.Media.Collection',
|
||||
name: 'Media Workspace Collection View',
|
||||
weight: 300,
|
||||
meta: {
|
||||
label: 'Media',
|
||||
pathname: 'collection',
|
||||
icon: 'icon-grid',
|
||||
entityType: 'media',
|
||||
repositoryAlias: UMB_MEDIA_DETAIL_REPOSITORY_ALIAS,
|
||||
},
|
||||
conditions: [
|
||||
{
|
||||
alias: 'Umb.Condition.WorkspaceAlias',
|
||||
match: workspace.alias,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
{
|
||||
type: 'workspaceAction',
|
||||
@@ -99,4 +94,4 @@ const workspaceActions: Array<ManifestWorkspaceAction> = [
|
||||
},
|
||||
];
|
||||
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceViewCollections, ...workspaceActions];
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceActions];
|
||||
|
||||
@@ -2,7 +2,6 @@ import type {
|
||||
ManifestWorkspace,
|
||||
ManifestWorkspaceAction,
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const workspace: ManifestWorkspace = {
|
||||
@@ -16,7 +15,6 @@ const workspace: ManifestWorkspace = {
|
||||
};
|
||||
|
||||
const workspaceViews: Array<ManifestWorkspaceView> = [];
|
||||
const workspaceViewCollections: Array<ManifestWorkspaceViewCollection> = [];
|
||||
const workspaceActions: Array<ManifestWorkspaceAction> = [];
|
||||
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceViewCollections, ...workspaceActions];
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceActions];
|
||||
|
||||
@@ -2,7 +2,6 @@ import type {
|
||||
ManifestWorkspace,
|
||||
ManifestWorkspaceAction,
|
||||
ManifestWorkspaceView,
|
||||
ManifestWorkspaceViewCollection,
|
||||
} from '@umbraco-cms/backoffice/extension-registry';
|
||||
|
||||
const workspace: ManifestWorkspace = {
|
||||
@@ -16,7 +15,6 @@ const workspace: ManifestWorkspace = {
|
||||
};
|
||||
|
||||
const workspaceViews: Array<ManifestWorkspaceView> = [];
|
||||
const workspaceViewCollections: Array<ManifestWorkspaceViewCollection> = [];
|
||||
const workspaceActions: Array<ManifestWorkspaceAction> = [];
|
||||
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceViewCollections, ...workspaceActions];
|
||||
export const manifests = [workspace, ...workspaceViews, ...workspaceActions];
|
||||
|
||||
Reference in New Issue
Block a user