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

[MPDX-8542] Show support goal history in donations graph #1269

Open
wants to merge 14 commits into
base: health-indicator
Choose a base branch
from

Conversation

canac
Copy link
Contributor

@canac canac commented Feb 13, 2025

Description

Show the historical support goal in the donations graph.

Testing

Testing is a little bit complex because the donations graph shows up in multiple places and each place loads the data independently (it isn't loaded by the graph component itself), so we need to test each place the donations graph is rendered as a HI user and a non-HI user.

  • User without HI data
    • Go to the donations graph on the dashboard for a user without HI data. Check that the monthly goal is a straight line and is the value set in preferences.
    • Go to the donations graph on the donations report page for a user without HI data. Check that the monthly goal is a straight line and is the value set in preferences.
    • Go to the donations graph on the coaching page (viewing the user's own data) for a user without HI data. Check that the monthly goal is a straight line and is the value set in preferences.
    • Make the user coach Pedro and go to Pedro's coaching page (viewing Pedro's data as a coach). Check that the monthly goal line is the HI values for 2024 and is the current monthly goal preference for 2025.
  • User with HI data (Pedro)
    • Go to the donations graph on the dashboard for a user without HI data. Check that the monthly goal line is the HI values for 2024 and is the current monthly goal preference for 2025.
    • Go to the donations graph on the donations report page for a user without HI data. Check that the monthly goal line is the HI values for 2024 and is the current monthly goal preference for 2025.
    • Go to the donations graph on the coaching page (viewing the user's own data) for a user without HI data. Check that the monthly goal line is the HI values for 2024 and is the current monthly goal preference for 2025.
    • Make the user coach a user without HI data and go to that user's coaching page (viewing the non-UI user as Pedro). Check that the monthly goal is a straight line and is the value set in preferences.

MPDX-8542

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@canac canac added the Preview Environment Add this label to create an Amplify Preview label Feb 13, 2025
@canac canac requested a review from dr-bizz February 13, 2025 15:28
@canac canac self-assigned this Feb 13, 2025
Copy link
Contributor

Preview branch generated at https://8542-hi-support-goal-history.d3dytjb8adxkk5.amplifyapp.com

Copy link
Contributor

github-actions bot commented Feb 13, 2025

Bundle sizes [mpdx-react]

Compared against 480abb5

Route Size (gzipped) Diff
/accountLists/[accountListId] 275.84 KB +10.85 KB
/accountLists/[accountListId]/coaching/[coachingId] 253.72 KB +8.43 KB
/accountLists/[accountListId]/reports/coaching 253.68 KB +8.43 KB
/accountLists/[accountListId]/reports/donations/[[...contactId]] 346.94 KB +8.3 KB
/accountLists/[accountListId]/reports/healthIndicator 252.99 KB added

Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

This is looking great! Good work. I have a few questions.

  1. The coaching graph looked different than the other graph's, the goal was just a straight line rather being a dot with a line.

Coaching page:
Screenshot 2025-02-14 at 10 53 49 AM
Dashboard:
Screenshot 2025-02-14 at 10 53 56 AM

  1. It appears the goal on the graph is set to $6000, but the monthly goal is set to $7000. Is this correct?

@canac
Copy link
Contributor Author

canac commented Feb 14, 2025

  1. The coaching graph looked different than the other graph's, the goal was just a straight line rather being a dot with a line.

I removed the dots from the line.

  1. It appears the goal on the graph is set to $6000, but the monthly goal is set to $7000. Is this correct?

Yes, this is correct. It is graphing the staffEnteredGoal, which is $6000, while the machineCalculatedGoal is $7000.

@dr-bizz I also made some additional fixes and changes:

  • As a coach when viewing another user's donations, clicking on the donation graph would take you to your own donations page for that month. I changed it to do nothing. You can still click on a month on your own coaching report to go to the donations page.
  • For each period, if the staff entered goal is not available use the machine calculated goal instead.
  • Fixed the colors of the currency bars.
  • Show the goal legend in the card header when a goal is not set in preferences.

@canac canac requested a review from dr-bizz February 14, 2025 21:44
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

Looks awesome. Thank you for the improvments!

@canac canac force-pushed the 8542-hi-support-goal-history branch from 635201b to 74948b1 Compare February 18, 2025 17:09
@canac canac requested a review from dr-bizz February 18, 2025 22:48
@canac canac force-pushed the 8542-hi-support-goal-history branch from 96e2a30 to 2d34b21 Compare February 18, 2025 22:50
Copy link
Contributor

@dr-bizz dr-bizz left a comment

Choose a reason for hiding this comment

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

Thank you for making these improvements. I reviewed it again, and it looks great.

I have 1 question. It looks like when I removed the goal, the machine-calculated goal isn't showing on the graph. It should be the same currency, so it should show correct? This s probably me not understanding it correctly.

Screenshot 2025-02-21 at 9 38 52 AM

@canac
Copy link
Contributor Author

canac commented Feb 21, 2025

It looks like when I removed the goal, the machine-calculated goal isn't showing on the graph. It should be the same currency, so it should show correct?

The blue line is the staff-entered goal for each of the months in 2024. Because it has a staff-entered goal in the health indicator data it is using that and not falling back to the machine-calculated goal. The months in 2025 have no data because there is no health indicator data for them. I should extrapolate from the last known machine-calculated goal though to fill in those missing months.

@canac canac requested a review from dr-bizz February 21, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants