mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
dashlet color
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -332,6 +332,14 @@ class BaseDashletView extends View {
|
||||
return itemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {string|null}
|
||||
* @since 9.0.0
|
||||
*/
|
||||
getColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
afterAdding() {}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user