entity-action

This commit is contained in:
Niels Lyngsø
2023-10-09 13:16:02 +02:00
parent cc01d52111
commit d760a24873
25 changed files with 70 additions and 72 deletions

View File

@@ -1,10 +1,10 @@
import { hasApiExport, hasDefaultExport, isManifestClassConstructorType } from './type-guards/index.js';
import type { ManifestApi, ClassConstructor } from './types.js';
import type { ManifestApi, ClassConstructor, ManifestElementAndApi } from './types.js';
import { loadExtensionApi } from './load-extension-api.function.js';
//TODO: Write tests for this method:
export async function createExtensionApi<ApiType = unknown>(
manifest: ManifestApi,
manifest: ManifestApi | ManifestElementAndApi,
constructorArguments: unknown[]
): Promise<ApiType | undefined> {
const js = await loadExtensionApi(manifest);

View File

@@ -3,6 +3,7 @@ import { UUIMenuItemEvent } from '@umbraco-cms/backoffice/external/uui';
import { UmbExecutedEvent } from '@umbraco-cms/backoffice/events';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { ManifestEntityAction } from '@umbraco-cms/backoffice/extension-registry';
import { createExtensionApi } from '@umbraco-cms/backoffice/extension-api';
@customElement('umb-entity-action')
export class UmbEntityActionElement extends UmbLitElement {
@@ -36,10 +37,10 @@ export class UmbEntityActionElement extends UmbLitElement {
}
async #createApi() {
if (!this._manifest?.meta.api) return;
if (!this._manifest) return;
if (this._unique === undefined) return;
// TODO: Could we provide the manifest to the api constructor? instead, to enable more flexibility. Mainly cause some actions knows their repository. some does not need a repository?
this.#api = new this._manifest.meta.api(this, this._manifest.meta.repositoryAlias, this.unique);
this.#api = createExtensionApi(this._manifest, [this._manifest.meta.repositoryAlias, this.unique]);
// TODO: Fix so when we use a HREF it does not refresh the page?
this._href = await this.#api.getHref?.();
@@ -68,7 +69,7 @@ export class UmbEntityActionElement extends UmbLitElement {
return html`
<uui-menu-item
label=${ifDefined(this._manifest?.meta.label)}
href=${this._href}
href=${ifDefined(this._href)}
@click-label=${this.#onClickLabel}
@click=${this.#onClick}>
${this._manifest?.meta.icon

View File

@@ -1,10 +1,11 @@
import type { ManifestElement, ManifestWithDynamicConditions } from '@umbraco-cms/backoffice/extension-api';
import type { ManifestElementAndApi, ManifestWithDynamicConditions } from '@umbraco-cms/backoffice/extension-api';
/**
* An action to perform on an entity
* For example for content you may wish to create a new document etc
*/
export interface ManifestEntityAction extends ManifestElement, ManifestWithDynamicConditions {
// TODO: create interface for API
export interface ManifestEntityAction extends ManifestElementAndApi, ManifestWithDynamicConditions {
type: 'entityAction';
meta: MetaEntityAction;
}
@@ -31,17 +32,13 @@ export interface MetaEntityAction {
label: string;
/**
* @TJS-ignore
*/
api: any; // TODO: create interface
/**
* The alias for the repsoitory of the entity type this action is for
* The alias for the repository of the entity type this action is for
* such as 'Umb.Repository.Documents'
* @examples [
* "Umb.Repository.Documents"
* ]
*/
// TODO: Could we find the repository based on entityTypes?
repositoryAlias: string;
/**

View File

@@ -15,11 +15,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Create',
name: 'Create Dictionary Entity Action',
weight: 600,
api: UmbCreateDictionaryEntityAction,
meta: {
icon: 'umb:add',
label: 'Create',
repositoryAlias,
api: UmbCreateDictionaryEntityAction,
entityTypes: [entityType],
},
},
@@ -28,11 +28,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Move',
name: 'Move Dictionary Entity Action',
weight: 500,
api: UmbMoveEntityAction,
meta: {
icon: 'umb:enter',
label: 'Move',
repositoryAlias,
api: UmbMoveEntityAction,
entityTypes: [entityType],
},
},
@@ -41,11 +41,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Export',
name: 'Export Dictionary Entity Action',
weight: 400,
api: UmbExportDictionaryEntityAction,
meta: {
icon: 'umb:download-alt',
label: 'Export',
repositoryAlias,
api: UmbExportDictionaryEntityAction,
entityTypes: [entityType],
},
},
@@ -54,11 +54,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Import',
name: 'Import Dictionary Entity Action',
weight: 300,
api: UmbImportDictionaryEntityAction,
meta: {
icon: 'umb:page-up',
label: 'Import',
repositoryAlias,
api: UmbImportDictionaryEntityAction,
entityTypes: [entityType],
},
},
@@ -67,11 +67,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Reload',
name: 'Reload Dictionary Entity Action',
weight: 200,
api: UmbReloadDictionaryEntityAction,
meta: {
icon: 'umb:refresh',
label: 'Reload',
repositoryAlias,
api: UmbReloadDictionaryEntityAction,
entityTypes: [entityType],
},
},
@@ -80,11 +80,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Dictionary.Delete',
name: 'Delete Dictionary Entity Action',
weight: 100,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
repositoryAlias,
api: UmbDeleteEntityAction,
entityTypes: [entityType],
},
},

View File

@@ -13,11 +13,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.DocumentType.Create',
name: 'Create Document Type Entity Action',
weight: 1000,
api: UmbCreateDataTypeEntityAction,
meta: {
icon: 'umb:add',
label: 'Create...',
repositoryAlias: DOCUMENT_TYPE_REPOSITORY_ALIAS,
api: UmbCreateDataTypeEntityAction,
entityTypes: [DOCUMENT_TYPE_ENTITY_TYPE, DOCUMENT_TYPE_ROOT_ENTITY_TYPE, DOCUMENT_TYPE_FOLDER_ENTITY_TYPE],
},
},

View File

@@ -16,11 +16,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DocumentType.Delete',
name: 'Delete Document-Type Entity Action',
weight: 900,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
repositoryAlias: DOCUMENT_TYPE_REPOSITORY_ALIAS,
api: UmbDeleteEntityAction,
entityTypes: [entityType],
},
},
@@ -29,11 +29,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DocumentType.Move',
name: 'Move Document-Type Entity Action',
weight: 700,
api: UmbMoveEntityAction,
meta: {
icon: 'umb:enter',
label: 'Move',
repositoryAlias: DOCUMENT_TYPE_REPOSITORY_ALIAS,
api: UmbMoveEntityAction,
entityTypes: [entityType],
},
},
@@ -42,11 +42,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DocumentType.Copy',
name: 'Copy Document-Type Entity Action',
weight: 600,
api: UmbCopyEntityAction,
meta: {
icon: 'umb:documents',
label: 'Copy',
repositoryAlias: DOCUMENT_TYPE_REPOSITORY_ALIAS,
api: UmbCopyEntityAction,
entityTypes: [entityType],
},
},
@@ -55,11 +55,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DocumentType.Sort',
name: 'Sort Document-Type Entity Action',
weight: 500,
api: UmbSortChildrenOfEntityAction,
meta: {
icon: 'umb:navigation-vertical',
label: 'Sort',
repositoryAlias: DOCUMENT_TYPE_REPOSITORY_ALIAS,
api: UmbSortChildrenOfEntityAction,
entityTypes: [entityType],
},
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Document.Create',
name: 'Create Document Entity Action',
weight: 1000,
api: UmbCreateDocumentEntityAction,
meta: {
icon: 'umb:add',
label: 'Create',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbCreateDocumentEntityAction,
entityTypes: [DOCUMENT_ROOT_ENTITY_TYPE, DOCUMENT_ENTITY_TYPE],
},
conditions: [

View File

@@ -22,11 +22,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.Document.CreateBlueprint',
name: 'Create Document Blueprint Entity Action',
weight: 800,
api: UmbCreateDocumentBlueprintEntityAction,
meta: {
icon: 'umb:blueprint',
label: 'Create Document Blueprint (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbCreateDocumentBlueprintEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -35,11 +35,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.Document.Move',
name: 'Move Document Entity Action ',
weight: 700,
api: UmbMoveEntityAction,
meta: {
icon: 'umb:enter',
label: 'Move (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbMoveEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -48,11 +48,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.Document.Copy',
name: 'Copy Document Entity Action',
weight: 600,
api: UmbCopyEntityAction,
meta: {
icon: 'umb:documents',
label: 'Copy (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbCopyEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -61,11 +61,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.Document.Sort',
name: 'Sort Document Entity Action',
weight: 500,
api: UmbSortChildrenOfEntityAction,
meta: {
icon: 'umb:navigation-vertical',
label: 'Sort (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbSortChildrenOfEntityAction,
entityTypes: [DOCUMENT_ROOT_ENTITY_TYPE, DOCUMENT_ENTITY_TYPE],
},
},
@@ -74,11 +74,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.Document.CultureAndHostnames',
name: 'Culture And Hostnames Document Entity Action',
weight: 400,
api: UmbDocumentCultureAndHostnamesEntityAction,
meta: {
icon: 'umb:home',
label: 'Culture And Hostnames (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbDocumentCultureAndHostnamesEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -86,11 +86,11 @@ const entityActions: Array<ManifestTypes> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Document.Permissions',
name: 'Document Permissions Entity Action',
api: UmbDocumentPermissionsEntityAction,
meta: {
icon: 'umb:vcard',
label: 'Permissions (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbDocumentPermissionsEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -98,11 +98,11 @@ const entityActions: Array<ManifestTypes> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Document.PublicAccess',
name: 'Document Permissions Entity Action',
api: UmbDocumentPublicAccessEntityAction,
meta: {
icon: 'umb:lock',
label: 'Public Access (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbDocumentPublicAccessEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -110,11 +110,11 @@ const entityActions: Array<ManifestTypes> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Document.Publish',
name: 'Publish Document Entity Action',
api: UmbPublishDocumentEntityAction,
meta: {
icon: 'umb:globe',
label: 'Publish (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbPublishDocumentEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -122,11 +122,11 @@ const entityActions: Array<ManifestTypes> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Document.Unpublish',
name: 'Unpublish Document Entity Action',
api: UmbUnpublishDocumentEntityAction,
meta: {
icon: 'umb:globe',
label: 'Unpublish (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbUnpublishDocumentEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},
@@ -134,11 +134,11 @@ const entityActions: Array<ManifestTypes> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Document.Rollback',
name: 'Rollback Document Entity Action',
api: UmbRollbackDocumentEntityAction,
meta: {
icon: 'umb:undo',
label: 'Rollback (TBD)',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbRollbackDocumentEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
},

View File

@@ -8,11 +8,11 @@ export const manifests = [
alias: 'Umb.EntityAction.Document.Trash',
name: 'Trash Document Entity Action',
weight: 900,
api: UmbTrashEntityAction,
meta: {
icon: 'umb:trash',
label: 'Trash',
repositoryAlias: DOCUMENT_REPOSITORY_ALIAS,
api: UmbTrashEntityAction,
entityTypes: [DOCUMENT_ENTITY_TYPE],
},
conditions: [

View File

@@ -13,11 +13,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MediaType.Create',
name: 'Create Media Type Entity Action',
weight: 500,
api: UmbCreateMediaTypeEntityAction,
meta: {
icon: 'umb:add',
label: 'Create',
repositoryAlias,
api: UmbCreateMediaTypeEntityAction,
entityTypes: [entityType],
},
},
@@ -26,11 +26,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MediaType.Move',
name: 'Move Media Type Entity Action',
weight: 400,
api: UmbMoveEntityAction,
meta: {
icon: 'umb:enter',
label: 'Move',
repositoryAlias,
api: UmbMoveEntityAction,
entityTypes: [entityType],
},
},
@@ -39,11 +39,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MediaType.Copy',
name: 'Copy Media Type Entity Action',
weight: 300,
api: UmbCopyEntityAction,
meta: {
icon: 'umb:documents',
label: 'Copy',
repositoryAlias,
api: UmbCopyEntityAction,
entityTypes: [entityType],
},
},
@@ -52,11 +52,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MediaType.Delete',
name: 'Delete Media Type Entity Action',
weight: 200,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
repositoryAlias,
api: UmbDeleteEntityAction,
entityTypes: [entityType],
},
},
@@ -65,11 +65,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MediaType.Reload',
name: 'Reload Media Type Entity Action',
weight: 100,
api: UmbReloadMediaTypeEntityAction,
meta: {
icon: 'umb:refresh',
label: 'Reload',
repositoryAlias,
api: UmbReloadMediaTypeEntityAction,
entityTypes: [entityType],
},
},

View File

@@ -7,10 +7,10 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Media.Trash',
name: 'Trash Media Entity Action ',
api: UmbTrashEntityAction,
meta: {
icon: 'umb:trash',
label: 'Trash',
api: UmbTrashEntityAction,
repositoryAlias: MEDIA_REPOSITORY_ALIAS,
entityTypes: ['media'],
},

View File

@@ -7,10 +7,10 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.MemberGroup.Delete',
name: 'Delete Member Group Entity Action ',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: MEMBER_GROUP_REPOSITORY_ALIAS,
entityTypes: ['member-group'],
},

View File

@@ -11,11 +11,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.MemberType.Delete',
name: 'Delete Member Type Entity Action',
weight: 100,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
repositoryAlias,
api: UmbDeleteEntityAction,
entityTypes: [entityType],
},
},

View File

@@ -7,10 +7,10 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Member.Delete',
name: 'Delete Member Entity Action ',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: MEMBER_REPOSITORY_ALIAS,
entityTypes: ['member'],
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.DataType.Copy',
name: 'Copy Data Type Entity Action',
weight: 900,
api: UmbCopyDataTypeEntityAction,
meta: {
icon: 'umb:documents',
label: 'Copy to...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbCopyDataTypeEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE],
},
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.DataType.Create',
name: 'Create Data Type Entity Action',
weight: 1000,
api: UmbCreateDataTypeEntityAction,
meta: {
icon: 'umb:add',
label: 'Create...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbCreateDataTypeEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE, DATA_TYPE_ROOT_ENTITY_TYPE, DATA_TYPE_FOLDER_ENTITY_TYPE],
},
},

View File

@@ -17,11 +17,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DataType.Delete',
name: 'Delete Data Type Entity Action',
weight: 900,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbDeleteEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE],
},
},
@@ -30,11 +30,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DataType.DeleteFolder',
name: 'Delete Data Type Folder Entity Action',
weight: 800,
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete Folder...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbDeleteFolderEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE, DATA_TYPE_FOLDER_ENTITY_TYPE],
},
},
@@ -43,11 +43,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.DataType.RenameFolder',
name: 'Rename Data Type Folder Entity Action',
weight: 700,
api: UmbFolderUpdateEntityAction,
meta: {
icon: 'umb:edit',
label: 'Rename Folder...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbFolderUpdateEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE, DATA_TYPE_FOLDER_ENTITY_TYPE],
},
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.DataType.Move',
name: 'Move Data Type Entity Action',
weight: 900,
api: UmbMoveDataTypeEntityAction,
meta: {
icon: 'umb:enter',
label: 'Move to...',
repositoryAlias: DATA_TYPE_REPOSITORY_ALIAS,
api: UmbMoveDataTypeEntityAction,
entityTypes: [DATA_TYPE_ENTITY_TYPE],
},
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Language.Delete',
name: 'Delete Language Entity Action',
api: UmbDeleteEntityAction,
meta: {
repositoryAlias: LANGUAGE_REPOSITORY_ALIAS,
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
entityTypes: [LANGUAGE_ENTITY_TYPE],
},
},
@@ -22,11 +22,11 @@ const entityActions: Array<ManifestEntityAction> = [
alias: 'Umb.EntityAction.Language.Create',
name: 'Create Language Entity Action',
weight: 900,
api: UmbLanguageCreateEntityAction,
meta: {
icon: 'umb:add',
label: 'Create',
repositoryAlias: LANGUAGE_REPOSITORY_ALIAS,
api: UmbLanguageCreateEntityAction,
entityTypes: [LANGUAGE_ENTITY_TYPE, LANGUAGE_ROOT_ENTITY_TYPE],
},
},

View File

@@ -22,10 +22,10 @@ const partialViewActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.PartialView.Delete',
name: 'Delete PartialView Entity Action',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
entityTypes: [PARTIAL_VIEW_ENTITY_TYPE],
},
@@ -39,10 +39,10 @@ const partialViewFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.PartialViewFolder.Create.New',
name: 'Create PartialView Entity Under Directory Action',
api: UmbCreateEmptyPartialViewAction,
meta: {
icon: 'umb:article',
label: 'New empty partial view',
api: UmbCreateEmptyPartialViewAction,
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
entityTypes: [PARTIAL_VIEW_FOLDER_ENTITY_TYPE, PARTIAL_VIEW_ROOT_ENTITY_TYPE],
},
@@ -51,10 +51,10 @@ const partialViewFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.PartialViewFolder.Create.From.Snippet',
name: 'Create PartialView Entity From Snippet Under Directory Action',
api: UmbCreateFromSnippetPartialViewAction,
meta: {
icon: 'umb:article',
label: 'New partial view from snippet...',
api: UmbCreateFromSnippetPartialViewAction,
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
entityTypes: [PARTIAL_VIEW_FOLDER_ENTITY_TYPE, PARTIAL_VIEW_ROOT_ENTITY_TYPE],
},
@@ -63,10 +63,10 @@ const partialViewFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.PartialViewFolder.DeleteFolder',
name: 'Remove empty folder',
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'umb:trash',
label: 'Remove folder',
api: UmbDeleteFolderEntityAction,
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
entityTypes: [PARTIAL_VIEW_FOLDER_EMPTY_ENTITY_TYPE],
},
@@ -75,10 +75,10 @@ const partialViewFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.PartialViewFolder.CreateFolder',
name: 'Create empty folder',
api: UmbCreateFolderEntityAction,
meta: {
icon: 'umb:add',
label: 'Create folder',
api: UmbCreateFolderEntityAction,
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
entityTypes: [
PARTIAL_VIEW_FOLDER_EMPTY_ENTITY_TYPE,

View File

@@ -22,10 +22,10 @@ const scriptsViewActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: SCRIPTS_ENTITY_ACTION_DELETE_ALIAS,
name: 'Delete Scripts Entity Action',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
entityTypes: [SCRIPTS_ENTITY_TYPE],
},
@@ -37,10 +37,10 @@ const scriptsFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: SCRIPTS_ENTITY_ACTION_CREATE_NEW_ALIAS,
name: 'Create Scripts Entity Under Directory Action',
api: UmbCreateScriptAction,
meta: {
icon: 'umb:article',
label: 'New empty script',
api: UmbCreateScriptAction,
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
entityTypes: [SCRIPTS_FOLDER_ENTITY_TYPE, SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE, SCRIPTS_ROOT_ENTITY_TYPE],
},
@@ -49,10 +49,10 @@ const scriptsFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: SCRIPTS_ENTITY_ACTION_DELETE_FOLDER_ALIAS,
name: 'Remove empty folder',
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'umb:trash',
label: 'Remove folder',
api: UmbDeleteFolderEntityAction,
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
entityTypes: [SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE],
},
@@ -61,10 +61,10 @@ const scriptsFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: SCRIPTS_ENTITY_ACTION_CREATE_FOLDER_NEW_ALIAS,
name: 'Create empty folder',
api: UmbCreateFolderEntityAction,
meta: {
icon: 'umb:add',
label: 'Create folder',
api: UmbCreateFolderEntityAction,
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
entityTypes: [SCRIPTS_FOLDER_EMPTY_ENTITY_TYPE, SCRIPTS_FOLDER_ENTITY_TYPE, SCRIPTS_ROOT_ENTITY_TYPE],
},

View File

@@ -22,10 +22,10 @@ const stylesheetActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Stylesheet.Delete',
name: 'Delete Stylesheet Entity Action',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: STYLESHEET_REPOSITORY_ALIAS,
entityTypes: [STYLESHEET_ENTITY_TYPE],
},
@@ -39,10 +39,10 @@ const stylesheetFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Stylesheet.Folder.Create',
name: 'Create Stylesheet Entity Under Directory Action',
api: UmbCreateStylesheetAction,
meta: {
icon: 'umb:script',
label: 'New stylesheet file',
api: UmbCreateStylesheetAction,
repositoryAlias: STYLESHEET_REPOSITORY_ALIAS,
entityTypes: [STYLESHEET_FOLDER_ENTITY_TYPE, STYLESHEET_FOLDER_EMPTY_ENTITY_TYPE, STYLESHEET_ROOT_ENTITY_TYPE],
},
@@ -51,10 +51,10 @@ const stylesheetFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Stylesheet.Folder.Create.RTF',
name: 'Create RTF Stylesheet Entity Under Directory Action',
api: UmbCreateRTFStylesheetAction,
meta: {
icon: 'umb:script',
label: 'New Rich Text Editor style sheet file',
api: UmbCreateRTFStylesheetAction,
repositoryAlias: STYLESHEET_REPOSITORY_ALIAS,
entityTypes: [STYLESHEET_FOLDER_ENTITY_TYPE, STYLESHEET_FOLDER_EMPTY_ENTITY_TYPE, STYLESHEET_ROOT_ENTITY_TYPE],
},
@@ -63,10 +63,10 @@ const stylesheetFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Stylesheet.Folder.DeleteFolder',
name: 'Remove empty folder',
api: UmbDeleteFolderEntityAction,
meta: {
icon: 'umb:trash',
label: 'Remove folder',
api: UmbDeleteFolderEntityAction,
repositoryAlias: STYLESHEET_REPOSITORY_ALIAS,
entityTypes: [STYLESHEET_FOLDER_EMPTY_ENTITY_TYPE],
},
@@ -75,10 +75,10 @@ const stylesheetFolderActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Stylesheet.Folder.CreateFolder',
name: 'Create empty folder',
api: UmbCreateFolderEntityAction,
meta: {
icon: 'umb:add',
label: 'Create folder',
api: UmbCreateFolderEntityAction,
repositoryAlias: STYLESHEET_REPOSITORY_ALIAS,
entityTypes: [STYLESHEET_FOLDER_EMPTY_ENTITY_TYPE, STYLESHEET_FOLDER_ENTITY_TYPE, STYLESHEET_ROOT_ENTITY_TYPE],
},

View File

@@ -9,10 +9,10 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Template.Create',
name: 'Create Template Entity Action',
api: UmbCreateEntityAction,
meta: {
icon: 'umb:add',
label: 'Create',
api: UmbCreateEntityAction,
repositoryAlias: TEMPLATE_REPOSITORY_ALIAS,
entityTypes: [TEMPLATE_ENTITY_TYPE, TEMPLATE_ROOT_ENTITY_TYPE],
},
@@ -21,10 +21,10 @@ const entityActions: Array<ManifestEntityAction> = [
type: 'entityAction',
alias: 'Umb.EntityAction.Template.Delete',
name: 'Delete Template Entity Action',
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete',
api: UmbDeleteEntityAction,
repositoryAlias: TEMPLATE_REPOSITORY_ALIAS,
entityTypes: [TEMPLATE_ENTITY_TYPE],
},

View File

@@ -9,11 +9,11 @@ const entityActions: Array<ManifestTypes> = [
alias: 'Umb.EntityAction.UserGroup.Delete',
name: 'Delete User Group Entity Action',
weight: 900,
api: UmbDeleteEntityAction,
meta: {
icon: 'umb:trash',
label: 'Delete...',
repositoryAlias: USER_GROUP_REPOSITORY_ALIAS,
api: UmbDeleteEntityAction,
entityTypes: [UMB_USER_GROUP_ENTITY_TYPE],
},
},

View File

@@ -63,11 +63,11 @@ const manifest = {
alias: 'My.EntityAction',
name: 'My Entity Action',
weight: 10,
api: MyEntityAction,
meta: {
icon: 'umb:add',
label: 'My Entity Action',
repositoryAlias: 'My.Repository',
api: MyEntityAction,
entityTypes: ['my-entity'],
},
};