-
Notifications
You must be signed in to change notification settings - Fork 886
feat(site): add ActionCell component #500
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(site): add ActionCell component #500
Conversation
Summary: This is a direct follow-up to #484 and a next step in porting over the AuditLog with appropriate refactoring. This isn't a direct port; we used to have a map of icons on the FE, but we want to no loner split the logic between FE and BE. If we want icons at a later time point, we can return an icon identifier in the response, or we can simplify the view and gain real estate by omitting the icons. At the time of this commit, I prefer omitting the icons. Details: - Port over ActionCell from v1, sans icons - Add tests and stories for ActionCell Impact: This change does not have any user-facing impact yet, because the ActionCell is not yet rendered in the product. This enables an incremental approach to migrating in the FE of the Audit Log, which is still waiting on the BE port. Relations: - This commit relates to #472, but does not finish it. - This commit should not merged until after #484 because it's based from it
Summary: This is a direct follow-up to #484 and #500. It is a part of many steps in porting/refactoring the AuditLog from v1. Details: - Port over TargetCell from v1, with refactorings - Add tests and stories Impact: This change does not have any user-facing impact yet because AuditLog is not yet available in the product. This is part of an incremental approach; the FE is still waiting on the BE port. Relations: - This commit relates to #472, but does not finish it - This commit should not be merged until after #484 and #500, because it builds off of them.
The old AuditLog had bad use of screen real estate. This change merges the old status cell (that had a large chip) with the action cell. These two cells seem related (wanting to see the action and whether or not it was successful in one spot). NTS: squash this message in before merge
Summary: This is direct follow-up to #484, #500, and #501. It is a part of many steps in porting/refactoring the AuditLog from v1. Details: - Port over TimeCell from v1, with refactorings - A jest test was not added because we use locale dates and times, which can be tricky to test. This can be addressed in the future. Impact: This change does not have any user-facing impact yet because AuditLog is not yet available in the product. This is part of an incremental approach; the FE is still waiting on the BE port. Relations: - This commit relates to #472, but does not finish it - This commit should not be merged until after #484, #500 and #501, because it builds off of them
* | ||
* @throws Error if invalid | ||
*/ | ||
export const validate = (props: ActionCellProps): ActionCellProps => { |
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.
Interesting pattern! Is the idea that static typechecking isn't enough because we're getting the action from the backend? Looks like it's just checking that the action is non-empty, is that right?
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.
Yea, that's the idea (not sure if good usage here). The v2 RFC states that we should be throwing errors if we are missing information, so that we find it immediately. The idea is that previously there were bugs whereby a partial audit log was produced either from the FE missing a mapping or, on the BE, the resource, action or target was incorrect. Because of the nature of what audit logs represent, the idea is fail fast.
I don't know if I did it correctly here yet, as the BE port is not even started - my hope is that these designs will need minimal adjustment once the BE port is available. I have an idea of what it will look like, but there is not yet an interface/contract/stub to work from.
Closing for now because the timing of when the AuditLog will land is down the road. We can always re-open at the appropriate time! |
Summary:
This is a direct follow-up to #484 and a next step in porting over the AuditLog with appropriate refactoring. The old "StatusCell" was merged with "ActionCell", and the icon mapping was omitted.
Details:
Impact:
This change does not have any user-facing impact yet, because the
ActionCell is not yet rendered in the product. This enables an incremental
approach to migrating in the FE of the Audit Log, which is still waiting
on the BE port.
Relations:
it
Demo
Old
New ActionCell (Storybook)