Skip to content

Commit

Permalink
[FIX] data_bar_rule_editor: disable "No Color" button
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
dhrp-odoo committed Dec 16, 2024
1 parent c8af9e9 commit 23a005a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ export class ConditionalFormattingEditor extends Component<Props, SpreadsheetChi
}

updateDataBarColor(color: Color) {
if (!isColorValid(color)) {
return;
}

this.state.rules.dataBar.color = Number.parseInt(color.substr(1), 16);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<RoundColorPicker
currentColor="colorNumberString(rule.color)"
onColorPicked.bind="updateDataBarColor"
disableNoColor="true"
/>
<div class="o-section-subtitle">Range of values</div>
<SelectionInput
Expand Down

0 comments on commit 23a005a

Please sign in to comment.