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 #5349

Task: 4102704
X-original-commit: 23a005a
Signed-off-by: Rémi Rahir (rar) <[email protected]>
Signed-off-by: Dhrutik Patel (dhrp) <[email protected]>
  • Loading branch information
dhrp-odoo committed Dec 16, 2024
1 parent c08abe0 commit f37b998
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 @@ -629,6 +629,10 @@ export class ConditionalFormattingEditor extends Component<Props, SpreadsheetChi
}

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

this.state.rules.dataBar.color = Number.parseInt(color.slice(1), 16);
this.updateConditionalFormat({ rule: this.state.rules.dataBar });
}
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 f37b998

Please sign in to comment.