update entity action to new interface
This commit is contained in:
@@ -14,9 +14,9 @@ export const manifest: UmbBackofficeManifestKind = {
|
||||
meta: {
|
||||
icon: 'icon-edit',
|
||||
label: 'Rename...',
|
||||
itemRepositoryAlias: '',
|
||||
renameRepositoryAlias: '',
|
||||
entityTypes: [],
|
||||
renameRepositoryAlias: '',
|
||||
itemRepositoryAlias: '',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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<ManifestTypes> = [
|
||||
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],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -4,18 +4,18 @@ import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal';
|
||||
|
||||
export class UmbStylesheetCreateOptionsEntityAction extends UmbEntityActionBase<never> {
|
||||
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 {}
|
||||
}
|
||||
|
||||
@@ -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<ManifestTypes> = [
|
||||
meta: {
|
||||
icon: 'icon-add',
|
||||
label: 'Create...',
|
||||
repositoryAlias: UMB_STYLESHEET_DETAIL_REPOSITORY_ALIAS,
|
||||
entityTypes: [UMB_STYLESHEET_ROOT_ENTITY_TYPE, UMB_STYLESHEET_FOLDER_ENTITY_TYPE],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user