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

CMDCT-2794 (Pt. I): Setup MCR w/ Zustand for State Management #11518

Closed
wants to merge 9 commits into from

Conversation

karla-vm
Copy link
Collaborator

@karla-vm karla-vm commented Nov 13, 2023

Description

Converting the state management of MCR from Context API to Zustand (following the patterns implemented in MFP).

This PR covers the initial setup:

  • Installation of Zustand in MCR
  • Test mocks for Zustand
  • UserProvider + corresponding tests

Related ticket(s)

CMDCT-2784


How to test

Running this locally, you should be able to log in / log out from MCR as expected.

Optionally: install the Redux Devtools Chrome extension or the Firefox Redux Devtools extension

  • Open devtools
  • Log in

You should see the user object and a few other initial states on the extension ✨

Important updates

cd services/ui-src yarn install


Author checklist

  • I have performed a self-review of my code
  • I have added thorough tests, if necessary
  • I have updated relevant documentation, if necessary

convert to a different template: test → val | val → prod

@karla-vm karla-vm self-assigned this Nov 13, 2023
@karla-vm karla-vm added the ready for review Ready for all the reviews! label Nov 14, 2023
@karla-vm karla-vm changed the title CMDCT-2794: Setup MCR w/ Zustand for State Management CMDCT-2794 (Pt. I): Setup MCR w/ Zustand for State Management Nov 14, 2023
@karla-vm karla-vm marked this pull request as ready for review November 14, 2023 18:35
@karla-vm karla-vm requested a review from gmrabian November 16, 2023 16:47
gmrabian
gmrabian previously approved these changes Nov 16, 2023
Copy link
Contributor

@gmrabian gmrabian left a comment

Choose a reason for hiding this comment

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

app starts up, old context stuff works (like admin banner), no console errors

britt-mo
britt-mo previously approved these changes Nov 16, 2023
Copy link
Contributor

@britt-mo britt-mo left a comment

Choose a reason for hiding this comment

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

worked as expected in browser

@karla-vm karla-vm dismissed stale reviews from gmrabian and britt-mo via d57cfbc November 17, 2023 16:58
Copy link

codeclimate bot commented Nov 17, 2023

Code Climate has analyzed commit d57cfbc and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 94.7% (90% is the threshold).

This pull request will bring the total coverage in the repository to 95.8% (0.0% change).

View more on Code Climate.

@karla-vm karla-vm closed this Nov 17, 2023
@karla-vm karla-vm deleted the zustand-2974 branch April 17, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Ready for all the reviews!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants