Skip to content
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

Merged
merged 9 commits into from
Apr 26, 2021

Conversation

akashgp09
Copy link
Contributor

@akashgp09 akashgp09 commented Apr 18, 2021

Problem

This PR Fixes: BB-523

Solution

Refactored the isNew property logic in server/routes/revision.js by taking advantage of dataId( which is null for a deleted entity)

Before

Screenshot from 2021-04-18 21-39-58

After

Screenshot from 2021-04-18 21-39-19

Areas of Impact

server/routes/revision.js

@coveralls
Copy link

coveralls commented Apr 18, 2021

Coverage Status

Coverage decreased (-0.04%) to 60.856% when pulling 941c3a3 on akashgp09:revision-diff into 8a3c5d8 on bookbrainz:master.

Copy link
Member

@MonkeyDo MonkeyDo left a 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?

src/server/routes/revision.js Outdated Show resolved Hide resolved
@akashgp09
Copy link
Contributor Author

Added the deleted badge to mark deleted entitites. Let me know if any changes are required :)

Screenshot from 2021-04-19 19-08-31

@akashgp09 akashgp09 requested a review from MonkeyDo April 19, 2021 13:55
Copy link
Member

@MonkeyDo MonkeyDo left a 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 :)

src/server/routes/revision.js Outdated Show resolved Hide resolved
src/server/routes/revision.js Outdated Show resolved Hide resolved
akashgp09 and others added 2 commits April 19, 2021 21:06
Co-authored-by: Monkey Do <MonkeyDo@users.noreply.github.com>
Copy link
Member

@MonkeyDo MonkeyDo left a 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:
image

@akashgp09
Copy link
Contributor Author

akashgp09 commented Apr 20, 2021

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)

Ok sure will open a PR for mergedbadge to mark merged entities once this PR gets merged.

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.

Yeah thanks for reporting it. I have made required changes and it seems to work fine now

Screenshot from 2021-04-20 08-37-29

@akashgp09 akashgp09 requested a review from MonkeyDo April 20, 2021 03:13
Copy link
Member

@MonkeyDo MonkeyDo left a 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 ! :)

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