Skip to content

[FIX] OT: Fix chart commands OT #6078

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

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from
Open

[FIX] OT: Fix chart commands OT #6078

wants to merge 2 commits into from

Conversation

rrahir
Copy link
Collaborator

@rrahir rrahir commented Apr 10, 2025

Task: 4717724

Description:

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

Task: 4717724

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

@robodoo
Copy link
Collaborator

robodoo commented Apr 10, 2025

Pull request status dashboard

@rrahir rrahir force-pushed the 16.0-fix-ot-chart-rar branch from ce32653 to 3f27f7b Compare April 10, 2025 16:59
Currently, we transform chart ranges upon the addition/deletion of
headers in a sheet regardless if the range belongs to the said sheet.

e.g.
- given a chart with a range  A1:A3 on sheet1 and a second A1:A3  on sheet2
- delete a the second row of sheet1

Both ranges are transformed and set to A1:A2. There is a double issue
with the range on sheet2.
1. it's range zone is updated
2. the sheet prefix is removed, meaning that it no longer points towards
   the same sheet!

Task: 4717724
@rrahir rrahir force-pushed the 16.0-fix-ot-chart-rar branch from 3f27f7b to 1ef25b6 Compare April 10, 2025 17:06
Copy link
Contributor

@hokolomopo hokolomopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😔 sad day to be a command

Comment on lines 188 to +189
let dataRangeZone: UnboundedZone | undefined;
let sheetName: string | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let dataRangeZone: UnboundedZone | undefined;
let sheetName: string | undefined;
let newDataRange: string | undefined;

nitpick, that way we don't have to have two let variables hanging around

same in scorecard

@@ -100,6 +100,7 @@ export class ChartPlugin extends CorePlugin<ChartState> implements ChartState {
size: { width: fig.width, height: fig.height },
definition: chart.getDefinition(),
sheetId: cmd.sheetIdTo,
sheetMap: this.getters.getSheetMap(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about filtering the map with only relevant sheet name to reduce the size. Is it annoying/not necessary ?

@rrahir rrahir force-pushed the 16.0-fix-ot-chart-rar branch from 4306384 to 8112c7b Compare April 15, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants