diff --git a/src/Umbraco.Web.UI.Client/libs/extensions-registry/entity-action.models.ts b/src/Umbraco.Web.UI.Client/libs/extensions-registry/entity-action.models.ts index e44ee7d6af..71ada0a184 100644 --- a/src/Umbraco.Web.UI.Client/libs/extensions-registry/entity-action.models.ts +++ b/src/Umbraco.Web.UI.Client/libs/extensions-registry/entity-action.models.ts @@ -6,7 +6,7 @@ export interface ManifestEntityAction extends ManifestElement { } export interface MetaEntityAction { - icon: string; + icon?: string; label: string; entityType: string; api: any; // create interface diff --git a/src/Umbraco.Web.UI.Client/libs/extensions-registry/models.ts b/src/Umbraco.Web.UI.Client/libs/extensions-registry/models.ts index 995fb01def..0b8f3a8890 100644 --- a/src/Umbraco.Web.UI.Client/libs/extensions-registry/models.ts +++ b/src/Umbraco.Web.UI.Client/libs/extensions-registry/models.ts @@ -42,6 +42,7 @@ export * from './collection-view.models'; export * from './health-check.models'; export * from './sidebar-menu-item.models'; export * from './theme.models'; +export * from './entity-action.models'; export type ManifestTypes = | ManifestCustom diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/manifests.ts index 2853c9b6af..36048f90bb 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/manifests.ts @@ -9,7 +9,14 @@ import { UmbSortChildrenOfDocumentEntityAction } from './sort-children-of.action import { UmbCreateDocumentBlueprintEntityAction } from './create-blueprint.action'; import { UmbDocumentPublicAccessEntityAction } from './public-access.action'; import { UmbDocumentPermissionsEntityAction } from './permissions.action'; -import { ManifestEntityAction } from 'libs/extensions-registry/entity-action.models'; +import { UmbSaveAndPublishDocumentEntityAction } from './save-and-publish.action'; +import { UmbUnpublishDocumentEntityAction } from './unpublish.action'; +import { UmbSaveAndPreviewDocumentEntityAction } from './save-and-preview.action'; +import { UmbSaveAndScheduleDocumentEntityAction } from './save-and-schedule.action'; +import { UmbRollbackDocumentEntityAction } from './rollback.action'; +import { ManifestEntityAction } from '@umbraco-cms/extensions-registry'; + +const entityType = 'document'; /* TODO: This is a temporary solution to get the entity actions working. Some actions will only work in the tree (sort), others will only work in a workspace (Save, Save and Publish, etc.). @@ -21,7 +28,7 @@ const entityActions: Array = [ name: 'Create Document Entity Action', weight: 1000, meta: { - entityType: 'document', + entityType, icon: 'umb:add', label: 'Create', api: UmbCreateDocumentEntityAction, @@ -33,7 +40,7 @@ const entityActions: Array = [ name: 'Trash Document Entity Action', weight: 900, meta: { - entityType: 'document', + entityType, icon: 'umb:document', label: 'Trash', api: UmbTrashDocumentEntityAction, @@ -45,7 +52,7 @@ const entityActions: Array = [ name: 'Create Document Blueprint Entity Action', weight: 800, meta: { - entityType: 'document', + entityType, icon: 'umb:blueprint', label: 'Create Content Template', api: UmbCreateDocumentBlueprintEntityAction, @@ -57,7 +64,7 @@ const entityActions: Array = [ name: 'Move Document Entity Action', weight: 700, meta: { - entityType: 'document', + entityType, icon: 'umb:enter', label: 'Move', api: UmbMoveDocumentEntityAction, @@ -69,7 +76,7 @@ const entityActions: Array = [ name: 'Copy Document Entity Action', weight: 600, meta: { - entityType: 'document', + entityType, icon: 'umb:documents', label: 'Copy', api: UmbCopyDocumentEntityAction, @@ -81,7 +88,7 @@ const entityActions: Array = [ name: 'Sort Document Entity Action', weight: 500, meta: { - entityType: 'document', + entityType, icon: 'umb:navigation-vertical', label: 'Sort', api: UmbSortChildrenOfDocumentEntityAction, @@ -93,7 +100,7 @@ const entityActions: Array = [ name: 'Culture And Hostnames Document Entity Action', weight: 400, meta: { - entityType: 'document', + entityType, icon: 'umb:home', label: 'Culture And Hostnames', api: UmbDocumentCultureAndHostnamesEntityAction, @@ -104,7 +111,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.Document.Permissions', name: 'Document Permissions Entity Action', meta: { - entityType: 'document', + entityType, icon: 'umb:vcard', label: 'Permissions', api: UmbDocumentPermissionsEntityAction, @@ -115,7 +122,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.Document.PublicAccess', name: 'Document Permissions Entity Action', meta: { - entityType: 'document', + entityType, icon: 'umb:lock', label: 'Public Access', api: UmbDocumentPublicAccessEntityAction, @@ -126,7 +133,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.Document.Publish', name: 'Publish Document Entity Action', meta: { - entityType: 'document', + entityType, icon: 'umb:globe', label: 'Publish', api: UmbPublishDocumentEntityAction, @@ -134,15 +141,77 @@ const entityActions: Array = [ }, { type: 'entityAction', - alias: 'Umb.EntityAction.Document.Save', - name: 'Save Document Entity Action ', + alias: 'Umb.EntityAction.Document.Publish', + name: 'Publish Document Entity Action', meta: { - entityType: 'document', - icon: 'umb:save', + entityType, + icon: 'umb:globe', + label: 'Publish', + api: UmbPublishDocumentEntityAction, + }, + }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.Unpublish', + name: 'Unpublish Document Entity Action', + meta: { + entityType, + icon: 'umb:globe', + label: 'Unpublish', + api: UmbUnpublishDocumentEntityAction, + }, + }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.Rollback', + name: 'Rollback Document Entity Action', + meta: { + entityType, + icon: 'umb:undo', + label: 'Rollback', + api: UmbRollbackDocumentEntityAction, + }, + }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.Save', + name: 'Save Document Entity Action', + meta: { + entityType, label: 'Save', api: UmbSaveDocumentEntityAction, }, }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.SaveAndPublish', + name: 'Save And Publish Document Entity Action', + meta: { + entityType, + label: 'Save And Publish', + api: UmbSaveAndPublishDocumentEntityAction, + }, + }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.SaveAndPreview', + name: 'Unpublish Document Entity Action', + meta: { + entityType, + label: 'Save And Preview', + api: UmbSaveAndPreviewDocumentEntityAction, + }, + }, + { + type: 'entityAction', + alias: 'Umb.EntityAction.Document.SaveAndSchedule', + name: 'Save And Schedule Document Entity Action', + meta: { + entityType, + label: 'Save And Schedule', + api: UmbSaveAndScheduleDocumentEntityAction, + }, + }, ]; export const manifests = [...entityActions]; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/rollback.action.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/rollback.action.ts new file mode 100644 index 0000000000..a35d34da6a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/rollback.action.ts @@ -0,0 +1,15 @@ +import { UmbControllerHostInterface } from '@umbraco-cms/controller'; + +export class UmbRollbackDocumentEntityAction { + #host: UmbControllerHostInterface; + #key: string; + + constructor(host: UmbControllerHostInterface, key: string) { + this.#host = host; + this.#key = key; + } + + execute() { + alert('Rollback'); + } +} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-preview.action.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-preview.action.ts new file mode 100644 index 0000000000..bef0c26311 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-preview.action.ts @@ -0,0 +1,15 @@ +import { UmbControllerHostInterface } from '@umbraco-cms/controller'; + +export class UmbSaveAndPreviewDocumentEntityAction { + #host: UmbControllerHostInterface; + #key: string; + + constructor(host: UmbControllerHostInterface, key: string) { + this.#host = host; + this.#key = key; + } + + execute() { + alert('save and preview'); + } +} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-publish.action.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-publish.action.ts new file mode 100644 index 0000000000..ea781507d8 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-publish.action.ts @@ -0,0 +1,15 @@ +import { UmbControllerHostInterface } from '@umbraco-cms/controller'; + +export class UmbSaveAndPublishDocumentEntityAction { + #host: UmbControllerHostInterface; + #key: string; + + constructor(host: UmbControllerHostInterface, key: string) { + this.#host = host; + this.#key = key; + } + + execute() { + alert('save and publish'); + } +} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-schedule.action.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-schedule.action.ts new file mode 100644 index 0000000000..823e6619d2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/save-and-schedule.action.ts @@ -0,0 +1,15 @@ +import { UmbControllerHostInterface } from '@umbraco-cms/controller'; + +export class UmbSaveAndScheduleDocumentEntityAction { + #host: UmbControllerHostInterface; + #key: string; + + constructor(host: UmbControllerHostInterface, key: string) { + this.#host = host; + this.#key = key; + } + + execute() { + alert('save and schedule'); + } +} diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/unpublish.action.ts b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/unpublish.action.ts new file mode 100644 index 0000000000..58782590ff --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/backoffice/documents/documents/entity-actions/unpublish.action.ts @@ -0,0 +1,15 @@ +import { UmbControllerHostInterface } from '@umbraco-cms/controller'; + +export class UmbUnpublishDocumentEntityAction { + #host: UmbControllerHostInterface; + #key: string; + + constructor(host: UmbControllerHostInterface, key: string) { + this.#host = host; + this.#key = key; + } + + execute() { + alert('unpublish'); + } +}