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

feat: add percentFormatter prop to PieWidgetUI #844

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

jantolg
Copy link
Contributor

@jantolg jantolg commented Mar 4, 2024

Description

Add to central text in PieChartUI the same text formatter

Acceptance

  1. Go to PieWidgetUI
  2. Add percentFormatter prop
  3. Check the central text and tootltip have the same format as you set

Copy link

github-actions bot commented Mar 4, 2024

Pull Request Test Coverage Report for Build 8157955159

Details

  • 8 of 10 (80.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 68.561%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/react-ui/src/widgets/PieWidgetUI/PieWidgetUI.js 3 5 60.0%
Totals Coverage Status
Change from base Build 8154306142: 0.002%
Covered Lines: 2630
Relevant Lines: 3493

💛 - Coveralls

Copy link

github-actions bot commented Mar 4, 2024

Visit the preview URL for this PR (updated for commit 0fb4914):

https://cartodb-fb-storybook-react-dev--pr844-feat-add-percent-r2b0bjhh.web.app

(expires Tue, 12 Mar 2024 14:36:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 517cc4d31d7e09cf277774e034094b67c301cd4c

@@ -281,6 +294,7 @@ PieWidgetUI.propTypes = {
colors: PropTypes.array,
formatter: PropTypes.func,
tooltipFormatter: PropTypes.func,
percentFormatter: PropTypes.func,
Copy link
Contributor

Choose a reason for hiding this comment

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

Export the new prop from types packages/react-ui/src/types.d.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@@ -49,6 +49,7 @@ function PieWidgetUI({
data = [],
formatter,
tooltipFormatter,
percentFormatter,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work also in ComparativePieWidget?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I didn't implement it in ComparativePieWidget, I could implement this feature in comparative mode, but maybe could be far away of the scope of this feature

Copy link
Contributor

Choose a reason for hiding this comment

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

If that's ok for you, no problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

ComparativePie Widget was indeed coming from PS, if I'm not wrong

Copy link
Contributor

@vmilan vmilan left a comment

Choose a reason for hiding this comment

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

LGTM, let's wait for @VictorVelarde review

Copy link
Contributor

@VictorVelarde VictorVelarde left a comment

Choose a reason for hiding this comment

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

👍🏻

Copy link
Contributor

@menusal menusal left a comment

Choose a reason for hiding this comment

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

LGTM - PS

@menusal menusal merged commit 50e81b8 into master Mar 5, 2024
2 checks passed
@VictorVelarde VictorVelarde deleted the feat/add-percent-formatter-pie-widget branch March 5, 2024 18:10
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.

4 participants