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

Skip to content

Display audit log diffs in a git diff format #3607

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
5 tasks
Tracked by #3251
Kira-Pilot opened this issue Aug 19, 2022 · 0 comments · Fixed by #3782
Closed
5 tasks
Tracked by #3251

Display audit log diffs in a git diff format #3607

Kira-Pilot opened this issue Aug 19, 2022 · 0 comments · Fixed by #3782
Assignees
Labels
site Area: frontend dashboard

Comments

@Kira-Pilot
Copy link
Member

Kira-Pilot commented Aug 19, 2022

As a user, I would like to see audit log diffs so I understand what values have changed after certain events.

Audit RFC

Audit Mocks

Technical Considerations

This work is dependent upon the log scaffolded out in #3429. The expandable section detailed in that ticket will need to be created before it can be populated.

We can use react-diff-viewer to create the below audit diff visual:

Screen Shot 2022-08-19 at 3 55 16 PM

Only certain events should have a diff section - see below AC

AC

  • Populate the expandable section with diffs returned from /api/v2/audit

  • If a log event has no diffs (ex. a user logged in), there will be no expandable section. The top-level human-readable string would read something like “Alice Harvey logged in”. The human readable string will be returned from the back end.

  • If a log event has 1 diff (ex. a user edited the TTL on a workspace), there will be no expandable section. The top-level human-readable string would read something like ”Alice Harvey updated the TTL on ‘workspace-x’ from x to y.”

  • If a log event has multiple diffs (ex. a user edited multiple fields on a template), there will be an expandable section which can be toggled to reveal the diffs. The top level human-readable string would contain the first diff and read something like ”Alice Harvey renamed ‘template-a’ to ‘template-b”. The expandable diff section would contain additional diffs, e.g.

    [01] Updated name from template-a to template-b
    [02] Updated description from ‘foo’ to ‘bar’
  • Add tests and stories

Definition of Done

When I get diffs from the API,
then they are represented in a git diff in an expandable section.

@Kira-Pilot Kira-Pilot added feature site Area: frontend dashboard labels Aug 19, 2022
This was referenced Aug 19, 2022
@kylecarbs kylecarbs changed the title Feat: display audit log diffs in a git diff format Display audit log diffs in a git diff format Aug 24, 2022
@BrunoQuaresma BrunoQuaresma self-assigned this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site Area: frontend dashboard
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants