Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] side_panel: cf rule range bugs #3446

Conversation

fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Jan 16, 2024

Description:

Steps to reproduce :-

Bug 1 : 

  • Change the range to ""  
  • Focus out => selection input should have a red border even without clicking on
    confirm

Bug 2 : 

  • Enter "" as range and save
  • Now change it to a valid range and confirm => red border and error message do
    not disappear even if you confirm

Bug 3 :

  • Enter an invalid range (eg. A2:B3:C3) and save
  • Now change it to a valid range and confirm => red border disappears but the
    error message does not disappear

Bug 4 :

  • Enter an invalid range (with invalid sheet name) => red border appears
    (correct), but there is no error message and you can still save the cf rule

With this commit the following amendments have been made:

Earlier, the condition checked to display selection input border in red
considered 'empty range' as a valid input. That condition is changed to
consider it as an invalid range.

The condition to check for invalid ranges, while dispatching command result
'InvalidRange', is altered to use the getter isRangeValid so that cf rules
with ranges containing invalid sheet name cannot be saved.

To ensure that the error message appears if and only if the input is invalid
(i.e. it disappears on entering a valid range as input, even without clicking on
confirm or save), error messages for invalid range are now handled from
the onRangesChanged method instead of saveConditionalFormat method.

Task: : 3651293

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

Forward-Port-Of: #3413

@robodoo
Copy link
Collaborator

robodoo commented Jan 16, 2024

@fw-bot
Copy link
Collaborator Author

fw-bot commented Jan 16, 2024

@khpa-odoo @rrahir cherrypicking of pull request #3413 failed.

stdout:

Auto-merging src/components/selection_input/selection_input.ts
Auto-merging src/components/side_panel/conditional_formatting/conditional_formatting.ts
Auto-merging tests/components/conditional_formatting.test.ts
CONFLICT (content): Merge conflict in tests/components/conditional_formatting.test.ts
Auto-merging tests/components/selection_input.test.ts

stderr:

09:10:12.493317 git.c:463               trace: built-in: git cherry-pick f6776e86b39b70f78daba1460987163c0a20d10d
error: could not apply f6776e86b... [FIX] side_panel: cf rule range bugs
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

Steps to reproduce :-
Bug 1 : 
- Change the range to ""  
- Focus out => selection input should have a red border even without clicking on
  confirm
Bug 2 : 
- Enter "" as range and save
- Now change it to a valid range and confirm => red border and error message do
  not disappear even if you confirm
Bug 3 :
- Enter an invalid range (eg. A2:B3:C3) and save
- Now change it to a valid range and confirm => red border disappears but the
  error message does not disappear
Bug 4 :
- Enter an invalid range (with invalid sheet name) => red border appears
  (correct), but there is no error message and you can still save the cf rule

With this commit, the following amendments have been made:

Earlier, the condition checked to display selection input border in red
considered 'empty range' as a valid input. That condition is changed to
consider it as an invalid range.

The condition to check for invalid ranges, while dispatching command result
'InvalidRange', is altered to use the getter `isRangeValid` so that cf rules
with ranges containing invalid sheet name cannot be saved.

To ensure that the error message appears if and only if the input is invalid
(i.e. it disappears on entering a valid range as input, even without clicking on
confirm or save), error messages for invalid range are now handled from
the `onRangesChanged` method instead of `saveConditionalFormat` method.

Task ID : 3651293

X-original-commit: 4a956f3
@rrahir rrahir force-pushed the saas-16.2-16.0-fix-side-panel-range-bugs-khpa-JPLs-fw branch from d84142a to 19b1c8c Compare January 16, 2024 08:41
@rrahir
Copy link
Collaborator

rrahir commented Jan 16, 2024

@robodoo r+

robodoo pushed a commit that referenced this pull request Jan 16, 2024
Steps to reproduce :-
Bug 1 : 
- Change the range to ""  
- Focus out => selection input should have a red border even without clicking on
  confirm
Bug 2 : 
- Enter "" as range and save
- Now change it to a valid range and confirm => red border and error message do
  not disappear even if you confirm
Bug 3 :
- Enter an invalid range (eg. A2:B3:C3) and save
- Now change it to a valid range and confirm => red border disappears but the
  error message does not disappear
Bug 4 :
- Enter an invalid range (with invalid sheet name) => red border appears
  (correct), but there is no error message and you can still save the cf rule

With this commit, the following amendments have been made:

Earlier, the condition checked to display selection input border in red
considered 'empty range' as a valid input. That condition is changed to
consider it as an invalid range.

The condition to check for invalid ranges, while dispatching command result
'InvalidRange', is altered to use the getter `isRangeValid` so that cf rules
with ranges containing invalid sheet name cannot be saved.

To ensure that the error message appears if and only if the input is invalid
(i.e. it disappears on entering a valid range as input, even without clicking on
confirm or save), error messages for invalid range are now handled from
the `onRangesChanged` method instead of `saveConditionalFormat` method.

Task ID : 3651293

closes #3446

X-original-commit: 4a956f3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
@robodoo robodoo closed this Jan 16, 2024
@fw-bot fw-bot deleted the saas-16.2-16.0-fix-side-panel-range-bugs-khpa-JPLs-fw branch January 30, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants