diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/constants.ts index 3a8d47cb37..53e68e6f83 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/constants.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/constants.ts @@ -1,4 +1,6 @@ export * from './entity-actions/constants.js'; +export * from './media-type-root/constants.js'; +export * from './paths.js'; export * from './repository/constants.js'; export * from './tree/constants.js'; export * from './workspace/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/constants.ts new file mode 100644 index 0000000000..cd451683e2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/constants.ts @@ -0,0 +1 @@ +export const UMB_MEDIA_TYPE_ROOT_WORKSPACE_ALIAS = 'Umb.Workspace.MediaType.Root'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/manifests.ts new file mode 100644 index 0000000000..24d9ffbf8f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/media-type-root/manifests.ts @@ -0,0 +1,14 @@ +import { UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE } from '../entity.js'; + +export const manifests: Array = [ + { + type: 'workspace', + kind: 'default', + alias: 'Umb.Workspace.MediaType.Root', + name: 'Media Type Root Workspace', + meta: { + entityType: UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, + headline: '#treeHeaders_mediaTypes', + }, + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/paths.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/paths.ts new file mode 100644 index 0000000000..aa1f1a3057 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/paths.ts @@ -0,0 +1,25 @@ +import { UMB_MEDIA_TYPE_ENTITY_TYPE, UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE } from './entity.js'; +import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; +import { UMB_SETTINGS_SECTION_PATHNAME } from '@umbraco-cms/backoffice/settings'; +import { UmbPathPattern } from '@umbraco-cms/backoffice/router'; +import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity'; + +export const UMB_MEDIA_TYPE_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ + sectionName: UMB_SETTINGS_SECTION_PATHNAME, + entityType: UMB_MEDIA_TYPE_ENTITY_TYPE, +}); + +export const UMB_MEDIA_TYPE_ROOT_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ + sectionName: UMB_SETTINGS_SECTION_PATHNAME, + entityType: UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, +}); + +export const UMB_CREATE_MEDIA_TYPE_WORKSPACE_PATH_PATTERN = new UmbPathPattern<{ + parentEntityType: UmbEntityModel['entityType']; + parentUnique: UmbEntityModel['unique']; +}>('create/parent/:parentEntityType/:parentUnique', UMB_MEDIA_TYPE_WORKSPACE_PATH); + +export const UMB_EDIT_MEDIA_TYPE_WORKSPACE_PATH_PATTERN = new UmbPathPattern<{ unique: string }>( + 'edit/:unique', + UMB_MEDIA_TYPE_WORKSPACE_PATH, +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/constants.ts index b2004bc480..dd8bf8ebe7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/constants.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/constants.ts @@ -1,6 +1,8 @@ +export * from './folder/constants.js'; +export * from './tree-item-children/constants.js'; + export const UMB_MEDIA_TYPE_TREE_REPOSITORY_ALIAS = 'Umb.Repository.MediaType.Tree'; export const UMB_MEDIA_TYPE_TREE_STORE_ALIAS = 'Umb.Store.MediaType.Tree'; export const UMB_MEDIA_TYPE_TREE_ALIAS = 'Umb.Tree.MediaType'; export { UMB_MEDIA_TYPE_PICKER_MODAL } from './media-type-picker-modal.token.js'; export { UMB_MEDIA_TYPE_TREE_STORE_CONTEXT } from './media-type-tree.store.context-token.js'; -export * from './folder/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/constants.ts index d6eb7b36f7..72a29fed82 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/constants.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/constants.ts @@ -1,2 +1,3 @@ export const UMB_MEDIA_TYPE_FOLDER_WORKSPACE_ALIAS = 'Umb.Workspace.MediaType.Folder'; export * from './media-type-folder.workspace.context-token.js'; +export * from './paths.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/paths.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/paths.ts new file mode 100644 index 0000000000..edcc630ce8 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/folder/workspace/paths.ts @@ -0,0 +1,14 @@ +import { UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE } from '../../../entity.js'; +import { UmbPathPattern } from '@umbraco-cms/backoffice/router'; +import { UMB_SETTINGS_SECTION_PATHNAME } from '@umbraco-cms/backoffice/settings'; +import { UMB_WORKSPACE_PATH_PATTERN } from '@umbraco-cms/backoffice/workspace'; + +export const UMB_MEDIA_TYPE_FOLDER_WORKSPACE_PATH = UMB_WORKSPACE_PATH_PATTERN.generateAbsolute({ + sectionName: UMB_SETTINGS_SECTION_PATHNAME, + entityType: UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE, +}); + +export const UMB_EDIT_MEDIA_TYPE_FOLDER_WORKSPACE_PATH_PATTERN = new UmbPathPattern<{ unique: string }>( + 'edit/:unique', + UMB_MEDIA_TYPE_FOLDER_WORKSPACE_PATH, +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/manifests.ts index b3b3adad05..55a47a5163 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/manifests.ts @@ -9,7 +9,7 @@ import { UMB_MEDIA_TYPE_TREE_STORE_ALIAS, } from './constants.js'; import { manifests as folderManifests } from './folder/manifests.js'; -import { manifests as reloadTreeItemChildrenManifest } from './reload-tree-item-children/manifests.js'; +import { manifests as treeItemChildrenManifest } from './tree-item-children/manifests.js'; export const manifests: Array = [ { @@ -51,5 +51,5 @@ export const manifests: Array = [ }, }, ...folderManifests, - ...reloadTreeItemChildrenManifest, + ...treeItemChildrenManifest, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/reload-tree-item-children/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/reload-tree-item-children/manifests.ts deleted file mode 100644 index 2ca957e9bf..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/reload-tree-item-children/manifests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { - UMB_MEDIA_TYPE_ENTITY_TYPE, - UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE, - UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, -} from '../../entity.js'; - -export const manifests: Array = [ - { - type: 'entityAction', - kind: 'reloadTreeItemChildren', - alias: 'Umb.EntityAction.MediaType.Tree.ReloadChildrenOf', - name: 'Reload Media Type Tree Item Children Entity Action', - forEntityTypes: [UMB_MEDIA_TYPE_ENTITY_TYPE, UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], - }, -]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/constants.ts new file mode 100644 index 0000000000..31ae029793 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/constants.ts @@ -0,0 +1,2 @@ +export * from './repository/constants.js'; +export const UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS = 'Umb.Collection.MediaType.TreeItemChildren'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/index.ts new file mode 100644 index 0000000000..6c11f6abbb --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/index.ts @@ -0,0 +1,2 @@ +export * from './constants.js'; +export * from './repository/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/manifests.ts new file mode 100644 index 0000000000..17622c0111 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/manifests.ts @@ -0,0 +1,18 @@ +import { manifests as viewManifests } from './views/manifests.js'; +import { manifests as repositoryManifests } from './repository/manifests.js'; +import { UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from './constants.js'; +import { UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS } from './repository/index.js'; + +export const manifests: Array = [ + { + type: 'collection', + kind: 'default', + alias: UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, + name: 'Media Type Tree Item Children Collection', + meta: { + repositoryAlias: UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS, + }, + }, + ...viewManifests, + ...repositoryManifests, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/constants.ts new file mode 100644 index 0000000000..1c27827076 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/constants.ts @@ -0,0 +1,2 @@ +export const UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS = + 'Umb.Repository.MediaType.TreeItemChildrenCollection'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/index.ts new file mode 100644 index 0000000000..4f07201dcf --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/index.ts @@ -0,0 +1 @@ +export * from './constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/manifests.ts new file mode 100644 index 0000000000..d699e11912 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/manifests.ts @@ -0,0 +1,10 @@ +import { UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS } from './constants.js'; + +export const manifests: Array = [ + { + type: 'repository', + alias: UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS, + name: 'Media Type Tree Item Children Collection Repository', + api: () => import('./media-type-tree-item-children-collection.repository.js'), + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/media-type-tree-item-children-collection.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/media-type-tree-item-children-collection.repository.ts new file mode 100644 index 0000000000..a6051a075e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/repository/media-type-tree-item-children-collection.repository.ts @@ -0,0 +1,33 @@ +import UmbMediaTypeTreeRepository from '../../../media-type-tree.repository.js'; +import type { UmbCollectionFilterModel, UmbCollectionRepository } from '@umbraco-cms/backoffice/collection'; +import { UmbRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import { UMB_ENTITY_CONTEXT, type UmbEntityModel } from '@umbraco-cms/backoffice/entity'; + +export class UmbMediaTypeTreeItemChildrenCollectionRepository + extends UmbRepositoryBase + implements UmbCollectionRepository +{ + #treeRepository = new UmbMediaTypeTreeRepository(this); + + async requestCollection(filter: UmbCollectionFilterModel) { + // TODO: get parent from args + const entityContext = await this.getContext(UMB_ENTITY_CONTEXT); + if (!entityContext) throw new Error('Entity context not found'); + + const entityType = entityContext.getEntityType(); + const unique = entityContext.getUnique(); + + if (!entityType) throw new Error('Entity type not found'); + if (unique === undefined) throw new Error('Unique not found'); + + const parent: UmbEntityModel = { entityType, unique }; + + if (parent.unique === null) { + return this.#treeRepository.requestTreeRootItems({ skip: filter.skip, take: filter.take }); + } else { + return this.#treeRepository.requestTreeItemsOf({ parent, skip: filter.skip, take: filter.take }); + } + } +} + +export { UmbMediaTypeTreeItemChildrenCollectionRepository as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/types.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/types.ts new file mode 100644 index 0000000000..7931d6531e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/types.ts @@ -0,0 +1,6 @@ +import type { UmbCollectionFilterModel } from '@umbraco-cms/backoffice/collection'; +import type { UmbEntityModel } from '@umbraco-cms/backoffice/entity'; + +export interface UmbMediaTypeTreeItemChildrenCollectionFilterModel extends UmbCollectionFilterModel { + parent: UmbEntityModel; +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/manifests.ts new file mode 100644 index 0000000000..2bb05e5809 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/manifests.ts @@ -0,0 +1,23 @@ +import { UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS } from '../constants.js'; +import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; + +export const manifests: Array = [ + { + type: 'collectionView', + alias: 'Umb.CollectionView.MediaType.TreeItem.Table', + name: 'Media Type Tree Item Table Collection View', + element: () => import('./media-type-tree-item-table-collection-view.element.js'), + weight: 300, + meta: { + label: 'Table', + icon: 'icon-list', + pathName: 'table', + }, + conditions: [ + { + alias: UMB_COLLECTION_ALIAS_CONDITION, + match: UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS, + }, + ], + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/media-type-tree-item-table-collection-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/media-type-tree-item-table-collection-view.element.ts new file mode 100644 index 0000000000..439728ef92 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/collection/views/media-type-tree-item-table-collection-view.element.ts @@ -0,0 +1,126 @@ +import type { UmbMediaTypeTreeItemModel } from '../../../types.js'; +import { UMB_EDIT_MEDIA_TYPE_WORKSPACE_PATH_PATTERN } from '../../../../paths.js'; +import { UMB_EDIT_MEDIA_TYPE_FOLDER_WORKSPACE_PATH_PATTERN } from '../../../folder/workspace/paths.js'; +import type { UmbDefaultCollectionContext } from '@umbraco-cms/backoffice/collection'; +import { UMB_COLLECTION_CONTEXT } from '@umbraco-cms/backoffice/collection'; +import type { UmbTableColumn, UmbTableConfig, UmbTableItem } from '@umbraco-cms/backoffice/components'; +import { css, html, customElement, state } from '@umbraco-cms/backoffice/external/lit'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; +import { UmbModalRouteRegistrationController, type UmbModalRouteBuilder } from '@umbraco-cms/backoffice/router'; +import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace'; + +@customElement('umb-media-type-tree-item-table-collection-view') +export class UmbMediaTypeTreeItemTableCollectionViewElement extends UmbLitElement { + @state() + private _tableConfig: UmbTableConfig = { + allowSelection: false, + }; + + @state() + private _tableColumns: Array = [ + { + name: 'Name', + alias: 'name', + }, + { + name: '', + alias: 'entityActions', + }, + ]; + + @state() + private _tableItems: Array = []; + + #collectionContext?: UmbDefaultCollectionContext; + #routeBuilder?: UmbModalRouteBuilder; + + constructor() { + super(); + + this.consumeContext(UMB_COLLECTION_CONTEXT, (instance) => { + this.#collectionContext = instance; + }); + + this.#registerModalRoute(); + } + + #registerModalRoute() { + new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL) + .addAdditionalPath(':entityType') + .onSetup((params) => { + return { data: { entityType: params.entityType, preset: {} } }; + }) + .observeRouteBuilder((routeBuilder) => { + this.#routeBuilder = routeBuilder; + + // NOTE: Configuring the observations AFTER the route builder is ready, + // otherwise there is a race condition and `#collectionContext.items` tends to win. [LK] + this.#observeCollectionItems(); + }); + } + + #observeCollectionItems() { + if (!this.#collectionContext) return; + this.observe(this.#collectionContext.items, (items) => this.#createTableItems(items), 'umbCollectionItemsObserver'); + } + + #createTableItems(items: Array) { + const routeBuilder = this.#routeBuilder; + if (!routeBuilder) throw new Error('Route builder not ready'); + + this._tableItems = items.map((item) => { + const modalEditPath = + routeBuilder({ entityType: item.entityType }) + + UMB_EDIT_MEDIA_TYPE_WORKSPACE_PATH_PATTERN.generateLocal({ unique: item.unique }); + const inlineEditPath = UMB_EDIT_MEDIA_TYPE_FOLDER_WORKSPACE_PATH_PATTERN.generateAbsolute({ + unique: item.unique, + }); + + return { + id: item.unique, + icon: item.isFolder && !item.icon ? 'icon-folder' : item.icon, + data: [ + { + columnAlias: 'name', + value: html``, + }, + { + columnAlias: 'entityActions', + value: html``, + }, + ], + }; + }); + } + + override render() { + return html` + + `; + } + + static override styles = [ + UmbTextStyles, + css` + :host { + display: flex; + flex-direction: column; + } + `, + ]; +} + +export { UmbMediaTypeTreeItemTableCollectionViewElement as element }; + +declare global { + interface HTMLElementTagNameMap { + 'umb-media-type-tree-item-table-collection-view': UmbMediaTypeTreeItemTableCollectionViewElement; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/constants.ts new file mode 100644 index 0000000000..d7b529d49c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/constants.ts @@ -0,0 +1 @@ +export * from './collection/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/manifests.ts new file mode 100644 index 0000000000..6636c42e15 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/tree/tree-item-children/manifests.ts @@ -0,0 +1,37 @@ +import { + UMB_MEDIA_TYPE_ENTITY_TYPE, + UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE, + UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, +} from '../../entity.js'; +import { UMB_MEDIA_TYPE_ROOT_WORKSPACE_ALIAS } from '../../media-type-root/constants.js'; +import { UMB_MEDIA_TYPE_FOLDER_WORKSPACE_ALIAS } from '../folder/constants.js'; +import { manifests as collectionManifests } from './collection/manifests.js'; + +export const manifests: Array = [ + { + type: 'entityAction', + kind: 'reloadTreeItemChildren', + alias: 'Umb.EntityAction.MediaType.Tree.ReloadChildrenOf', + name: 'Reload Media Type Tree Item Children Entity Action', + forEntityTypes: [UMB_MEDIA_TYPE_ENTITY_TYPE, UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE, UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE], + }, + { + type: 'workspaceView', + kind: 'collection', + alias: 'Umb.WorkspaceView.MediaType.TreeItemChildrenCollection', + name: 'Media Type Tree Item Children Collection Workspace View', + meta: { + label: 'Folder', + pathname: 'folder', + icon: 'icon-folder', + collectionAlias: 'Umb.Collection.MediaType.TreeItemChildren', + }, + conditions: [ + { + alias: 'Umb.Condition.WorkspaceAlias', + oneOf: [UMB_MEDIA_TYPE_ROOT_WORKSPACE_ALIAS, UMB_MEDIA_TYPE_FOLDER_WORKSPACE_ALIAS], + }, + ], + }, + ...collectionManifests, +]; diff --git a/src/Umbraco.Web.UI.Client/utils/all-umb-consts/index.ts b/src/Umbraco.Web.UI.Client/utils/all-umb-consts/index.ts index 35157ef14c..f9ee9112d0 100644 --- a/src/Umbraco.Web.UI.Client/utils/all-umb-consts/index.ts +++ b/src/Umbraco.Web.UI.Client/utils/all-umb-consts/index.ts @@ -208,7 +208,7 @@ export const foundConsts = [{ }, { path: '@umbraco-cms/backoffice/media-type', - consts: ["UMB_MEDIA_TYPE_CREATE_OPTIONS_MODAL","UMB_DUPLICATE_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_EXPORT_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_IMPORT_MODAL","UMB_MEDIA_TYPE_IMPORT_REPOSITORY_ALIAS","UMB_MOVE_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_ENTITY_TYPE","UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE","UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE","UMB_MEDIA_TYPE_COMPOSITION_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_DETAIL_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_DETAIL_STORE_ALIAS","UMB_MEDIA_TYPE_DETAIL_STORE_CONTEXT","UMB_MEDIA_TYPE_ITEM_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_ITEM_STORE_ALIAS","UMB_MEDIA_TYPE_ITEM_STORE_CONTEXT","UMB_MEDIA_TYPE_STRUCTURE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_TREE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_TREE_STORE_ALIAS","UMB_MEDIA_TYPE_TREE_ALIAS","UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_FOLDER_STORE_ALIAS","UMB_MEDIA_TYPE_FOLDER_STORE_CONTEXT","UMB_MEDIA_TYPE_FOLDER_WORKSPACE_ALIAS","UMB_MEDIA_TYPE_FOLDER_WORKSPACE_CONTEXT","UMB_MEDIA_TYPE_PICKER_MODAL","UMB_MEDIA_TYPE_TREE_STORE_CONTEXT","UMB_MEDIA_TYPE_WORKSPACE_ALIAS","UMB_MEDIA_TYPE_WORKSPACE_CONTEXT"] + consts: ["UMB_MEDIA_TYPE_CREATE_OPTIONS_MODAL","UMB_DUPLICATE_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_EXPORT_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_IMPORT_MODAL","UMB_MEDIA_TYPE_IMPORT_REPOSITORY_ALIAS","UMB_MOVE_MEDIA_TYPE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_ENTITY_TYPE","UMB_MEDIA_TYPE_ROOT_ENTITY_TYPE","UMB_MEDIA_TYPE_FOLDER_ENTITY_TYPE","UMB_MEDIA_TYPE_ROOT_WORKSPACE_ALIAS","UMB_MEDIA_TYPE_WORKSPACE_PATH","UMB_MEDIA_TYPE_ROOT_WORKSPACE_PATH","UMB_CREATE_MEDIA_TYPE_WORKSPACE_PATH_PATTERN","UMB_EDIT_MEDIA_TYPE_WORKSPACE_PATH_PATTERN","UMB_MEDIA_TYPE_COMPOSITION_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_DETAIL_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_DETAIL_STORE_ALIAS","UMB_MEDIA_TYPE_DETAIL_STORE_CONTEXT","UMB_MEDIA_TYPE_ITEM_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_ITEM_STORE_ALIAS","UMB_MEDIA_TYPE_ITEM_STORE_CONTEXT","UMB_MEDIA_TYPE_STRUCTURE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_TREE_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_TREE_STORE_ALIAS","UMB_MEDIA_TYPE_TREE_ALIAS","UMB_MEDIA_TYPE_FOLDER_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_FOLDER_STORE_ALIAS","UMB_MEDIA_TYPE_FOLDER_STORE_CONTEXT","UMB_MEDIA_TYPE_FOLDER_WORKSPACE_ALIAS","UMB_MEDIA_TYPE_FOLDER_WORKSPACE_CONTEXT","UMB_MEDIA_TYPE_FOLDER_WORKSPACE_PATH","UMB_EDIT_MEDIA_TYPE_FOLDER_WORKSPACE_PATH_PATTERN","UMB_MEDIA_TYPE_PICKER_MODAL","UMB_MEDIA_TYPE_TREE_STORE_CONTEXT","UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_ALIAS","UMB_MEDIA_TYPE_TREE_ITEM_CHILDREN_COLLECTION_REPOSITORY_ALIAS","UMB_MEDIA_TYPE_WORKSPACE_ALIAS","UMB_MEDIA_TYPE_WORKSPACE_CONTEXT"] }, { path: '@umbraco-cms/backoffice/media',