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

MBS-12622: Show if URL / URL relationship has pending edits in links editor #2863

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

reosarevok
Copy link
Member

@reosarevok reosarevok commented Feb 23, 2023

Implement MBS-12622

Problem

We now show a small icon when a relationship has pending edits in the relationship editor (see #2858), but nothing is shown in the link editor if a URL relationship has pending edits. We should probably show an icon there (by each specific relationship under the link).

We don't show at the moment if the entity itself in the relationship has open edits, but we should probably still show something for URLs when the URL itself is being edited, at least, since that can sneakily make any relationships entered/changed wrong as soon as the edit applies.

Solution

This implements a tooltip in the same way as #2858. For URL relationships it literally reuses the code (I moved it to a reusable component). For pending URL edits it points to /url/mbid/open_edits, which is the best I could think of (I don't think we have a trivial way to see only the kinds of edits which trigger url.editsPending).

image_2023-06-13_144248456

I put this on top of #2901 now since that adds better icons we can reuse here rather than the warning icon.

Testing

Manually, by making open/votable changes to both a URL string and the dates on a URL relationship and making sure the warnings show (see image above) and the pending links point to the expected places.

@reosarevok reosarevok added the QoL Non-urgent quality of life improvements label Feb 23, 2023
@reosarevok
Copy link
Member Author

@brainzbot, retest this please

Copy link
Member

@mwiencek mwiencek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, works great.

import type {
RelationshipStateT,
} from '../types.js';


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is adding two newlines after the all the imports something you want to enforce with eslint? I don't mind either way but noticed you tend to add it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. I'm not sure I even do it consciously - I don't know if it's better and I might even rather enforce just one and stop me from doing this :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the extra lines here - seems import-js/eslint-plugin-import#1933 has been there for three years but is unmerged, so there's currently no exact option. Not sure if there's something we can do but I commented anyway.

We now show a special icon on the (non-URL) relationship editor
if a relationship that can be changed has (previous) pending edits.

This adds the same icon to the URL editor, where nothing
was being shown currently. This should help avoid unnecessary
URL removals when someone is already setting it as ended, for example.

The externalLinks code does slightly odd things to entity/relationship
data to put them into state, so flow typing here is pretty messy -
unsure if it can be improved without a proper refactoring
of the externalLinks component though.
If a URL is being edited, we should indicate it in the links editor.
This way it is possible to find out that, say, the URL you are adding
or changing the relationship for is actually going to change soon,
otherwise making your changes have unexpected consequences.
@reosarevok reosarevok merged commit 93d8363 into metabrainz:master Sep 18, 2023
1 of 2 checks passed
@reosarevok reosarevok deleted the MBS-12622 branch September 18, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QoL Non-urgent quality of life improvements
Projects
None yet
2 participants