diff --git a/src/Umbraco.Web.UI.Client/examples/entity-content-type-condition/index.ts b/src/Umbraco.Web.UI.Client/examples/entity-content-type-condition/index.ts index ac4a90f48a..43cc3a71a3 100644 --- a/src/Umbraco.Web.UI.Client/examples/entity-content-type-condition/index.ts +++ b/src/Umbraco.Web.UI.Client/examples/entity-content-type-condition/index.ts @@ -1,3 +1,5 @@ +import { UMB_WORKSPACE_CONTENT_TYPE_ALIAS_CONDITION_ALIAS } from '@umbraco-cms/backoffice/content-type'; + const workspace: UmbExtensionManifest = { type: 'workspaceView', alias: 'Example.WorkspaceView.EntityContentTypeCondition', @@ -10,7 +12,7 @@ const workspace: UmbExtensionManifest = { }, conditions: [ { - alias: 'Umb.Condition.WorkspaceContentTypeAlias', + alias: UMB_WORKSPACE_CONTENT_TYPE_ALIAS_CONDITION_ALIAS, //match : 'blogPost' oneOf: ['blogPost', 'mediaType1'], }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/constants.ts new file mode 100644 index 0000000000..0bf665f771 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/constants.ts @@ -0,0 +1,4 @@ +/** + * Workspace Content Type Alias condition alias + */ +export const UMB_WORKSPACE_CONTENT_TYPE_ALIAS_CONDITION_ALIAS = 'Umb.Condition.WorkspaceContentTypeAlias'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/types.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/types.ts index 9ad295ee57..e892e9cc31 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/types.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/conditions/types.ts @@ -1,20 +1,22 @@ +import type { UMB_WORKSPACE_CONTENT_TYPE_ALIAS_CONDITION_ALIAS } from './constants.js'; import type { UmbConditionConfigBase } from '@umbraco-cms/backoffice/extension-api'; -export type UmbWorkspaceContentTypeAliasConditionConfig = - UmbConditionConfigBase<'Umb.Condition.WorkspaceContentTypeAlias'> & { - /** - * Define a content type alias in which workspace this extension should be available - * @example - * Depends on implementation, but i.e. "article", "image", "blockPage" - */ - match?: string; - /** - * Define one or more content type aliases in which workspace this extension should be available - * @example - * ["article", "image", "blockPage"] - */ - oneOf?: Array; - }; +export type UmbWorkspaceContentTypeAliasConditionConfig = UmbConditionConfigBase< + typeof UMB_WORKSPACE_CONTENT_TYPE_ALIAS_CONDITION_ALIAS +> & { + /** + * Define a content type alias in which workspace this extension should be available + * @example + * Depends on implementation, but i.e. "article", "image", "blockPage" + */ + match?: string; + /** + * Define one or more content type aliases in which workspace this extension should be available + * @example + * ["article", "image", "blockPage"] + */ + oneOf?: Array; +}; /** * @deprecated Use `UmbWorkspaceContentTypeAliasConditionConfig` instead. This will be removed in Umbraco 17. */ diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/constants.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/constants.ts index a9382bfee1..3d9d65e4f0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/constants.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/constants.ts @@ -1,2 +1,3 @@ export * from './modals/constants.js'; export * from './workspace/constants.js'; +export * from './conditions/constants.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/types.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/types.ts index 8622e3fd9d..4364ef2e5b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/types.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/types.ts @@ -2,6 +2,7 @@ import type { CompositionTypeModel } from '@umbraco-cms/backoffice/external/back import type { UmbReferenceByUnique } from '@umbraco-cms/backoffice/models'; export type * from './composition/types.js'; +export type * from './conditions/types.js'; export type UmbPropertyContainerTypes = 'Group' | 'Tab';