-
Notifications
You must be signed in to change notification settings - Fork 236
MNTOR-3396 - Organize storybook dashboard states #5308
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
Conversation
This removes the `Breach` type in functions/universal/breaches, which was created when first introducing TypeScript and the flow of data was still unclear, but by now had overlap with other types and no clear provenance. Instead, there are now three breach-related types, that represent where the data came from: - HibpGetBreachesResponse: this is an array of breach elements as returned from the HIBP API, unprocessed. Properties are in PascalCase, so are a breach's data classes. - BreachRow: this is a breach's data as stored in our database, along with some data we added to it, such as a favicon URL. Properties are snake_case, and data classes are lowercased and kebab-cased by the formatDataClassesArray function. - HibpLikeDbBreach: this is a breach's data fetched from the database, but stored in an object meant to look like the ones in HibpGetBreachesResponse. In other words, it contains the same data as BreachRow (including lowercased, kebab-cased data classes), but on PascalCase properties. The latter is somewhat of a historical artefact, because we used to try to load breaches from our database, then if our database didn't contain any breaches yet, fetch them live from the HIBP API and continue working with that. We no longer do that: now, even after fetching them from the HIBP API, we do a new query to get them from the database and process them into HibpLikeDbBreach, so that we can assume a consisent data structure everywhere we work with breaches.
Preview URL 🚀 : https://blurts-server-pr-5308-mgjlpikfea-uk.a.run.app |
2 similar comments
Preview URL 🚀 : https://blurts-server-pr-5308-mgjlpikfea-uk.a.run.app |
Preview URL 🚀 : https://blurts-server-pr-5308-mgjlpikfea-uk.a.run.app |
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.
There are multiple duplicate variables in the Dashboard*.stories.ts
files that we can consolidate as well as some duplicate button stories that we should delete.
...react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/DashboardNonUSUsers.stories.tsx
Outdated
Show resolved
Hide resolved
...react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/DashboardNonUSUsers.stories.tsx
Outdated
Show resolved
Hide resolved
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 file is also a duplicate of Button.stories.ts
and can be removed.
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.
For Radio
and Checkbox
, I'll open a separate PR that breaks those components out of AlertAddressForm.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.
Removed in 3bb7901
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.
As discussed we are waiting for the settings page redesign to land with the new inputs.
Preview URL 🚀 : https://blurts-server-pr-5308-mgjlpikfea-uk.a.run.app |
...p/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/dashboard/Dashboard.stories.tsx
Show resolved
Hide resolved
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.
Thank you and great job breaking those stories out!
Cleanup completed - database 'blurts-server-pr-5308' destroyed, cloud run service 'blurts-server-pr-5308' destroyed |
References:
Jira: MNTOR-3395
Figma:
Description
Screenshot (if applicable)
Not applicable.
How to test
Checklist (Definition of Done)