Remove entity label from audit log and look up info in database #959
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backend part of issue #822
Frontend PR here (Makes small change on frontend to look up
label
from a new place.)In the same way we look up current information about a submission when we get audit log events for a specific entity (so we can appropriately handle deleted submissions), this does the same thing for entity information.
Previously, the details for an event like
entity.create
contained anentity
object withuuid
,dataset
, andlabel
.label
has been removed, so the audit details only containuuid
anddataset
but default.But through the
getBySubmissionId
query, for events about entities,details.entity
contains entity data populated from the database. This object has the same structure you'd see elsewhere in the API for getting details about anentity
, but with the additionaldataset
property that was already in the audit event details.If the entity has been soft deleted or purged, OR if the request is NOT EXTENDED, the details will look like this (closer to how they looked before but now without
label
):What has been done to verify that this works as intended?
Tests.
Why is this the best possible solution? Were any other approaches considered?
Follows a similar pattern as submission events for entities. Adds more useful info.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Going to make a change on frontend so deleted entities are displayed differently and dont have broken links.
Does this change require updates to the API documentation? If so, please update docs/api.md as part of this PR.
I think this kind of detail about audit log event details isn't documented.
Before submitting this PR, please make sure you have:
make test-full
and confirmed all checks still pass OR confirm CircleCI build passes