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] charts: improve runtime generation lisibility #5105

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hokolomopo
Copy link
Contributor

Description:

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

Task: TASK_ID

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

The code that ensure that the the trend lines points in a chart have
no tooltip title is uselessly complex, with reference to some
"originalTooltipTitle" and a //@ts-expect-error.

In fact, originalTooltipTitle is almost always undefined, except for
linear charts where it's a simple callback that return an empty string.

This commit simplifies the code, removing the obscure reference to
"originalTooltipTitle" and the //@ts-expect-error. The callback now
simply returns an empty string where we do not want a title, and
undefined if we want to let ChartJs do it's thing.

Task: 4269632
@robodoo
Copy link
Collaborator

robodoo commented Oct 21, 2024

Pull request status dashboard

The trend line of area charts should not have a filled area under
the line.

Also the trend line configuration should probably not inherit all the
values of their parent dataset, as it's easy to miss thing and have
options that make no sense (pointBackgroundColor being the color
of the parent dataset rather than the color of the trend line for
example).

Task: 4274294
This commit removes the test `creating chart with single dataset should
have legend position set as none, followed by changing it to top`.

The test is bad because:
- contrary to what the test name suggests, the first thing it does is
creating a chart with TWO dataset
- it test that legend.display is undefined which suggest that there is
no legend, but chartJS default is to display the legend when this
property is undefined. So the chart actually has a legend.
- the last thing it does is ... testing that the legend is updated when
the chart is updated ? I'm not sure how it relates with the supposed
first part, and it's already tested elsewhere
- it also does an useless and random nextTick(), on a test with zero UI
elements nor async code

Task: ?
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.

2 participants