PhiloBiblon / philobiblon-ui

PhiloBiblon UI
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

Edit url claims #35

Closed jmformenti closed 3 months ago

jmformenti commented 5 months ago

Validate that the value is a valid url. We can use something like:

function isValidUrl(string) {
  try {
    new URL(string);
    return true;
  } catch (err) {
    return false;
  }
}

Example: https://philobiblon.cog.berkeley.edu/wiki/Item:Q36563 (BETA insid 5284 -> Online Information)

Definition of done

  1. Given a url claim, only is accepted a valid value.
  2. In case of invalid url, we show an error and recover the old value.