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] Misc move headers fixes #3283

Closed
wants to merge 3 commits into from

Conversation

fw-bot
Copy link
Collaborator

@fw-bot fw-bot commented Nov 28, 2023

  • [FIX] selection: change MOVE_COLUMNS_ROWS payload
  • [FIX] Commands: Add Allowdispatch to MOVE_COLUMNS_ROWS
  • [FIX] Sheet: fix ADD_COLUMNS_ROWS allowDispatch

Description:

description of this task, what is implemented and why it is implemented that way.

Task: : 3603714

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 (_lt("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: #3275
Forward-Port-Of: #3228

the arguments of the commands `MOVE_COLUMNS_ROWS`, specifically `base` is
supposed to be a HeaderIndex. The command however was not properly
designed: it would always move the `target` headers **before** `base`.
This is a problem when we want to move a col (resp. row) header to the far
right (resp. bottom) of the sheet.

E.g. On a sheet with 5 col headers, if we wanted to move the first one
them to the extreme right of the sheet, we would have to specify a
command where the target should be `[0]` and the base would be `5`
because we want the target to go after `4`, which is quasi equivalent
except that header `5` does not exist!

This revision changes the command payload so that we can specify whether
we want to place our target before or after the base, allowing to check
that both `elements` and `base` contain valid (existing) headers.

Task: 3603714
X-original-commit: 54940ad
The command could be called with invalid (i;e. out of bounds) headers.

X-original-commit: 59625c4
the condition on the argument `base` was not strict enough, it could
refer to a header index just outside of the existing headers pool and
unfortunately, the tests did not test that edge-case.

Task: 3603714
X-original-commit: e4fbb5e
@robodoo
Copy link
Collaborator

robodoo commented Nov 28, 2023

@fw-bot
Copy link
Collaborator Author

fw-bot commented Nov 28, 2023

This PR targets saas-16.3 and is part of the forward-port chain. Further PRs will be created up to master.

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

@rrahir
Copy link
Collaborator

rrahir commented Nov 28, 2023

@robodoo r+

robodoo pushed a commit that referenced this pull request Nov 28, 2023
the arguments of the commands `MOVE_COLUMNS_ROWS`, specifically `base` is
supposed to be a HeaderIndex. The command however was not properly
designed: it would always move the `target` headers **before** `base`.
This is a problem when we want to move a col (resp. row) header to the far
right (resp. bottom) of the sheet.

E.g. On a sheet with 5 col headers, if we wanted to move the first one
them to the extreme right of the sheet, we would have to specify a
command where the target should be `[0]` and the base would be `5`
because we want the target to go after `4`, which is quasi equivalent
except that header `5` does not exist!

This revision changes the command payload so that we can specify whether
we want to place our target before or after the base, allowing to check
that both `elements` and `base` contain valid (existing) headers.

Task: 3603714
X-original-commit: 54940ad
Part-of: #3283
robodoo pushed a commit that referenced this pull request Nov 28, 2023
The command could be called with invalid (i;e. out of bounds) headers.

X-original-commit: 59625c4
Part-of: #3283
robodoo pushed a commit that referenced this pull request Nov 28, 2023
the condition on the argument `base` was not strict enough, it could
refer to a header index just outside of the existing headers pool and
unfortunately, the tests did not test that edge-case.

closes #3283

Task: 3603714
X-original-commit: e4fbb5e
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
@robodoo robodoo closed this Nov 28, 2023
@fw-bot fw-bot deleted the saas-16.3-16.0-fix-dnd-header-rar-5w4b-fw branch December 12, 2023 12: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

3 participants