diff --git a/package-lock.json b/package-lock.json index 3c00cfca3..c70736ffe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,471 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/cli": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.6.4.tgz", + "integrity": "sha512-tqrDyvPryBM6xjIyKKUwr3s8CzmmYidwgdswd7Uc/Cv0ogZcuS1TYQTLx/eWKP3UbJ6JxZAiYlBZabXm/rtRsQ==", + "dev": true, + "requires": { + "chokidar": "^2.1.8", + "commander": "^2.8.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "lodash": "^4.17.13", + "mkdirp": "^0.5.1", + "output-file-sync": "^2.0.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "glob": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", + "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "optional": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "optional": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "optional": true + }, + "output-file-sync": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", + "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "is-plain-obj": "^1.1.0", + "mkdirp": "^0.5.1" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, "@babel/code-frame": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", @@ -5507,27 +5972,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "resolved": false, "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, @@ -5538,15 +6004,17 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5554,39 +6022,42 @@ }, "chownr": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "resolved": false, "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "resolved": false, "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, @@ -5596,28 +6067,28 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "resolved": false, "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "resolved": false, "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -5627,14 +6098,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -5651,7 +6122,7 @@ }, "glob": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "resolved": false, "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "optional": true, @@ -5666,14 +6137,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "resolved": false, "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, @@ -5683,7 +6154,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "resolved": false, "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -5693,7 +6164,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -5704,53 +6175,58 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "resolved": false, "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -5758,7 +6234,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "resolved": false, "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "optional": true, @@ -5768,23 +6244,24 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "resolved": false, "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "resolved": false, "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, @@ -5796,7 +6273,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", + "resolved": false, "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, @@ -5815,7 +6292,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "resolved": false, "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -5826,14 +6303,14 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "resolved": false, "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", + "resolved": false, "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, @@ -5844,7 +6321,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -5857,43 +6334,45 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -5904,21 +6383,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "resolved": false, "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "resolved": false, "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, @@ -5931,7 +6410,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": false, "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -5940,7 +6419,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": false, "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -5956,7 +6435,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "resolved": false, "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "optional": true, @@ -5966,50 +6445,52 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "resolved": false, "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6018,7 +6499,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": false, "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -6028,23 +6509,24 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "resolved": false, "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "optional": true, @@ -6060,14 +6542,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "resolved": false, "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, @@ -6077,15 +6559,17 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "resolved": false, "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", - "dev": true + "dev": true, + "optional": true } } }, @@ -6347,9 +6831,9 @@ } }, "google-libphonenumber": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.3.tgz", - "integrity": "sha512-8n4JyRptifaIRlHANKRlfqLR8fANm7+Q+1qvDuUsUeStSLtLGTVsZWe1llWDfgWTm1y07cEUyiRuNIv6cs2ovg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.5.tgz", + "integrity": "sha512-Y0r7MFCI11UDLn0KaMPBEInhROyIOkWkQIyvWMFVF2I+h+sHE3vbl5a7FVe39td6u/w+nlKDdUMP9dMOZyv+2Q==", "dev": true }, "graceful-fs": { @@ -13583,9 +14067,9 @@ "dev": true }, "react-modal": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.8.2.tgz", - "integrity": "sha512-wxNk94wy/DMh2LyJa8K+LyOQDhQfhKuBrZ4SxS091p75cpW+STfY+9GpAuvl6P6Yt2r/+wxYH8Z3G5Ww/L8Tiw==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.10.1.tgz", + "integrity": "sha512-2DKIfdOc8+WY+SYJ/xf/WBwOYMmNAYAyGkYlc4e1TCs9rk1xY4QBz04hB3UHGcrLChh7ce77rHAe6VPNmuLYsQ==", "dev": true, "requires": { "exenv": "^1.2.0", @@ -14573,6 +15057,12 @@ "tslib": "^1.9.0" } }, + "scratch-gui": { + "version": "0.1.0-prerelease.20191017152632", + "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191017152632.tgz", + "integrity": "sha512-9keW+Lrj2KcMOpd6iAbjFYfEjY0h8bRpTJkwosAVD99u14j77sSOHd3sZosKJrc2XyysZyZdDInbNuTsYuF4tw==", + "dev": true + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -15076,476 +15566,21 @@ } }, "scratch-gui": { - "version": "0.1.0-prerelease.20191017152632", - "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191017152632.tgz", - "integrity": "sha512-9keW+Lrj2KcMOpd6iAbjFYfEjY0h8bRpTJkwosAVD99u14j77sSOHd3sZosKJrc2XyysZyZdDInbNuTsYuF4tw==", + "version": "0.1.0-prerelease.20191022134757", + "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191022134757.tgz", + "integrity": "sha512-nBFWGaJLV6GrAz+eMBHAOC/z8ImGo050A1JnqdgKgf6XxoLDh4XbdebQ2aDVe2TWhPkG8TlYuwAt6AigixYhqA==", "dev": true }, "scratch-l10n": { - "version": "3.6.20191008224547", - "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191008224547.tgz", - "integrity": "sha512-J6AgB6oB+/ibamUNeyTdtSvkPzJchiD50xoUqzzlcPOv+AWOFSTOakGPzJnGE6/WeZ0njBThvy1rh23lamqiow==", + "version": "3.6.20191015223749", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191015223749.tgz", + "integrity": "sha512-hVujIj2kLg2dsk9/3ALksl4ZiLmNbsypH/Mp4nAgeJkDMmlaOR1V8TKn9K9X6O9R6xI8cyJHfmhShdf/8COpXg==", "dev": true, "requires": { "@babel/cli": "^7.1.2", "@babel/core": "^7.1.2", "babel-plugin-react-intl": "^3.0.1", "transifex": "1.6.6" - }, - "dependencies": { - "@babel/cli": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.6.4.tgz", - "integrity": "sha512-tqrDyvPryBM6xjIyKKUwr3s8CzmmYidwgdswd7Uc/Cv0ogZcuS1TYQTLx/eWKP3UbJ6JxZAiYlBZabXm/rtRsQ==", - "dev": true, - "requires": { - "chokidar": "^2.1.8", - "commander": "^2.8.1", - "convert-source-map": "^1.1.0", - "fs-readdir-recursive": "^1.1.0", - "glob": "^7.0.0", - "lodash": "^4.17.13", - "mkdirp": "^0.5.1", - "output-file-sync": "^2.0.0", - "slash": "^2.0.0", - "source-map": "^0.5.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true, - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "optional": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "optional": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "optional": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "optional": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "optional": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true, - "optional": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "optional": true - }, - "output-file-sync": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", - "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "is-plain-obj": "^1.1.0", - "mkdirp": "^0.5.1" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - } } }, "scratch-parser": { diff --git a/package.json b/package.json index 688861d94..59c910770 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "formsy-react-components": "1.0.0", "git-bundle-sha": "0.0.2", "glob": "5.0.15", - "google-libphonenumber": "3.2.3", + "google-libphonenumber": "3.2.5", "html-webpack-plugin": "2.22.0", "iso-3166-2": "0.4.0", "jest": "^23.6.0", @@ -115,7 +115,7 @@ "react": "16.2.0", "react-dom": "16.2.0", "react-intl": "2.8.0", - "react-modal": "3.8.2", + "react-modal": "3.10.1", "react-onclickoutside": "6.7.1", "react-redux": "5.0.7", "react-responsive": "3.0.0", diff --git a/src/_colors.scss b/src/_colors.scss index cc0d46c71..5401a6541 100644 --- a/src/_colors.scss +++ b/src/_colors.scss @@ -28,8 +28,9 @@ $background-color: hsla(0, 0, 99, 1); //#FDFDFD $ui-aqua: hsla(163, 85, 40, 1); // #0FBD8C Extension Primary $ui-purple: hsla(260, 100, 70, 1); // #9966FF Looks Primary $ui-purple-dark: hsla(260, 60, 60, 1); // #774DCB Looks Secondary +$ui-magenta: hsla(300, 53%, 60%, 1); /* #CF63CF Sounds Primary */ -$ui-yellow: hsla(45, 100, 50, 1); // #FFBF00 Control Primary +$ui-yellow: hsla(45, 100, 50, 1); // #FFBF00 Events Primary $ui-coral: hsla(350, 100, 70, 1); // #FF6680 More Blocks Primary $ui-coral-dark: hsla(350, 100, 60, 1); // #FF3355 More Blocks tertiary @@ -63,3 +64,4 @@ $link-blue: $ui-blue; /* Down Deep */ $dd-darkblue: hsla(195, 72.4, 17.1, 1); +$dd-medium-blue: hsla(195, 72.4, 42, .65); diff --git a/src/components/errorboundary/errorboundary.jsx b/src/components/errorboundary/errorboundary.jsx index 90bd7b368..a1c320e36 100644 --- a/src/components/errorboundary/errorboundary.jsx +++ b/src/components/errorboundary/errorboundary.jsx @@ -17,6 +17,10 @@ class ErrorBoundary extends React.Component { componentDidCatch (error, errorInfo) { // Display fallback UI Sentry.withScope(scope => { + scope.setTag('project', 'scratch-www'); + if (this.props.componentName) { + scope.setTag('component', this.props.componentName); + } Object.keys(errorInfo).forEach(key => { scope.setExtra(key, errorInfo[key]); }); @@ -46,7 +50,8 @@ class ErrorBoundary extends React.Component { } } ErrorBoundary.propTypes = { - children: PropTypes.node + children: PropTypes.node, + componentName: PropTypes.string }; module.exports = ErrorBoundary; diff --git a/src/components/formik-forms/formik-radio-button.jsx b/src/components/formik-forms/formik-radio-button.jsx index b7ee7f488..4d131ba52 100644 --- a/src/components/formik-forms/formik-radio-button.jsx +++ b/src/components/formik-forms/formik-radio-button.jsx @@ -89,8 +89,12 @@ const FormikRadioButton = ({ > {isCustomInput && ( onSetCustom(event.target.value)} diff --git a/src/components/formik-forms/formik-radio-button.scss b/src/components/formik-forms/formik-radio-button.scss index c178cf630..14db86c68 100644 --- a/src/components/formik-forms/formik-radio-button.scss +++ b/src/components/formik-forms/formik-radio-button.scss @@ -39,7 +39,7 @@ input[type="radio"].formik-radio-button { input.formik-radio-input, .formik-radio-input input { height: 2.1875rem; - width: 10.25rem; + width: 100%; margin-bottom: 0; border-radius: .5rem; background-color: $ui-white; @@ -52,6 +52,7 @@ input.formik-radio-input, .formik-radio-input input { .formik-radio-input-wrapper { margin-left: auto; margin-right: .25rem; + width: 10.25rem; } .formik-radio-label-other { diff --git a/src/components/intro/intro.jsx b/src/components/intro/intro.jsx index f786105cb..a9d31fd19 100644 --- a/src/components/intro/intro.jsx +++ b/src/components/intro/intro.jsx @@ -44,12 +44,12 @@ class Intro extends React.Component { {this.props.messages['intro.join']} - + {this.state.videoOpen ? @@ -77,7 +77,7 @@ class Intro extends React.Component { } - + ({ }); const mapDispatchToProps = dispatch => ({ - handleOpenRegistration: event => { + handleClickRegistration: event => { event.preventDefault(); - dispatch(navigationActions.setRegistrationOpen(true)); + dispatch(navigationActions.handleRegistrationRequested()); } }); diff --git a/src/components/join-flow/birthdate-step.jsx b/src/components/join-flow/birthdate-step.jsx index 7e507468b..4773d6d9e 100644 --- a/src/components/join-flow/birthdate-step.jsx +++ b/src/components/join-flow/birthdate-step.jsx @@ -90,6 +90,7 @@ class BirthDateStep extends React.Component { } = props; return ( { + this.emailRemoteCache[email] = remoteResult; + return remoteResult; + } + ); + } validateEmail (email) { if (!email) return this.props.intl.formatMessage({id: 'general.required'}); const localResult = validate.validateEmailLocally(email); if (!localResult.valid) return this.props.intl.formatMessage({id: localResult.errMsgId}); - return validate.validateEmailRemotely(email).then( + return this.validateEmailRemotelyWithCache(email).then( remoteResult => { if (remoteResult.valid === true) { return null; @@ -151,6 +169,7 @@ class EmailStep extends React.Component { }} /> )} + headerImgClass="email-step-image" headerImgSrc="/images/join-flow/email-header.png" innerClassName="join-flow-inner-email-step" nextButton={this.props.intl.formatMessage({id: 'registration.createAccount'})} @@ -160,6 +179,9 @@ class EmailStep extends React.Component { onSubmit={handleSubmit} > ( -
+
{headerImgSrc && ( -
+
{ + // username: 'username exists' + this.setState({ + numAttempts: this.state.numAttempts + 1, + waiting: false + }, () => { let errStr = ''; if (!err && res.statusCode === 200) { if (body && body[0]) { @@ -100,7 +113,9 @@ class JoinFlow extends React.Component { }); } handleSubmitRegistration (formData) { - this.setState({waiting: true}, () => { + this.setState({ + waiting: true + }, () => { api({ host: '', uri: '/accounts/register_new_user/', @@ -133,14 +148,25 @@ class JoinFlow extends React.Component { step: this.state.step + 1 }); } + handleErrorNext () { + if (this.canTryAgain()) { + this.handleSubmitRegistration(this.state.formData); + } else { + this.resetState(); + } + } + resetState () { + this.setState(this.initialState); + } render () { return ( {this.state.registrationError ? ( this.handleSubmitRegistration(this.state.formData)} + onSubmit={this.handleErrorNext} /* eslint-enable react/jsx-no-bind */ /> ) : ( diff --git a/src/components/join-flow/registration-error-step.jsx b/src/components/join-flow/registration-error-step.jsx index 24457d26a..983a71576 100644 --- a/src/components/join-flow/registration-error-step.jsx +++ b/src/components/join-flow/registration-error-step.jsx @@ -19,14 +19,17 @@ class RegistrationErrorStep extends React.Component { // But here, we're not really submitting, so we need to prevent // the form from navigating away from the current page. e.preventDefault(); - this.props.onTryAgain(); + this.props.onSubmit(); } render () { return ( @@ -35,9 +38,10 @@ class RegistrationErrorStep extends React.Component { } RegistrationErrorStep.propTypes = { + canTryAgain: PropTypes.bool, errorMsg: PropTypes.string, intl: intlShape, - onTryAgain: PropTypes.func + onSubmit: PropTypes.func }; const IntlRegistrationErrorStep = injectIntl(RegistrationErrorStep); diff --git a/src/components/join-flow/username-step.jsx b/src/components/join-flow/username-step.jsx index f325b3a7e..3610a09e7 100644 --- a/src/components/join-flow/username-step.jsx +++ b/src/components/join-flow/username-step.jsx @@ -26,11 +26,15 @@ class UsernameStep extends React.Component { 'validatePasswordIfPresent', 'validatePasswordConfirmIfPresent', 'validateUsernameIfPresent', + 'validateUsernameRemotelyWithCache', 'validateForm' ]); this.state = { focused: null }; + // simple object to memoize remote requests for usernames. + // keeps us from submitting multiple requests for same data. + this.usernameRemoteCache = {}; } componentDidMount () { // automatically start with focus on username field @@ -44,12 +48,25 @@ class UsernameStep extends React.Component { handleSetUsernameRef (usernameInputRef) { this.usernameInput = usernameInputRef; } + // simple function to memoize remote requests for usernames + validateUsernameRemotelyWithCache (username) { + if (this.usernameRemoteCache.hasOwnProperty(username)) { + return Promise.resolve(this.usernameRemoteCache[username]); + } + // username is not in our cache + return validate.validateUsernameRemotely(username).then( + remoteResult => { + this.usernameRemoteCache[username] = remoteResult; + return remoteResult; + } + ); + } // we allow username to be empty on blur, since you might not have typed anything yet validateUsernameIfPresent (username) { if (!username) return null; // skip validation if username is blank; null indicates valid // if username is not blank, run both local and remote validations const localResult = validate.validateUsernameLocally(username); - return validate.validateUsernameRemotely(username).then( + return this.validateUsernameRemotelyWithCache(username).then( remoteResult => { // there may be multiple validation errors. Prioritize vulgarity, then // length, then having invalid chars, then all other remote reports @@ -143,6 +160,9 @@ class UsernameStep extends React.Component { {this.props.intl.formatMessage({id: 'registration.createUsername'})}
@@ -239,13 +231,12 @@ class Navigation extends React.Component { Navigation.propTypes = { accountNavOpen: PropTypes.bool, getMessageCount: PropTypes.func, + handleClickRegistration: PropTypes.func, handleCloseAccountNav: PropTypes.func, handleLogOut: PropTypes.func, - handleOpenRegistration: PropTypes.func, handleToggleAccountNav: PropTypes.func, handleToggleLoginOpen: PropTypes.func, intl: intlShape, - navigateToRegistration: PropTypes.func, permissions: PropTypes.shape({ admin: PropTypes.bool, social: PropTypes.bool, @@ -296,9 +287,9 @@ const mapDispatchToProps = dispatch => ({ handleCloseAccountNav: () => { dispatch(navigationActions.setAccountNavOpen(false)); }, - handleOpenRegistration: event => { + handleClickRegistration: event => { event.preventDefault(); - dispatch(navigationActions.setRegistrationOpen(true)); + dispatch(navigationActions.handleRegistrationRequested()); }, handleLogOut: event => { event.preventDefault(); @@ -308,10 +299,6 @@ const mapDispatchToProps = dispatch => ({ event.preventDefault(); dispatch(navigationActions.toggleLoginOpen()); }, - navigateToRegistration: event => { - event.preventDefault(); - navigationActions.navigateToRegistration(); - }, setMessageCount: newCount => { dispatch(messageCountActions.setCount(newCount)); } diff --git a/src/components/page/www/page.jsx b/src/components/page/www/page.jsx index d20e8fda6..77f3712ba 100644 --- a/src/components/page/www/page.jsx +++ b/src/components/page/www/page.jsx @@ -10,7 +10,7 @@ const Page = ({ children, className }) => ( - +
({ @@ -49,6 +50,12 @@ module.exports.navigationReducer = (state, action) => { return defaults({canceledDeletionOpen: action.isOpen}, state); case Types.SET_REGISTRATION_OPEN: return defaults({registrationOpen: action.isOpen}, state); + case Types.HANDLE_REGISTRATION_REQUESTED: + if (state.useScratch3Registration) { + window.location.assign('/join'); + return state; + } + return defaults({registrationOpen: true}, state); default: return state; } @@ -92,9 +99,9 @@ module.exports.setSearchTerm = searchTerm => ({ searchTerm: searchTerm }); -module.exports.navigateToRegistration = () => { - window.location = '/join'; -}; +module.exports.handleRegistrationRequested = () => ({ + type: Types.HANDLE_REGISTRATION_REQUESTED +}); module.exports.handleCompleteRegistration = createProject => (dispatch => { if (createProject) { diff --git a/src/routes.json b/src/routes.json index d5261c3c4..a56e82126 100644 --- a/src/routes.json +++ b/src/routes.json @@ -512,7 +512,13 @@ }, { "name": "fly-tutorial-redirect", - "pattern": "^/(makeit)?fly/?$", + "pattern": "^/fly/?$", + "routeAlias": "/(makeit)?fly/?$", + "redirect": "/projects/editor/?tutorial=make-it-fly" + }, + { + "name": "makeitfly-tutorial-redirect", + "pattern": "^/makeitfly/?$", "routeAlias": "/(makeit)?fly/?$", "redirect": "/projects/editor/?tutorial=make-it-fly" }, diff --git a/src/views/join/join.jsx b/src/views/join/join.jsx index 4b2b9e6b5..d51659939 100644 --- a/src/views/join/join.jsx +++ b/src/views/join/join.jsx @@ -5,9 +5,12 @@ const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx' // Require this even though we don't use it because, without it, webpack runs out of memory... const Page = require('../../components/page/www/page.jsx'); // eslint-disable-line no-unused-vars +const initSentry = require('../../lib/sentry.js'); +initSentry(); + require('./join.scss'); const Register = () => ( - +
-
- -
- +
+ +
); } diff --git a/src/views/preview/embed.jsx b/src/views/preview/embed.jsx index f458948be..ba992fab4 100644 --- a/src/views/preview/embed.jsx +++ b/src/views/preview/embed.jsx @@ -13,7 +13,9 @@ const UnsupportedBrowser = require('./unsupported-browser.jsx'); if (isSupportedBrowser()) { const EmbedView = require('./embed-view.jsx'); render( - , + + + , document.getElementById('app'), { preview: previewActions.previewReducer, @@ -26,5 +28,8 @@ if (isSupportedBrowser()) { EmbedView.guiMiddleware ); } else { - render(, document.getElementById('app')); + render( + , + document.getElementById('app') + ); } diff --git a/test/unit/components/email-step.test.jsx b/test/unit/components/email-step.test.jsx index 73a84e857..b787802d4 100644 --- a/test/unit/components/email-step.test.jsx +++ b/test/unit/components/email-step.test.jsx @@ -1,11 +1,30 @@ const React = require('react'); const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx'); -const EmailStep = require('../../../src/components/join-flow/email-step.jsx'); const JoinFlowStep = require('../../../src/components/join-flow/join-flow-step.jsx'); const FormikInput = require('../../../src/components/formik-forms/formik-input.jsx'); const FormikCheckbox = require('../../../src/components/formik-forms/formik-checkbox.jsx'); +const mockedValidateEmailRemotely = jest.fn(() => ( + /* eslint-disable no-undef */ + Promise.resolve({valid: false, errMsgId: 'registration.validationEmailInvalid'}) + /* eslint-enable no-undef */ +)); + +jest.mock('../../../src/lib/validate.js', () => ( + { + ...(jest.requireActual('../../../src/lib/validate.js')), + validateEmailRemotely: mockedValidateEmailRemotely + } +)); + +// must come after validation mocks, so validate.js will be mocked before it is required +const EmailStep = require('../../../src/components/join-flow/email-step.jsx'); + describe('EmailStep test', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + test('send correct props to formik', () => { const wrapper = shallowWithIntl(); @@ -174,4 +193,66 @@ describe('EmailStep test', () => { const val = formikWrapper.instance().validateEmail(); expect(val).toBe('general.required'); }); + + test('validateEmailRemotelyWithCache calls validate.validateEmailRemotely', done => { + const wrapper = shallowWithIntl( + ); + const instance = wrapper.dive().instance(); + + instance.validateEmailRemotelyWithCache('some-email@some-domain.com') + .then(response => { + expect(mockedValidateEmailRemotely).toHaveBeenCalled(); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationEmailInvalid'); + done(); + }); + }); + + test('validateEmailRemotelyWithCache, called twice with different data, makes two remote requests', done => { + const wrapper = shallowWithIntl( + + ); + const instance = wrapper.dive().instance(); + + instance.validateEmailRemotelyWithCache('some-email@some-domain.com') + .then(response => { + expect(mockedValidateEmailRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationEmailInvalid'); + }) + .then(() => { + // make the same request a second time + instance.validateEmailRemotelyWithCache('different-email@some-domain.org') + .then(response => { + expect(mockedValidateEmailRemotely).toHaveBeenCalledTimes(2); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationEmailInvalid'); + done(); + }); + }); + }); + + test('validateEmailRemotelyWithCache, called twice with same data, only makes one remote request', done => { + const wrapper = shallowWithIntl( + + ); + const instance = wrapper.dive().instance(); + + instance.validateEmailRemotelyWithCache('some-email@some-domain.com') + .then(response => { + expect(mockedValidateEmailRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationEmailInvalid'); + }) + .then(() => { + // make the same request a second time + instance.validateEmailRemotelyWithCache('some-email@some-domain.com') + .then(response => { + expect(mockedValidateEmailRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationEmailInvalid'); + done(); + }); + }); + }); }); diff --git a/test/unit/components/errorboundary.test.jsx b/test/unit/components/errorboundary.test.jsx new file mode 100644 index 000000000..fbcaf2006 --- /dev/null +++ b/test/unit/components/errorboundary.test.jsx @@ -0,0 +1,76 @@ +import React from 'react'; +const {mountWithIntl} = require('../../helpers/intl-helpers.jsx'); + +jest.mock('@sentry/browser', () => { + const setExtra = jest.fn(); + const setTag = jest.fn(); + + const makeScope = (setExtraParam, setTagParam) => { + const thisScope = { + setExtra: setExtraParam, + setTag: setTagParam + }; + return thisScope; + }; + const Sentry = { + captureException: jest.fn(), + lastEventId: function () { + return 0; + }, + setExtra: setExtra, + setTag: setTag, + withScope: jest.fn(cb => { + cb(makeScope(setExtra, setTag)); + }) + }; + return Sentry; +}); + +const Sentry = require('@sentry/browser'); +import ErrorBoundary from '../../../src/components/errorboundary/errorboundary.jsx'; + +describe('ErrorBoundary', () => { + let errorBoundaryWrapper; + + const ChildClass = () => ( +
+ Children here +
+ ); + + beforeEach(() => { + errorBoundaryWrapper = mountWithIntl( + + + + ); + }); + + test('calling ErrorBoundary\'s componentDidCatch() calls Sentry.withScope()', () => { + const errorBoundaryInstance = errorBoundaryWrapper.instance(); + errorBoundaryInstance.componentDidCatch('error', {}); + expect(Sentry.withScope).toHaveBeenCalled(); + }); + + test('calling ErrorBoundary\'s componentDidCatch() calls Sentry.captureException()', () => { + const errorBoundaryInstance = errorBoundaryWrapper.instance(); + errorBoundaryInstance.componentDidCatch('error', {}); + expect(Sentry.captureException).toHaveBeenCalledWith('error'); + }); + + test('throwing error under ErrorBoundary calls Sentry.withScope()', () => { + const child = errorBoundaryWrapper.find('#childClass'); + expect(child.exists()).toEqual(true); + child.simulateError({}, {}); + expect(Sentry.withScope).toHaveBeenCalled(); + }); + + test('ErrorBoundary with name prop causes Sentry to setTag with that name', () => { + const child = errorBoundaryWrapper.find('#childClass'); + expect(child.exists()).toEqual(true); + child.simulateError({}); + expect(Sentry.setTag).toHaveBeenCalledWith('component', 'TestEBName'); + }); +}); diff --git a/test/unit/components/join-flow.test.jsx b/test/unit/components/join-flow.test.jsx index 04cb1a6dc..8724c8ec4 100644 --- a/test/unit/components/join-flow.test.jsx +++ b/test/unit/components/join-flow.test.jsx @@ -1,5 +1,6 @@ import React from 'react'; const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx'); +const defaults = require('lodash.defaultsdeep'); import configureStore from 'redux-mock-store'; import JoinFlow from '../../../src/components/join-flow/join-flow'; import Progression from '../../../src/components/progression/progression.jsx'; @@ -126,6 +127,7 @@ describe('JoinFlow', () => { expect(joinFlowInstance.props.refreshSession).not.toHaveBeenCalled(); expect(joinFlowInstance.state.registrationError).toBe('registration.generalError (400)'); }); + test('handleRegistrationError with no message ', () => { const joinFlowInstance = getJoinFlowWrapper().instance(); joinFlowInstance.setState({}); @@ -175,4 +177,71 @@ describe('JoinFlow', () => { expect(registrationErrorWrapper).toHaveLength(0); expect(progressionWrapper).toHaveLength(1); }); + + test('when numAttempts is 0, RegistrationErrorStep receives canTryAgain prop with value true', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + joinFlowWrapper.instance().setState({ + numAttempts: 0, + registrationError: 'halp there is a errors!!' + }); + const registrationErrorWrapper = joinFlowWrapper.find(RegistrationErrorStep); + expect(registrationErrorWrapper.first().props().canTryAgain).toEqual(true); + }); + + test('when numAttempts is 1, RegistrationErrorStep receives canTryAgain prop with value true', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + joinFlowWrapper.instance().setState({ + numAttempts: 1, + registrationError: 'halp there is a errors!!' + }); + const registrationErrorWrapper = joinFlowWrapper.find(RegistrationErrorStep); + expect(registrationErrorWrapper.first().props().canTryAgain).toEqual(true); + }); + + test('when numAttempts is 2, RegistrationErrorStep receives canTryAgain prop with value false', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + joinFlowWrapper.instance().setState({ + numAttempts: 2, + registrationError: 'halp there is a errors!!' + }); + const registrationErrorWrapper = joinFlowWrapper.find(RegistrationErrorStep); + expect(registrationErrorWrapper.first().props().canTryAgain).toEqual(false); + }); + + test('resetState resets entire state, does not leave any state keys out', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + const joinFlowInstance = joinFlowWrapper.instance(); + Object.keys(joinFlowInstance.state).forEach(key => { + joinFlowInstance.setState({[key]: 'Different than the initial value'}); + }); + joinFlowInstance.resetState(); + Object.keys(joinFlowInstance.state).forEach(key => { + expect(joinFlowInstance.state[key]).not.toEqual('Different than the initial value'); + }); + }); + + test('resetState makes each state field match initial state', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + const joinFlowInstance = joinFlowWrapper.instance(); + const stateSnapshot = {}; + Object.keys(joinFlowInstance.state).forEach(key => { + stateSnapshot[key] = joinFlowInstance.state[key]; + }); + joinFlowInstance.resetState(); + Object.keys(joinFlowInstance.state).forEach(key => { + expect(stateSnapshot[key]).toEqual(joinFlowInstance.state[key]); + }); + }); + + test('calling resetState results in state.formData which is not same reference as before', () => { + const joinFlowWrapper = getJoinFlowWrapper(); + const joinFlowInstance = joinFlowWrapper.instance(); + joinFlowInstance.setState({ + formData: defaults({}, {username: 'abcdef'}) + }); + const formDataReference = joinFlowInstance.state.formData; + joinFlowInstance.resetState(); + expect(formDataReference).not.toBe(joinFlowInstance.state.formData); + expect(formDataReference).not.toEqual(joinFlowInstance.state.formData); + }); }); diff --git a/test/unit/components/navigation.test.jsx b/test/unit/components/navigation.test.jsx index 0072dc4cd..9a9547a9a 100644 --- a/test/unit/components/navigation.test.jsx +++ b/test/unit/components/navigation.test.jsx @@ -2,6 +2,7 @@ const React = require('react'); const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx'); import configureStore from 'redux-mock-store'; const Navigation = require('../../../src/components/navigation/www/navigation.jsx'); +const Registration = require('../../../src/components/registration/registration.jsx'); const sessionActions = require('../../../src/redux/session.js'); describe('Navigation', () => { @@ -24,7 +25,41 @@ describe('Navigation', () => { .dive(); // unwrap injectIntl(JoinFlow) }; - test('when using old join flow, clicking Join Scratch attemps to open registration', () => { + test('when using old join flow, when registrationOpen is true, iframe shows', () => { + store = mockStore({ + navigation: { + registrationOpen: true, + useScratch3Registration: false + }, + session: { + status: sessionActions.Status.FETCHED + }, + messageCount: { + messageCount: 0 + } + }); + const navWrapper = getNavigationWrapper(); + expect(navWrapper.contains()).toEqual(true); + }); + + test('when using new join flow, when registrationOpen is true, iframe does not show', () => { + store = mockStore({ + navigation: { + registrationOpen: true, + useScratch3Registration: true + }, + session: { + status: sessionActions.Status.FETCHED + }, + messageCount: { + messageCount: 0 + } + }); + const navWrapper = getNavigationWrapper(); + expect(navWrapper.contains()).toEqual(false); + }); + + test('when using old join flow, clicking Join Scratch calls handleRegistrationRequested', () => { store = mockStore({ navigation: { useScratch3Registration: false @@ -37,16 +72,17 @@ describe('Navigation', () => { } }); const props = { - handleOpenRegistration: jest.fn() + handleClickRegistration: jest.fn() }; const navWrapper = getNavigationWrapper(props); const navInstance = navWrapper.instance(); - navWrapper.find('a.registrationLink').simulate('click'); - expect(navInstance.props.handleOpenRegistration).toHaveBeenCalled(); + // simulate click, with mocked event + navWrapper.find('a.registrationLink').simulate('click', {preventDefault () {}}); + expect(navInstance.props.handleClickRegistration).toHaveBeenCalled(); }); - test('when using new join flow, clicking Join Scratch attemps to navigate to registration', () => { + test('when using new join flow, clicking Join Scratch calls handleRegistrationRequested', () => { store = mockStore({ navigation: { useScratch3Registration: true @@ -59,12 +95,12 @@ describe('Navigation', () => { } }); const props = { - navigateToRegistration: jest.fn() + handleClickRegistration: jest.fn() }; const navWrapper = getNavigationWrapper(props); const navInstance = navWrapper.instance(); - navWrapper.find('a.registrationLink').simulate('click'); - expect(navInstance.props.navigateToRegistration).toHaveBeenCalled(); + navWrapper.find('a.registrationLink').simulate('click', {preventDefault () {}}); + expect(navInstance.props.handleClickRegistration).toHaveBeenCalled(); }); }); diff --git a/test/unit/components/registration-error-step.test.jsx b/test/unit/components/registration-error-step.test.jsx index e87e9b88a..afad5e63a 100644 --- a/test/unit/components/registration-error-step.test.jsx +++ b/test/unit/components/registration-error-step.test.jsx @@ -4,30 +4,46 @@ import JoinFlowStep from '../../../src/components/join-flow/join-flow-step'; import RegistrationErrorStep from '../../../src/components/join-flow/registration-error-step'; describe('RegistrationErrorStep', () => { - const onTryAgain = jest.fn(); - let wrapper; + const onSubmit = jest.fn(); - beforeEach(() => { - wrapper = shallowWithIntl( + const getRegistrationErrorStepWrapper = props => { + const wrapper = shallowWithIntl( ); - }); + return wrapper + .dive(); // unwrap injectIntl() + }; - test('shows JoinFlowStep with props', () => { - // Dive to get past the anonymous component. - const joinFlowStepWrapper = wrapper.dive().find(JoinFlowStep); + test('when canTryAgain is true, show tryAgain message', () => { + const props = {canTryAgain: true}; + const joinFlowStepWrapper = getRegistrationErrorStepWrapper(props).find(JoinFlowStep); expect(joinFlowStepWrapper).toHaveLength(1); expect(joinFlowStepWrapper.props().description).toBe('error message'); expect(joinFlowStepWrapper.props().nextButton).toBe('general.tryAgain'); }); - test('when submitted, onTryAgain is called', () => { - // Dive to get past the anonymous component. - const joinFlowStepWrapper = wrapper.dive().find(JoinFlowStep); + test('when canTryAgain is false, show startOver message', () => { + const props = {canTryAgain: false}; + const joinFlowStepWrapper = getRegistrationErrorStepWrapper(props).find(JoinFlowStep); + expect(joinFlowStepWrapper).toHaveLength(1); + expect(joinFlowStepWrapper.props().description).toBe('error message'); + expect(joinFlowStepWrapper.props().nextButton).toBe('general.startOver'); + }); + + test('when canTryAgain is missing, show startOver message', () => { + const joinFlowStepWrapper = getRegistrationErrorStepWrapper().find(JoinFlowStep); + expect(joinFlowStepWrapper).toHaveLength(1); + expect(joinFlowStepWrapper.props().description).toBe('error message'); + expect(joinFlowStepWrapper.props().nextButton).toBe('general.startOver'); + }); + + test('when submitted, onSubmit is called', () => { + const joinFlowStepWrapper = getRegistrationErrorStepWrapper().find(JoinFlowStep); joinFlowStepWrapper.props().onSubmit(new Event('event')); // eslint-disable-line no-undef - expect(onTryAgain).toHaveBeenCalled(); + expect(onSubmit).toHaveBeenCalled(); }); }); diff --git a/test/unit/components/username-step.test.jsx b/test/unit/components/username-step.test.jsx new file mode 100644 index 000000000..c64045a12 --- /dev/null +++ b/test/unit/components/username-step.test.jsx @@ -0,0 +1,118 @@ +const React = require('react'); +const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx'); + +const mockedValidateUsernameRemotely = jest.fn(() => ( + /* eslint-disable no-undef */ + Promise.resolve({valid: false, errMsgId: 'registration.validationUsernameNotAllowed'}) + /* eslint-enable no-undef */ +)); + +jest.mock('../../../src/lib/validate.js', () => ( + { + ...(jest.requireActual('../../../src/lib/validate.js')), + validateUsernameRemotely: mockedValidateUsernameRemotely + } +)); + +// must come after validation mocks, so validate.js will be mocked before it is required +const UsernameStep = require('../../../src/components/join-flow/username-step.jsx'); + +describe('UsernameStep test', () => { + + afterEach(() => { + jest.clearAllMocks(); + }); + + test('send correct props to formik', () => { + const wrapper = shallowWithIntl(); + const formikWrapper = wrapper.dive(); + expect(formikWrapper.props().initialValues.username).toBe(''); + expect(formikWrapper.props().initialValues.password).toBe(''); + expect(formikWrapper.props().initialValues.passwordConfirm).toBe(''); + expect(formikWrapper.props().initialValues.showPassword).toBe(true); + expect(formikWrapper.props().validateOnBlur).toBe(false); + expect(formikWrapper.props().validateOnChange).toBe(false); + expect(formikWrapper.props().validate).toBe(formikWrapper.instance().validateForm); + expect(formikWrapper.props().onSubmit).toBe(formikWrapper.instance().handleValidSubmit); + }); + + test('handleValidSubmit passes formData to next step', () => { + const formikBag = { + setSubmitting: jest.fn() + }; + const formData = {item1: 'thing', item2: 'otherthing'}; + const mockedOnNextStep = jest.fn(); + const wrapper = shallowWithIntl( + + ); + const instance = wrapper.dive().instance(); + + instance.handleValidSubmit(formData, formikBag); + expect(formikBag.setSubmitting).toHaveBeenCalledWith(false); + expect(mockedOnNextStep).toHaveBeenCalledWith(formData); + }); + + test('validateUsernameRemotelyWithCache calls validate.validateUsernameRemotely', done => { + const wrapper = shallowWithIntl( + ); + const instance = wrapper.dive().instance(); + + instance.validateUsernameRemotelyWithCache('newUniqueUsername55') + .then(response => { + expect(mockedValidateUsernameRemotely).toHaveBeenCalled(); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationUsernameNotAllowed'); + done(); + }); + }); + + test('validateUsernameRemotelyWithCache, called twice with different data, makes two remote requests', done => { + const wrapper = shallowWithIntl( + + ); + const instance = wrapper.dive().instance(); + + instance.validateUsernameRemotelyWithCache('newUniqueUsername55') + .then(response => { + expect(mockedValidateUsernameRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationUsernameNotAllowed'); + }) + .then(() => { + // make the same request a second time + instance.validateUsernameRemotelyWithCache('secondDifferent66') + .then(response => { + expect(mockedValidateUsernameRemotely).toHaveBeenCalledTimes(2); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationUsernameNotAllowed'); + done(); + }); + }); + }); + + test('validateUsernameRemotelyWithCache, called twice with same data, only makes one remote request', done => { + const wrapper = shallowWithIntl( + + ); + const instance = wrapper.dive().instance(); + + instance.validateUsernameRemotelyWithCache('newUniqueUsername55') + .then(response => { + expect(mockedValidateUsernameRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationUsernameNotAllowed'); + }) + .then(() => { + // make the same request a second time + instance.validateUsernameRemotelyWithCache('newUniqueUsername55') + .then(response => { + expect(mockedValidateUsernameRemotely).toHaveBeenCalledTimes(1); + expect(response.valid).toBe(false); + expect(response.errMsgId).toBe('registration.validationUsernameNotAllowed'); + done(); + }); + }); + }); +}); diff --git a/test/unit/lib/country-data.test.js b/test/unit/lib/country-data.test.js index 5c8122604..1321e2f96 100644 --- a/test/unit/lib/country-data.test.js +++ b/test/unit/lib/country-data.test.js @@ -74,6 +74,15 @@ describe('unit test lib/country-data.js', () => { expect(ukItems.length).toEqual(2); }); + test('registrationCountryOptions object uses country names for both option label and option value', () => { + expect(typeof registrationCountryOptions).toBe('object'); + // test that there is one option with label and value === 'Brazil' + const brazilOptions = registrationCountryOptions.reduce((acc, thisCountry) => ( + (thisCountry.value === 'Brazil' && thisCountry.label === 'Brazil') ? [...acc, thisCountry] : acc + ), []); + expect(brazilOptions.length).toEqual(1); + }); + test('registrationCountryOptions object places USA and UK at start, with display name versions', () => { expect(typeof registrationCountryOptions).toBe('object'); const numCountries = countryInfo.length; @@ -81,17 +90,17 @@ describe('unit test lib/country-data.js', () => { // test that the two entries have been added to the start of the array, and that // the name of the USA includes "America" expect(registrationCountryOptions.length).toEqual(numCountries + 2); - expect(registrationCountryOptions[0]).toEqual({value: 'us', label: 'United States of America'}); - expect(registrationCountryOptions[1]).toEqual({value: 'gb', label: 'United Kingdom'}); + expect(registrationCountryOptions[0]).toEqual({value: 'United States', label: 'United States of America'}); + expect(registrationCountryOptions[1]).toEqual({value: 'United Kingdom', label: 'United Kingdom'}); // test that there are now two entries for USA const usaOptions = registrationCountryOptions.reduce((acc, thisCountry) => ( - thisCountry.value === 'us' ? [...acc, thisCountry] : acc + thisCountry.value === 'United States' ? [...acc, thisCountry] : acc ), []); expect(usaOptions.length).toEqual(2); // test that there are now two entries for UK const ukOptions = registrationCountryOptions.reduce((acc, thisCountry) => ( - thisCountry.value === 'gb' ? [...acc, thisCountry] : acc + thisCountry.value === 'United Kingdom' ? [...acc, thisCountry] : acc ), []); expect(ukOptions.length).toEqual(2); }); diff --git a/test/unit/redux/navigation.test.js b/test/unit/redux/navigation.test.js index 277b2d574..1a57bf012 100644 --- a/test/unit/redux/navigation.test.js +++ b/test/unit/redux/navigation.test.js @@ -7,11 +7,17 @@ const { setLoginOpen, setRegistrationOpen, setSearchTerm, - toggleLoginOpen + toggleLoginOpen, + handleRegistrationRequested } = require('../../../src/redux/navigation'); describe('unit test lib/validate.js', () => { + beforeEach(() => { + // mock window navigation + global.window.location.assign = jest.fn(); + }); + test('initialState', () => { let defaultState; /* navigationReducer(state, action) */ @@ -238,4 +244,28 @@ describe('unit test lib/validate.js', () => { const resultState = navigationReducer(initialState, action); expect(resultState.loginOpen).toBe(false); }); + + test('handleRegistrationRequested with useScratch3Registration true navigates user to /join, ' + + 'and does NOT open scratch 2 registration', () => { + const initialState = { + registrationOpen: false, + useScratch3Registration: true + }; + const action = handleRegistrationRequested(); + const resultState = navigationReducer(initialState, action); + expect(resultState.registrationOpen).toBe(false); + expect(global.window.location.assign).toHaveBeenCalledWith('/join'); + }); + + test('handleRegistrationRequested with useScratch3Registration false does NOT navigate user away, ' + + 'DOES open scratch 2 registration', () => { + const initialState = { + registrationOpen: false, + useScratch3Registration: false + }; + const action = handleRegistrationRequested(); + const resultState = navigationReducer(initialState, action); + expect(resultState.registrationOpen).toBe(true); + expect(global.window.location.assign).not.toHaveBeenCalled(); + }); });