From ffc3778b6bb2979f19a6a3ffb8ce663ad7475a84 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 21 Nov 2023 22:08:24 +0100 Subject: [PATCH] register user group collection --- .../user/user-group/collection/index.ts | 1 + .../user/user-group/collection/manifests.ts | 19 +++++++++++++++++-- .../entity-bulk-actions/manifests.ts | 8 ++++---- .../stories/extending/entity-actions.mdx | 4 ++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts index 3d76f338dd..3d9a00e23f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/index.ts @@ -1 +1,2 @@ export * from './repository/index.js'; +export { UMB_USER_GROUP_COLLECTION_ALIAS } from './manifests.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts index 4e1826b900..f70c1adeb5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/collection/manifests.ts @@ -1,3 +1,18 @@ -import { manifests as repositoryManifests } from './repository/manifests.js'; +import { + UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS, + manifests as repositoryManifests, +} from './repository/manifests.js'; +import { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests = [...repositoryManifests]; +export const UMB_USER_GROUP_COLLECTION_ALIAS = 'Umb.Collection.UserGroup'; +const collection: ManifestTypes = { + type: 'collection', + kind: 'default', + alias: UMB_USER_GROUP_COLLECTION_ALIAS, + name: 'User Group Collection', + meta: { + repositoryAlias: UMB_USER_GROUP_COLLECTION_REPOSITORY_ALIAS, + }, +}; + +export const manifests = [collection, ...repositoryManifests]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts index a962d1b1f5..5dff5930b7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/entity-bulk-actions/manifests.ts @@ -1,9 +1,9 @@ +import { UMB_USER_GROUP_COLLECTION_ALIAS } from '../collection/index.js'; import { UMB_USER_GROUP_REPOSITORY_ALIAS } from '../repository/manifests.js'; import { UmbDeleteUserGroupEntityBulkAction } from './delete/delete.action.js'; +import { UMB_COLLECTION_ALIAS_CONDITION } from '@umbraco-cms/backoffice/collection'; import type { ManifestEntityBulkAction } from '@umbraco-cms/backoffice/extension-registry'; -const entityType = 'user-group'; - const entityActions: Array = [ { type: 'entityBulkAction', @@ -17,8 +17,8 @@ const entityActions: Array = [ }, conditions: [ { - alias: 'Umb.Condition.CollectionEntityType', - match: entityType, + alias: UMB_COLLECTION_ALIAS_CONDITION, + match: UMB_USER_GROUP_COLLECTION_ALIAS, }, ], }, diff --git a/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx b/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx index d60b5d1bf2..298ec0ed24 100644 --- a/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx +++ b/src/Umbraco.Web.UI.Client/storybook/stories/extending/entity-actions.mdx @@ -185,8 +185,8 @@ const manifest = { repositoryAlias: 'My.Repository', }, conditions: [{ - alias: 'Umb.Condition.CollectionEntityType', - match: 'my-entity-type', + alias: 'Umb.Condition.CollectionAlias', + match: 'my-collection-alias', }], };