Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-11521

Refactor error handling in the external links editor

XMLWordPrintable

      https://github.com/metabrainz/musicbrainz-server/blob/abe40fc/root/static/scripts/edit/externalLinks.js#L240-L278 is messy and can be improved:

      • The isNewOrChangedLink check is repeated 6 times. We can use a nested "if" here.
      • We can factor out the parts that check only the URL or only the link type into separate functions & reduce the amount of inline logic inside the map.
      • One large "if" chain doesn't seem ideal. We should probably store and display the errors as a list, since multiple may apply at once.

            Unassigned Unassigned
            bitmap Michael Wiencek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Version Package