-
Notifications
You must be signed in to change notification settings - Fork 31
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
[IMP] dashboard: automatically reorganize a sheet #4182
Open
hokolomopo
wants to merge
7
commits into
master
Choose a base branch
from
master-simplify-dashboard-creation-adrm
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The getter `getEvaluatedCells` does't return spreaded cells. It also returns empty evaluated cells that have some style. This is not the expected behaviour. `getEvaluatedCells` should return all the non-empty evaluated cells of a sheet. Task: 3869372
This commit extract the logic of the paste operation of the clipboard plugin into a new getter (`getPasteTarget`) and a new command (`EXPAND_SHEET_FOR_ZONE`) so that it can be reused in other parts of the code. Task: 3869372
This commit make the different clipboards instance attributes of the Clipboard plugin, instead of being created each time a paste or copy action is done. This: - is a bit faster and less wasteful - allows the clipboard instances to be exposed to other plugins - will be necessary for a future refactoring of the clipboard plugin where each clipboard will have its own copied data, instead of having a big copied data object shared between all clipboards. Task: 3869372
Currently, when pasting a chart at the edges of a sheet, the pasted chart is shifted so that it doesn't go out of the sheet. This commit changes the behaviour so that now the chart is always pasted with its top-left corner at the top-left corner of the selection, and insert new rows/columns if needed so that the chart fits in the sheet. Also take the occasion to factorize the code in common between the chart clipboard and the image clipboard into the figure clipboard. Task: 3869372
This commit make the clipboards handlers independent from the active sheet, thus allowing to use them to copy/paste things in any sheet. Task: 3869372
This commit moves the tests of mergeContiguousZones from Odoo to o-spreadsheet. It also fixes a bug where the algorithm was merging zones that were diagonal to each other. Task: 3869372
This commit aims to simplify the process of creation of a dashboard with two new features: 1) A context menu item to send figures and ranges to another sheet 2) A context menu to reorganize a sheet in a "dashboard-y" way. Both features are implemented in the `ReorganizeSheetPlugin`. Sending a figure/range to a sheet works by finding the bottom-most used cell in the sheet and placing the figure/range below it. "Used" cells are cells that contains some content/a merge/a table/overlap a figure. Reorganizing a sheet works by: - put the scorecards at the top of the sheet - put the figures below the scorecards - put the cell "clusters" (zones of contiguous cells) below them Technically the reorganization is done by creating new rows at the bottom of the sheet, cut/paste the clusters correctly ordered in these rows, and then delete the original rows. See Odoo task's pad for why we do it this way. Task: 3869372
sequence: 15, | ||
id: "send_to_sheet", | ||
name: _t("Send to sheet"), | ||
icon: "o-spreadsheet-Icon.CUT", // ADRM TODO: icon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda like the cut icon for this
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[IMP] dashboard: automatically reorganize a sheet
This commit aims to simplify the process of creation of a dashboard
with two new features:
Both features are implemented in the
ReorganizeSheetPlugin
. Sendinga figure/range to a sheet works by finding the bottom-most used cell
in the sheet and placing the figure/range below it. "Used" cells are
cells that contains some content/a merge/a table/overlap a figure.
Reorganizing a sheet works by:
Technically the reorganization is done by creating new rows at the
bottom of the sheet, cut/paste the clusters correctly ordered in
these rows, and then delete the original rows. See Odoo task's pad
for why we do it this way.
[IMP] mergeContiguousZones: add test & fix diagonal
This commit moves the tests of mergeContiguousZones from Odoo
to o-spreadsheet.
It also fixes a bug where the algorithm was merging zones that were
diagonal to each other.
[REF] clipboard: decouple clipboards and active sheet
This commit make the clipboards handlers independent from the active
sheet, thus allowing to use them to copy/paste things in any sheet.
[IMP] clipboard: insert new rows when pasting charts
Currently, when pasting a chart at the edges of a sheet, the pasted
chart is shifted so that it doesn't go out of the sheet.
This commit changes the behaviour so that now the chart is always
pasted with its top-left corner at the top-left corner of the selection,
and insert new rows/columns if needed so that the chart fits in the
sheet.
Also take the occasion to factorize the code in common between the
chart clipboard and the image clipboard into the figure clipboard.
[IMP] clipboard: instanciate clipboards only once
This commit make the different clipboards instance attributes of the
Clipboard plugin, instead of being created each time a paste or copy
action is done.
This:
where each clipboard will have its own copied data, instead of
having a big copied data object shared between all clipboards.
[REF] clipboard: expose paste logic
This commit extract the logic of the paste operation of the
clipboard plugin into a new getter (
getPasteTarget
) and a new command(
EXPAND_SHEET_FOR_ZONE
) so that it can be reused in other parts of thecode.
[FIX] evaluation:
getEvaluatedCells
with spreading cellsThe getter
getEvaluatedCells
does't return spreaded cells. Italso returns empty evaluated cells that have some style.
This is not the expected behaviour.
getEvaluatedCells
should returnall the non-empty evaluated cells of a sheet.
Task: : 3869372
review checklist