From 170a813010ac6c6b0d3557d3a6eb16990e9fe8b8 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 29 Oct 2024 22:02:22 +0100 Subject: [PATCH] add default kind --- .../create-option-action/default/index.ts | 1 + .../create-option-action/default/manifests.ts | 18 +++++++ .../create-option-action/default/types.ts | 52 +++++++++++++++++++ .../create/create-option-action/index.ts | 1 + .../create/create-option-action/manifests.ts | 3 ++ 5 files changed, 75 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts new file mode 100644 index 0000000000..d4702960d5 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/index.ts @@ -0,0 +1 @@ +export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts new file mode 100644 index 0000000000..1aa548f357 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/manifests.ts @@ -0,0 +1,18 @@ +export const manifests = [ + { + type: 'kind', + alias: 'Umb.Kind.EntityCreateOptionAction.Default', + matchKind: 'default', + matchType: 'entityCreateOptionAction', + manifest: { + type: 'entityCreateOptionAction', + kind: 'default', + weight: 1000, + meta: { + icon: '', + label: 'Fill out label', + description: 'Fill out description', + }, + }, + }, +]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts new file mode 100644 index 0000000000..f131c65468 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/default/types.ts @@ -0,0 +1,52 @@ +import type { + ManifestEntityCreateOptionAction, + MetaEntityCreateOptionAction, +} from '../entity-create-option-action.extension.js'; + +export interface ManifestEntityCreateOptionActionDefaultKind + extends ManifestEntityCreateOptionAction { + type: 'entityCreateOptionAction'; + kind: 'default'; +} + +export interface MetaEntityCreateOptionActionDefaultKind extends MetaEntityCreateOptionAction { + /** + * An icon to represent the action to be performed + * @examples [ + * "icon-box", + * "icon-grid" + * ] + */ + icon: string; + + /** + * The friendly name of the action to perform + * @examples [ + * "Create with Template", + * "Create from Blueprint" + * ] + */ + label: string; + + /** + * A description of the action to be performed + * @examples [ + * "Create a document type with a template", + * "Create a document from a blueprint" + * ] + */ + description: string; + + /** + * The action requires additional input from the user. + * A dialog will prompt the user for more information or to make a choice. + * @type {boolean} + */ + additionalOptions?: boolean; +} + +declare global { + interface UmbExtensionManifestMap { + umbDefaultEntityCreateOptionActionKind: ManifestEntityCreateOptionActionDefaultKind; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts index 1794649010..3134f695a1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/index.ts @@ -1,3 +1,4 @@ +export * from './default/index.js'; export * from './entity-create-option-action-base.js'; export * from './entity-create-option-action.extension.js'; export * from './entity-create-option-action.interface.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts new file mode 100644 index 0000000000..a61fc1b883 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/create/create-option-action/manifests.ts @@ -0,0 +1,3 @@ +import { manifests as defaultManifests } from './default/manifests.js'; + +export const manifests = [...defaultManifests];