From 395999c40d01f4d134b9b136c020d346715465ed Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 17 Jul 2024 16:23:38 +0100 Subject: [PATCH 1/3] Entity Bulk Action: adds optional button icon --- .../entity-bulk-action/default/default.action.kind.ts | 1 + .../entity-bulk-action/entity-bulk-action.element.ts | 11 +++++------ .../models/entity-bulk-action.model.ts | 10 ++++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/default/default.action.kind.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/default/default.action.kind.ts index f36eaf6dd4..2b13205e93 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/default/default.action.kind.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/default/default.action.kind.ts @@ -11,6 +11,7 @@ export const UMB_ENTITY_BULK_ACTION_DEFAULT_KIND_MANIFEST: UmbBackofficeManifest weight: 1000, element: () => import('../entity-bulk-action.element.js'), meta: { + icon: '', label: 'Default Entity Bulk Action', }, }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.element.ts index d1ccb48953..0478595f71 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/entity-bulk-action.element.ts @@ -1,6 +1,6 @@ import type { UmbEntityBulkAction } from './entity-bulk-action.interface.js'; import type { UmbEntityBulkActionElement } from './entity-bulk-action-element.interface.js'; -import { html, ifDefined, customElement, property } from '@umbraco-cms/backoffice/external/lit'; +import { html, customElement, property, when } from '@umbraco-cms/backoffice/external/lit'; import { UmbActionExecutedEvent } from '@umbraco-cms/backoffice/event'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { @@ -32,11 +32,10 @@ export class UmbEntityBulkActionDefaultElement< override render() { return html` - + + ${when(this.manifest?.meta.icon, () => html``)} + ${this.localize.string(this.manifest?.meta.label ?? '')} + `; } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/entity-bulk-action.model.ts b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/entity-bulk-action.model.ts index 7bd4c186e7..fa05144d4e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/entity-bulk-action.model.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/entity-bulk-action.model.ts @@ -23,6 +23,16 @@ export interface ManifestEntityBulkActionDefaultKind extends ManifestEntityBulkA } export interface MetaEntityBulkActionDefaultKind extends MetaEntityBulkAction { + /** + * An icon to represent the action to be performed + * + * @examples [ + * "icon-box", + * "icon-grid" + * ] + */ + icon: string; + /** * The friendly name of the action to perform * From 15317f7847d3b3ed0d902c798327185abfcab98d Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 17 Jul 2024 16:24:10 +0100 Subject: [PATCH 2/3] Adds icon for `moveTo` kind --- .../entity-bulk-action/common/move-to/move-to.action.kind.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/common/move-to/move-to.action.kind.ts b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/common/move-to/move-to.action.kind.ts index 5bae68e01d..a26a2d7302 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/common/move-to/move-to.action.kind.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/entity-bulk-action/common/move-to/move-to.action.kind.ts @@ -14,6 +14,7 @@ export const manifest: UmbBackofficeManifestKind = { weight: 700, forEntityTypes: [], meta: { + icon: 'icon-enter', label: '#actions_move', bulkMoveRepositoryAlias: '', treeAlias: '', From 82069102068fcdec65156a0cb4b7c29df84cc448 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 17 Jul 2024 16:24:42 +0100 Subject: [PATCH 3/3] Adds icons for document Publish and Unpublish as well as localizing the button labels. --- .../documents/documents/entity-bulk-actions/manifests.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-bulk-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-bulk-actions/manifests.ts index 1053c25ce1..2fbc3bd2a6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-bulk-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/entity-bulk-actions/manifests.ts @@ -18,7 +18,8 @@ export const entityBulkActions: Array = [ weight: 50, api: () => import('./publish/publish.action.js'), meta: { - label: 'Publish', + icon: 'icon-globe', + label: '#actions_publish', }, forEntityTypes: [UMB_DOCUMENT_ENTITY_TYPE], conditions: [ @@ -40,7 +41,8 @@ export const entityBulkActions: Array = [ weight: 40, api: () => import('./unpublish/unpublish.action.js'), meta: { - label: 'Unpublish', + icon: 'icon-globe', + label: '#actions_unpublish', }, forEntityTypes: [UMB_DOCUMENT_ENTITY_TYPE], conditions: [