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

[IMP] custom color: handle all the chart colors #4967

Closed
wants to merge 1 commit into from

Conversation

hokolomopo
Copy link
Contributor

Description

The custom color plugin wasn't handling data series color, or chart title color. Now we run a regex through the whole chart definition to get all the colors, so we don't have to think to add new handling in the custom color plugin every time we add a chart customization.

Task: 4178763

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 Sep 11, 2024

Pull request status dashboard

@rrahir
Copy link
Collaborator

rrahir commented Sep 16, 2024

@robodoo r+

@rrahir
Copy link
Collaborator

rrahir commented Sep 16, 2024

@robodoo r-

Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

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

this.getChartColors(sheetId) in computeCustomColors is completely wrong 😝 (sheetId vs expected chartId).
It can be removed.
But actually, why are charts handled differently (not at finalize with the other stuff)?

src/plugins/ui_core_views/custom_colors.ts Outdated Show resolved Hide resolved
@hokolomopo
Copy link
Contributor Author

But actually, why are charts handled differently (not at finalize with the other stuff)?

Because it's way better performance-wise to not parse the chart every time we have some random command that triggers a finalize, but to only do that when we have a command that actually updates the chart.

Actually I think I'll do another commit to compute every color this way, the plugin does not care at all about the evaluation, so it make no sense to do things in the finalize ? (I guess there was some older version of this plugin where it mattered). And handling the commands separatly would be way better than looping on every cell at each command.

The custom color plugin wasn't handling data series color, or
chart title color. Now we run a regex through the whole chart
definition to get all the colors, so we don't have to think to add
new handling in the custom color plugin every time we add a
chart customization.

Task: 4178763
Copy link
Collaborator

@LucasLefevre LucasLefevre left a comment

Choose a reason for hiding this comment

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

robodoo r +

robodoo pushed a commit that referenced this pull request Sep 20, 2024
The custom color plugin wasn't handling data series color, or
chart title color. Now we run a regex through the whole chart
definition to get all the colors, so we don't have to think to add
new handling in the custom color plugin every time we add a
chart customization.

closes #4967

Task: 4178763
Signed-off-by: Lucas Lefèvre (lul) <[email protected]>
@robodoo robodoo closed this Sep 20, 2024
@robodoo robodoo added the 17.5 label Sep 20, 2024
@fw-bot fw-bot deleted the master-chart-custom-color-adrm branch October 4, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants