You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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:
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.
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.
The text was updated successfully, but these errors were encountered: