EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
dashlet color
Yuri Kuznetsovd49821007d85
diff --git a/client/res/templates/dashlet.tpl b/client/res/templates/dashlet.tplindex 8e7a6f8dd8..705f2df8c8 100644--- a/client/res/templates/dashlet.tpl+++ b/client/res/templates/dashlet.tpl@@ -49,7 +49,10 @@data-action="refresh"class="action"title="{{translate 'Refresh'}}"- >{{#if title}}{{title}}{{else}} {{/if}}</span>+ >+ {{~#if color}}<span class="color-icon fas fa-square" style="color: {{color}}"></span><span> </span>{{/if~}}+ {{~#if title}}{{title}}{{else}} {{/if~}}+ </span></h4></div><div class="dashlet-body panel-body{{#if noPadding}} no-padding{{/if}}">{{{body}}}</div>diff --git a/client/src/views/dashlet.js b/client/src/views/dashlet.jsindex 7d67ce6ea0..78eb4b534d 100644--- a/client/src/views/dashlet.js+++ b/client/src/views/dashlet.js@@ -71,6 +71,7 @@ class DashletView extends View {actionList: bodyView ? bodyView.getActionItemDataList() : [],buttonList: bodyView ? bodyView.buttonList : [],noPadding: bodyView ? bodyView.noPadding : false,+ color: bodyView ? bodyView.getColor() : null,};}diff --git a/client/src/views/dashlets/abstract/base.js b/client/src/views/dashlets/abstract/base.jsindex 0aa42fe891..e34e92aee5 100644--- a/client/src/views/dashlets/abstract/base.js+++ b/client/src/views/dashlets/abstract/base.js@@ -332,6 +332,14 @@ class BaseDashletView extends View {return itemList;}+ /**+ * @return {string|null}+ * @since 9.0.0+ */+ getColor() {+ return null;+ }+afterAdding() {}}diff --git a/client/src/views/dashlets/abstract/record-list.js b/client/src/views/dashlets/abstract/record-list.jsindex b047739a8b..ccb45b81f1 100644--- a/client/src/views/dashlets/abstract/record-list.js+++ b/client/src/views/dashlets/abstract/record-list.js@@ -220,6 +220,14 @@ class RecordListDashletView extends BaseDashletView {}getCreateAttributes() {}++ getColor() {+ if (!this.scope) {+ return null;+ }++ return this.getMetadata().get(`clientDefs.${this.scope}.color`);+ }}export default RecordListDashletView;