Skip to content

Commit 23a005a

Browse files
committed
[FIX] data_bar_rule_editor: disable "No Color" button
This PR introduces two changes: 1. Fixes a traceback error in the Conditional Formatting Databar editor by hiding the "Reset" button when not applicable. 2. Prevents errors by validating color input earlier to avoid empty string parsing issues. closes #5191 Task: 4102704 Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
1 parent c8af9e9 commit 23a005a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/components/side_panel/conditional_formatting/cf_editor/cf_editor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ export class ConditionalFormattingEditor extends Component<Props, SpreadsheetChi
563563
}
564564

565565
updateDataBarColor(color: Color) {
566+
if (!isColorValid(color)) {
567+
return;
568+
}
569+
566570
this.state.rules.dataBar.color = Number.parseInt(color.substr(1), 16);
567571
}
568572

src/components/side_panel/conditional_formatting/cf_editor/data_bar_rule_editor.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<RoundColorPicker
66
currentColor="colorNumberString(rule.color)"
77
onColorPicked.bind="updateDataBarColor"
8+
disableNoColor="true"
89
/>
910
<div class="o-section-subtitle">Range of values</div>
1011
<SelectionInput

0 commit comments

Comments
 (0)