From cbaf00cdd92b3efdb973babc4f461ef473ed5d33 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Sun, 3 Mar 2024 17:09:43 +0100 Subject: [PATCH] update entity action to new interface --- .../entity-action/common/rename/rename.action.kind.ts | 4 ++-- .../partial-views/entity-actions/rename/manifests.ts | 10 ++++------ .../stylesheets/entity-actions/create/create.action.ts | 8 ++++---- .../stylesheets/entity-actions/create/manifests.ts | 2 -- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/rename/rename.action.kind.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/rename/rename.action.kind.ts index 16ad92d5d5..583a7099a6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/rename/rename.action.kind.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-action/common/rename/rename.action.kind.ts @@ -14,9 +14,9 @@ export const manifest: UmbBackofficeManifestKind = { meta: { icon: 'icon-edit', label: 'Rename...', - itemRepositoryAlias: '', - renameRepositoryAlias: '', entityTypes: [], + renameRepositoryAlias: '', + itemRepositoryAlias: '', }, }, }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/rename/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/rename/manifests.ts index d7677095e0..fba1c4c177 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/rename/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/rename/manifests.ts @@ -1,5 +1,5 @@ import { UMB_PARTIAL_VIEW_ENTITY_TYPE } from '../../entity.js'; -import { UmbRenameEntityAction } from '@umbraco-cms/backoffice/entity-action'; +import { UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS } from '../../repository/item/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const UMB_RENAME_PARTIAL_VIEW_REPOSITORY_ALIAS = 'Umb.Repository.PartialView.Rename'; @@ -16,12 +16,10 @@ export const manifests: Array = [ type: 'entityAction', alias: UMB_RENAME_PARTIAL_VIEW_ENTITY_ACTION_ALIAS, name: 'Rename PartialView Entity Action', - api: UmbRenameEntityAction, - weight: 200, + kind: 'rename', meta: { - icon: 'icon-edit', - label: 'Rename...', - repositoryAlias: UMB_RENAME_PARTIAL_VIEW_REPOSITORY_ALIAS, + renameRepositoryAlias: UMB_RENAME_PARTIAL_VIEW_REPOSITORY_ALIAS, + itemRepositoryAlias: UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS, entityTypes: [UMB_PARTIAL_VIEW_ENTITY_TYPE], }, }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts index d048a9e836..8ae239a7ad 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts @@ -4,18 +4,18 @@ import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; export class UmbStylesheetCreateOptionsEntityAction extends UmbEntityActionBase { async execute() { - if (!this.repository) throw new Error('Repository is not available'); - const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT); const modalContext = modalManager.open(this, UMB_STYLESHEET_CREATE_OPTIONS_MODAL, { data: { parent: { - unique: this.unique, - entityType: this.entityType, + unique: this.args.unique, + entityType: this.args.entityType, }, }, }); await modalContext.onSubmit(); } + + destroy(): void {} } diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts index 92148b8548..41ae64fd2d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts @@ -1,5 +1,4 @@ import { UMB_STYLESHEET_FOLDER_ENTITY_TYPE, UMB_STYLESHEET_ROOT_ENTITY_TYPE } from '../../entity.js'; -import { UMB_STYLESHEET_DETAIL_REPOSITORY_ALIAS } from '../../repository/manifests.js'; import { UmbStylesheetCreateOptionsEntityAction } from './create.action.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; @@ -13,7 +12,6 @@ export const manifests: Array = [ meta: { icon: 'icon-add', label: 'Create...', - repositoryAlias: UMB_STYLESHEET_DETAIL_REPOSITORY_ALIAS, entityTypes: [UMB_STYLESHEET_ROOT_ENTITY_TYPE, UMB_STYLESHEET_FOLDER_ENTITY_TYPE], }, },