o-spreadsheet
o-spreadsheet copied to clipboard
[IMP] selection: drag and drop selection on the grid
Description:
[IMP] selection: drag and drop selection on the grid
Add a new component named "selection" allowing to cut/paste a selection by grabbing and moving it.
Odoo task ID : 2560650
[REF] autofill: integrate the autofill in the selection component
With this commit, we reuse the "corner" component to integrate the autofill as a sub-part of the "selection" component.
This allows more consistency between selections and highlights which are now both defined as having border and corner components.
This change also modifies two behaviors:
- autofill tooltip depends now on autofill position, not on cursor position
- it is now possible to edge scrolling the autofill
Odoo task ID : 2664656
review checklist
- [x] undo-able commands (uses this.history.update)
- [x] multiuser-able commands (has inverse commands and transformations where needed)
- [x] translations (_lt("qmsdf %s", abc))
- [x] unit tested
- [x] clean commented code
- [x] feature is organized in plugin, or UI components
- [ ] exportable in excel
- [ ] importable from excel
- [x] in model/core: ranges are Range object, and can be adapted (adaptRanges)
- [x] in model/UI: ranges are strings (to show the user)
- [ ] new/updated/removed commands are documented
- [x] track breaking changes
- [ ] public API change (index.ts) must rebuild doc (npm run doc)
- [x] code is prettified with prettier (in each commit, no separate commit)
- [x] status is correct in Odoo
@laa-odoo Needs a rebase too, but can you already check the package-lock.json ? It should not be changed, as no new dependency is added
@pro-odoo it's done :)
@LucasLefevre thank you for the review, I made the necessary changes :)
ptit rebase :)
I have a strange feeling that we are trying to make basic feature that works with the general selection in order to extend it to highlights and selection inputs based on the fact that we know that they are deeply intertwined but we are currently trying to get rid of this behaviour and have selection/composer highlights/ selection inputs as independant from one another as possible.
I think we should wait for that task (https://www.odoo.com/web#id=2698011&cids=1&model=project.task&view_type=form) to be considered and maybe adopted before adding even more stuff that potentially ties the 3 selections even more together.
I have tested it out a bit: the behaviour with merges is kinda weird. See https://www.awesomescreenshot.com/video/6688902?key=437e3ab4a1a4fd3a21f7069de66742d0 If we can't override a merge, then when I drop my selection, it should not stay where the move could not work, it should probably rollback to where I started, doesn't it ?
- If I play with my selection long enough by covering merges, I can extend it again and again and again. I feel like it defeats the purpose :/
All in all: https://imgflip.com/i/5zywgi
I have a strange feeling that we are trying to make basic feature that works with the general selection in order to extend it to highlights and selection inputs based on the fact that we know that they are deeply intertwined but we are currently trying to get rid of this behaviour and have selection/composer highlights/ selection inputs as independant from one another as possible.
I think we should wait for that task (https://www.odoo.com/web#id=2698011&cids=1&model=project.task&view_type=form) to be considered and maybe adopted before adding even more stuff that potentially ties the 3 selections even more together.
I am not against this idea, but, note that the change is made here on the view and not in the plugin, so it is not very dangerous :)
I have tested it out a bit: the behaviour with merges is kinda weird. See https://www.awesomescreenshot.com/video/6688902?key=437e3ab4a1a4fd3a21f7069de66742d0 If we can't override a merge, then when I drop my selection, it should not stay where the move could not work, it should probably rollback to where I started, doesn't it ?
- If I play with my selection long enough by covering merges, I can extend it again and again and again. I feel like it defeats the purpose :/
All in all: https://imgflip.com/i/5zywgi
The changes have been incorporated in a special commit named: “TO REVIEW”. If okay, I'll fixup in the previous commit.
Sorry, I didn't know about this PR and had to retrieve its information, you may have to re-approve it.
@pro-odoo Runbot is green :p
Need to run prettier 🙃