Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed

Conversation

greyscaled
Copy link
Contributor

@greyscaled greyscaled commented Mar 19, 2022

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:

  • Port over ActionCell from v1, sans icons
  • This isn't a direct port; we used to have a map of icons on the FE, but we want to no longer 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.
  • 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:


Demo

Old

old-audit-log

New ActionCell (Storybook)

action-cell-storybook--failure
action-cell-storybook--success

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
@greyscaled greyscaled self-assigned this Mar 19, 2022
@greyscaled greyscaled requested a review from a team as a code owner March 19, 2022 00:09
greyscaled added a commit that referenced this pull request Mar 19, 2022
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
greyscaled added a commit that referenced this pull request Mar 20, 2022
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 => {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@greyscaled
Copy link
Contributor Author

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!

@greyscaled greyscaled closed this Mar 23, 2022
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
@ammario ammario deleted the vapurrmaid/472-action-cell branch August 3, 2022 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants