dashlet color

This commit is contained in:
Yuri Kuznetsov
2024-12-20 09:41:06 +02:00
parent a28f815dd4
commit d49821007d
4 changed files with 21 additions and 1 deletions

View File

@@ -49,7 +49,10 @@
data-action="refresh"
class="action"
title="{{translate 'Refresh'}}"
>{{#if title}}{{title}}{{else}}&nbsp;{{/if}}</span>
>
{{~#if color}}<span class="color-icon fas fa-square" style="color: {{color}}"></span><span>&nbsp;</span>{{/if~}}
{{~#if title}}{{title}}{{else}}&nbsp;{{/if~}}
</span>
</h4>
</div>
<div class="dashlet-body panel-body{{#if noPadding}} no-padding{{/if}}">{{{body}}}</div>

View File

@@ -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,
};
}

View File

@@ -332,6 +332,14 @@ class BaseDashletView extends View {
return itemList;
}
/**
* @return {string|null}
* @since 9.0.0
*/
getColor() {
return null;
}
afterAdding() {}
}

View File

@@ -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;