MBS-7538: Make it possible to edit URL relationship attributes again
mwiencek
Branch: mwiencek/musicbrainz-server:mbs-7538
Branch: metabrainz/musicbrainz-server:beta
Merged
Merged pull request
Merge remote-tracking branch 'bitmap/mbs-7538' into beta
Merge remote-tracking branch 'bitmap/mbs-7538' into beta
This patch does what the title says, mostly by moving code around more than anything. Firstly, the JS classes used to store relationships had a weird hierarchy with
MB.relationshipEditor.fields.Relationship
andMB.Control.externalLinks.Relationship
both inheriting fromMB.entity.Relationship
. Since the external links one needs to support attributes now, I just merged the MB.entity one into the relationshipEditor one, and had the externalLinks one inherit from that.To get the UI to work, all I did was factor out the part of the relationship editor dialog used to render attribute fields into its own template, and added it underneath the URL fields that have attributes (just the video attribute currently). Then it magically works, since both UIs use the same relationship class now.
I couldn't find a non-terrible way to allow editing dates through the external links editor, so I added a mini-relationship-editor to the URL edit page. Which seems to work just fine after applying the relevant roles, although I couldn't use Form::Role::Relationships on Form::URL because they have a conflicting field name (url).