Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Improve validation message
Alexis Sellier committed 4 years ago
commit 316dfc1cb1574d7f8b1912dc0ace955ca021bfa1
parent 9d6d84859009ff37357853cf54654ad75ce7d80f
2 files changed +5 -5
modified src/Form.svelte
@@ -12,7 +12,8 @@
  }

  const validationTypes: { [index: string]: RegExp } = {
-
    url: /^(https:\/\/|http:\/\/|ipfs:\/\/)\S+/,
+
    URL: /^(https:\/\/|http:\/\/|ipfs:\/\/)\S+/,
+
    URN: /^[a-z]+:[a-zA-Z0-9:-]{1,64}$/,
    // Github
    //   Username may only contain alphanumeric characters or hyphens.
    //   Username cannot have multiple consecutive hyphens.
@@ -25,7 +26,6 @@
    handle: /^[a-zA-Z0-9-_]{1,39}$/,
    address: /^0x[a-zA-Z0-9]{40}$/,
    id: /^[a-z0-9]+$/,
-
    urn: /^[a-z]+:[a-zA-Z0-9:-]{1,64}$/,
    // Just make sure there is a TLD at the end.
    domain: /\.[a-z]{2,}$/,
  };
modified src/base/registrations/View.svelte
@@ -66,10 +66,10 @@
              + "a reverse record should be set."
          ),
          value: r.profile.address, editable: true },
-
        { name: "url", label: "URL", validate: "url", placeholder: "https://acme.org",
+
        { name: "url", label: "URL", validate: "URL", placeholder: "https://acme.org",
          description: "A homepage or other URL associated with this name.",
          value: r.profile.url,editable: true },
-
        { name: "avatar", validate: "url", placeholder: "https://acme.org/avatar.png",
+
        { name: "avatar", validate: "URL", placeholder: "https://acme.org/avatar.png",
          description: "An avatar or square image associated with this name.",
          value: r.profile.avatar, editable: true },
        { name: "twitter", validate: "handle", placeholder: "Twitter username, eg. 'acme'",
@@ -86,7 +86,7 @@
        { name: "seed.id", label: "Seed ID", validate: "id", placeholder: "hynkyndc6w3p8urucakobzncqny7xxtw88...",
          description: "The Device ID of a Radicle Link node that hosts entities associated with this name.",
          value: r.profile.seedId, editable: true },
-
        { name: "anchors", label: "Anchors", validate: "urn", placeholder: "URN, eg. eip155:1:0x4a9cf21...",
+
        { name: "anchors", label: "Anchors", validate: "URN", placeholder: "URN, eg. eip155:1:0x4a9cf21...",
          description: "URN under which associated project anchors can be found. "
            + "To point to a Radicle org on Ethereum, use the CAIP-10 ID, eg. *eip155:1:0x4a9cf21...*",
          value: r.profile.anchorsAccount, editable: true },