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

Refactor error handling in the external links editor

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:

                Packages

                Version Package