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: keep and disable useless dataseries for pyramid chart #5782

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anhe-odoo
Copy link
Contributor

Task Description

Currently, when creating a pyramid chart with more than two data series, we are removing the unused ones, which lead to a loss of data series when switching back to another chart type.

This PR aims to change this behavior, by keeping all the data series but keeping only the first two in the runtime, and showing the redondant series as disabled in the config panel.

Related Task

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 Feb 21, 2025

Pull request status dashboard

@anhe-odoo anhe-odoo force-pushed the master-chart-keep_and_disabled_useless_dataseries-anhe branch 2 times, most recently from d3539fe to c963e50 Compare February 24, 2025 13:33
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.

🤟

Comment on lines 146 to 148
nextProps.enabled?.join() !== this.props.enabled?.join() &&
nextProps.enabled?.join() !== this.store.enabled.join()
Copy link
Contributor

Choose a reason for hiding this comment

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

deepEquals instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got a stacktrace with deepEquals when running the tests :/

@anhe-odoo anhe-odoo force-pushed the master-chart-keep_and_disabled_useless_dataseries-anhe branch 2 times, most recently from 7c0c0a7 to b19ddd8 Compare March 5, 2025 08: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.

boup boup 🤖

@anhe-odoo anhe-odoo force-pushed the master-chart-keep_and_disabled_useless_dataseries-anhe branch from b19ddd8 to 04c9172 Compare March 10, 2025 15:41
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.

Functional question: should be we able to edit the unused ranges ? ATM when adding a third range to a pyramid, we can edit the input, then after pressing confirm it's impossible to edit the range value. And when editing the selection input, the disabled ranges are not colored, but still have colored highlights in the grid.

I don't have strong feelings on this, I think it's fine as it, but it probably deserves a discussion with a "po".

@anhe-odoo anhe-odoo force-pushed the master-chart-keep_and_disabled_useless_dataseries-anhe branch from 04c9172 to bf41eaf Compare March 12, 2025 09:23
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.

Some nitpicks/small things, otherwise LGTM :)

@@ -25,11 +29,13 @@
t-on-keydown="onKeydown"
t-att-value="range.xc"
t-att-style="getColor(range)"
t-att-title="range.disabled ? props.disabledTitle : ''"
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
t-att-title="range.disabled ? props.disabledTitle : ''"
t-att-title="range.disabled ? props.disabledTitle : undefined"

nitpick. I think this avoids having empty title in the HTML and having to change the snapshots

@@ -47,6 +50,8 @@ interface Props {
onSelectionRemoved?: (index: number) => void;
onSelectionConfirmed?: () => void;
colors?: Color[];
disabledRanges?: boolean[];
disabledTitle?: string;
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
disabledTitle?: string;
disabledRangeTitle?: string;

nitpick. Probably a bit better ?

Task Description

Currently, when creating a pyramid chart with more than two data series,
we are removing the unused ones, which lead to a loss of data series
when switching back to another chart type.

This PR aims to change this behavior, by keeping all the data series but
keeping only the first two in the runtime, and showing the redundant
series as disabled in the config panel.

Related Task

Task: 4570622
@anhe-odoo anhe-odoo force-pushed the master-chart-keep_and_disabled_useless_dataseries-anhe branch from bf41eaf to 46972d3 Compare March 17, 2025 13:54
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