-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Conversation
@brainzbot, retest this please |
0a8d644
to
ec80cb1
Compare
eb7a008
to
aba5623
Compare
aba5623
to
aefc32e
Compare
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.
Tested locally, works great.
import type { | ||
RelationshipStateT, | ||
} from '../types.js'; | ||
|
||
|
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.
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
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.
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
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.
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.
aefc32e
to
796a3d2
Compare
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 triggerurl.editsPending
).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.