From 4597e51f580f22701d602c5322c419f9f229d4b4 Mon Sep 17 00:00:00 2001 From: Lyubov Voloshko Date: Mon, 17 Nov 2025 17:20:56 +0200 Subject: [PATCH 1/2] widgets: add background_color option for select widget --- .../record-view-fields/select/select.component.css | 5 ++++- .../record-view-fields/select/select.component.html | 2 +- .../record-view-fields/select/select.component.ts | 2 ++ .../table-display-fields/select/select.component.css | 5 ++++- .../table-display-fields/select/select.component.html | 2 +- .../table-display-fields/select/select.component.ts | 2 ++ 6 files changed, 14 insertions(+), 4 deletions(-) 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 @@
- {{displayValue}} + {{displayValue}}