-
Notifications
You must be signed in to change notification settings - Fork 1
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-8022 - Fix Send Newsletter: Contact Status Display Value #977
Conversation
Preview branch generated at https://MPDX-8022-fix-newsletter-status.d3dytjb8adxkk5.amplifyapp.com |
I tried using Ergonomock for the test here, but I couldn't get it to use my value overrides on contact status, so I just mocked the hook instead. |
Bundle sizes [mpdx-react]Compared against 6764d70 No significant changes found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. The only update I see needing to be done is you could use the UseApiConstants hook to grab the constants here instead of adding constants to your query. src/components/Constants/UseApiConstants.tsx
constant { | ||
...Status | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the UseApiConstants hook to grab the constants here instead of adding constants to your query. src/components/Constants/UseApiConstants.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about doing that. The reason I didn't was performance. If I understand GraphQL correctly, this should grab only the statuses from the API (which probably takes it from the database) while not requesting the rest of the constants, thus saving 12 more database calls on the back-end. This way of doing it would also mean 1 HTTP request instead of 2. Perhaps it is not worth saving that processing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. It would be faster to just grab just the statuses, unless UseApiConstants has been called before causing it to be cached. Otherwise, you're correct.
It's hard to know if it's been called before, so I'm good with you leaving it the way it is if you want.
When you start using the |
Approving to not be a blocker |
Description
This PR updates the display of contact status to the friendly name instead of the enum id.
Checklist: