-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
FIX(Revision): "New" badge appears in entity deletion revision #602
Conversation
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.
Great, that's a good improvement!
I think it would be great to take that opportunity to mark deleted entities with a Deleted
badge with a red background, now that you've got that piece of info in your logic.
I guess the cleanest would be to pass a new isDeletion
property.
What do you think?
Co-authored-by: Monkey Do <MonkeyDo@users.noreply.github.com>
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.
Yes, that's nice, thanks for adding that :)
Co-authored-by: Monkey Do <MonkeyDo@users.noreply.github.com>
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.
OK, this is starting to look really nice!
I went and deployed this PR to test.bookbraine.org so that we can do some testing on a common space.
It's working pretty well and showing the right badges where expected most of the time, but I did find a couple of issues:
If the entity has been merged into another entity, it will display the "deleted" badge, because for merges we also remove the dataId of any merged entity (apart from the one we are merging into).
I think it should be relatively easy to make another "merged" badge (and perhaps that will entirely replace the current way we display merged entities in a revision. That's for another PR)
An example of that: https://test.bookbrainz.org/revision/29798
In another case, I deleted an entity that had some previous revisions, and it appears with the "new" badge instead of "deleted". Not sure what is happening here:
https://test.bookbrainz.org/revision/29849
I deleted the entity 6ef597ce-9f15-4c91-ae8d-83c18a0c6797
and nothing else in that revision and the database seems to reflect that correctly:
Ok sure will open a PR for
Yeah thanks for reporting it. I have made required changes and it seems to work fine now |
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.
All working fine now, thank you ! :)
Problem
This PR Fixes: BB-523
Solution
Refactored the
isNew
property logic in server/routes/revision.js by taking advantage ofdataId
( which is null for a deleted entity)Before
After
Areas of Impact
server/routes/revision.js