Refactor error handling in the external links editor

XMLWordPrintable

    • City

      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.

            Assignee:
            Michael Wiencek
            Reporter:
            Michael Wiencek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2026-04-27