Skip to content

EspoCRM – Open Source CRM Application

Mass action icons

Yurii3832f11e879f
diff --git a/client/res/templates/record/list.tpl b/client/res/templates/record/list.tpl
index c99ecbd63d..dce7709150 100644
--- a/client/res/templates/record/list.tpl
+++ b/client/res/templates/record/list.tpl
@@ -11,13 +11,21 @@
<ul class="dropdown-menu actions-menu">
{{#each massActionDataList}}
{{#if this}}
- <li {{#if hidden}}class="hidden"{{/if}}>
+ <li {{#if hidden}} class="hidden" {{/if}}>
<a
role="button"
tabindex="0"
data-action="{{name}}"
class="mass-action"
- >{{translate name category="massActions" scope=../scope}}</a>
+ >
+ {{~#if iconClass~}}
+ <span class="item-icon {{iconClass}}"></span>
+ {{~/if~}}
+ <span
+ class="item-text"
+ >{{translate name category="massActions" scope=../scope}}</span>
+ {{~null~}}
+ </a>
</li>
{{else}}
{{#unless @first}}
@@ -78,7 +86,19 @@
class="action list-action-item"
data-action="{{name}}"
data-name="{{name}}"
- >{{#if html}}{{{html}}}{{else}}{{translate label scope=../entityType}}{{/if}}</a></li>
+ >
+ {{~#if html~}}
+ {{{html}}}
+ {{~else~}}
+ {{~#if iconClass~}}
+ <span class="item-icon {{iconClass}}"></span>
+ {{~/if~}}
+ <span
+ class="item-text"
+ >{{translate label scope=../entityType}}</span>
+ {{~/if~}}
+ </a>
+ </li>
{{else}}
{{#unless @first}}
{{#unless @last}}
@@ -101,7 +121,15 @@
tabindex="0"
data-action="{{name}}"
class="mass-action"
- >{{translate name category="massActions" scope=../scope}}</a></li>
+ >
+ {{~#if iconClass~}}
+ <span class="item-icon {{iconClass}}"></span>
+ {{~/if~}}
+ <span
+ class="item-text"
+ >{{translate name category="massActions" scope=../scope}}</span>
+ {{~null~}}
+ </a></li>
{{else}}
{{#unless @first}}
{{#unless @last}}
diff --git a/client/src/views/email/record/list.js b/client/src/views/email/record/list.js
index fbdcf39131..bfe2479da0 100644
--- a/client/src/views/email/record/list.js
+++ b/client/src/views/email/record/list.js
@@ -58,18 +58,19 @@ class EmailListRecordView extends ListRecordView {
if (this.collection.url === this.entityType) {
this.addMassAction({name: 'retrieveFromTrash', groupIndex: -6}, false);
- this.addMassAction({name: 'moveToTrash', groupIndex: -5}, false);
- this.addMassAction({name: 'moveToArchive', groupIndex: -5}, false);
- this.addMassAction({name: 'moveToFolder', groupIndex: -5}, true);
+ this.addMassAction({name: 'moveToTrash', groupIndex: -5, iconClass: 'far fa-trash-can'}, false);
+ this.addMassAction({name: 'moveToArchive', groupIndex: -5, iconClass: 'far fa-caret-square-down'}, false);
+ this.addMassAction({name: 'moveToFolder', groupIndex: -5, iconClass: 'far fa-folder'}, true);
- this.addMassAction({name: 'markAsImportant', groupIndex: -4}, false);
+ this.addMassAction({name: 'markAsImportant', groupIndex: -4, iconClass: 'far fa-star'}, false);
this.addMassAction({name: 'markAsNotImportant', groupIndex: -4}, false);
- this.addMassAction({name: 'markAsRead', groupIndex: -3}, false);
+ this.addMassAction({name: 'markAsRead', groupIndex: -3, iconClass: 'far fa-square-check'}, false);
this.addMassAction({name: 'markAsNotRead', groupIndex: -3}, false);
this.dropdownItemList.push({
name: 'markAllAsRead',
label: 'Mark all as read',
+ iconClass: 'far fa-square-check',
});
this.controlEmailMassActionsVisibility();
diff --git a/client/src/views/record/list-base.ts b/client/src/views/record/list-base.ts
index 5b7a30fd02..44b7247990 100644
--- a/client/src/views/record/list-base.ts
+++ b/client/src/views/record/list-base.ts
@@ -2319,14 +2319,14 @@ abstract class ListBaseRecordView<
}
this.massActionDefs = {
- remove: {groupIndex: 0},
- merge: {groupIndex: 0},
- massUpdate: {groupIndex: 0},
- export: {groupIndex: 2},
- follow: {groupIndex: 4},
+ remove: {groupIndex: 0, iconClass: 'fas fa-times'},
+ merge: {groupIndex: 0, iconClass: 'fas fa-code-branch fa-flip-vertical'},
+ massUpdate: {groupIndex: 0, iconClass: 'fas fa-pen-to-square'},
+ export: {groupIndex: 2, iconClass: 'fas fa-arrow-up-right-from-square'},
+ follow: {groupIndex: 4, iconClass: 'fas fa-rss'},
unfollow: {groupIndex: 4},
convertCurrency: {groupIndex: 6},
- printPdf: {groupIndex: 8},
+ printPdf: {groupIndex: 8, iconClass: 'far fa-file-pdf'},
...this.getMetadata().get(['clientDefs', 'Global', 'massActionDefs']) || {},
...this.getMetadata().get(['clientDefs', this.scope ?? '_', 'massActionDefs']) || {},
};
@@ -3771,9 +3771,12 @@ abstract class ListBaseRecordView<
return false;
}
+ const defs = this.massActionDefs[name] || {};
+
return {
name,
- hidden: (this.massActionDefs[name] || {}).hidden,
+ hidden: defs.hidden,
+ iconClass: defs.iconClass,
};
}) as any[];
}
diff --git a/client/src/views/record/list.ts b/client/src/views/record/list.ts
index bbdeeb6564..8aecf4c10b 100644
--- a/client/src/views/record/list.ts
+++ b/client/src/views/record/list.ts
@@ -89,6 +89,12 @@ export interface MassActionItem {
* Is hidden.
*/
hidden?: boolean;
+ /**
+ * An icon class.
+ *
+ * @since 10.0.0
+ */
+ iconClass?: string;
}
/**
@@ -145,6 +151,12 @@ export interface DropdownItem {
* A click handler.
*/
onClick?: () => void;
+ /**
+ * An icon class.
+ *
+ * @since 10.0.0
+ */
+ iconClass?: string,
}
/**