diff --git a/frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts b/frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts index 1138124d0..c45046d76 100644 --- a/frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts +++ b/frontend/src/app/components/dashboard/db-table-view/db-table-widgets/db-table-widgets.component.ts @@ -219,15 +219,18 @@ export class DbTableWidgetsComponent implements OnInit { "options": [ { "value": "UA", - "label": "πΊπ¦ Ukraine" + "label": "πΊπ¦ Ukraine", + "background_color": "gold" }, { "value": "PL", - "label": "π΅π± Poland" + "label": "π΅π± Poland", + "background_color": "#FF1212" }, { "value": "US", - "label": "πΊπΈ United States" + "label": "πΊπΈ United States", + "background_color": "rgba(100, 150, 255, 0.5)" } ] }`, diff --git a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.css b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.css index 8b1378917..288f5afca 100644 --- a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.css +++ b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.css @@ -1 +1,4 @@ - +.field-view-value { + padding: 2px 6px; + border-radius: 4px; +} diff --git a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.html b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.html index 8f3bd4c32..2fd355c75 100644 --- a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.html +++ b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.html @@ -1 +1 @@ -{{displayValue}} +{{displayValue}} diff --git a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.ts b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.ts index 7b196d05f..fb414c937 100644 --- a/frontend/src/app/components/ui-components/record-view-fields/select/select.component.ts +++ b/frontend/src/app/components/ui-components/record-view-fields/select/select.component.ts @@ -11,6 +11,7 @@ import { BaseRecordViewFieldComponent } from '../base-record-view-field/base-rec }) export class SelectRecordViewComponent extends BaseRecordViewFieldComponent implements OnInit { public displayValue: string; + public backgroundColor: string; ngOnInit(): void { this.setDisplayValue(); @@ -28,6 +29,7 @@ export class SelectRecordViewComponent extends BaseRecordViewFieldComponent impl (opt: { value: any, label: string }) => opt.value === this.value ); this.displayValue = option ? option.label : this.value; + this.backgroundColor = option && option.background_color ? option.background_color : 'transparent'; } else if (this.structure?.data_type_params) { // If no widget structure but we have data_type_params, just use the value this.displayValue = this.value; diff --git a/frontend/src/app/components/ui-components/table-display-fields/select/select.component.css b/frontend/src/app/components/ui-components/table-display-fields/select/select.component.css index 8b1378917..3015d8368 100644 --- a/frontend/src/app/components/ui-components/table-display-fields/select/select.component.css +++ b/frontend/src/app/components/ui-components/table-display-fields/select/select.component.css @@ -1 +1,4 @@ - +.field-value { + padding: 2px 6px; + border-radius: 4px; +} diff --git a/frontend/src/app/components/ui-components/table-display-fields/select/select.component.html b/frontend/src/app/components/ui-components/table-display-fields/select/select.component.html index 58124cc57..6a53e0703 100644 --- a/frontend/src/app/components/ui-components/table-display-fields/select/select.component.html +++ b/frontend/src/app/components/ui-components/table-display-fields/select/select.component.html @@ -1,5 +1,5 @@