mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-11 16:21:04 -05:00
Merge pull request #3490 from LLK/develop
Update release branch with latest changes from develop.
This commit is contained in:
commit
c2a2c0a0ac
35 changed files with 767 additions and 181 deletions
|
@ -133,6 +133,8 @@ var localizedAssetUrls = {};
|
||||||
// - txMapping: if the name of the transifex resource is different from the route name
|
// - txMapping: if the name of the transifex resource is different from the route name
|
||||||
var txMapping = {
|
var txMapping = {
|
||||||
'projects': 'preview',
|
'projects': 'preview',
|
||||||
|
'embed': 'preview',
|
||||||
|
'vernier': 'gdxfor',
|
||||||
'scratch_1.4': 'scratch_14' // transifex doesn't allow dots in resource names
|
'scratch_1.4': 'scratch_14' // transifex doesn't allow dots in resource names
|
||||||
};
|
};
|
||||||
// start with english default for all views
|
// start with english default for all views
|
||||||
|
|
162
package-lock.json
generated
162
package-lock.json
generated
|
@ -5507,27 +5507,27 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"abbrev": {
|
"abbrev": {
|
||||||
"version": "1.1.1",
|
"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==",
|
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
|
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"are-we-there-yet": {
|
"are-we-there-yet": {
|
||||||
"version": "1.1.5",
|
"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==",
|
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5538,13 +5538,13 @@
|
||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5554,39 +5554,39 @@
|
||||||
},
|
},
|
||||||
"chownr": {
|
"chownr": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
|
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"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=",
|
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"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=",
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5596,28 +5596,28 @@
|
||||||
},
|
},
|
||||||
"deep-extend": {
|
"deep-extend": {
|
||||||
"version": "0.6.0",
|
"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==",
|
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"delegates": {
|
"delegates": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
|
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"detect-libc": {
|
"detect-libc": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
|
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"fs-minipass": {
|
"fs-minipass": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
|
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5627,14 +5627,14 @@
|
||||||
},
|
},
|
||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"gauge": {
|
"gauge": {
|
||||||
"version": "2.7.4",
|
"version": "2.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5651,7 +5651,7 @@
|
||||||
},
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.3",
|
"version": "7.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5666,14 +5666,14 @@
|
||||||
},
|
},
|
||||||
"has-unicode": {
|
"has-unicode": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
|
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
"iconv-lite": {
|
||||||
"version": "0.4.24",
|
"version": "0.4.24",
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5683,7 +5683,7 @@
|
||||||
},
|
},
|
||||||
"ignore-walk": {
|
"ignore-walk": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
|
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5693,7 +5693,7 @@
|
||||||
},
|
},
|
||||||
"inflight": {
|
"inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5704,20 +5704,20 @@
|
||||||
},
|
},
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
"version": "1.0.0",
|
"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=",
|
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5726,14 +5726,14 @@
|
||||||
},
|
},
|
||||||
"isarray": {
|
"isarray": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5742,13 +5742,13 @@
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.3.5",
|
"version": "2.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
|
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5758,7 +5758,7 @@
|
||||||
},
|
},
|
||||||
"minizlib": {
|
"minizlib": {
|
||||||
"version": "1.2.1",
|
"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==",
|
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5768,7 +5768,7 @@
|
||||||
},
|
},
|
||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5777,14 +5777,14 @@
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.1",
|
"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==",
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"needle": {
|
"needle": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
|
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5796,7 +5796,7 @@
|
||||||
},
|
},
|
||||||
"node-pre-gyp": {
|
"node-pre-gyp": {
|
||||||
"version": "0.12.0",
|
"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==",
|
"integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5815,7 +5815,7 @@
|
||||||
},
|
},
|
||||||
"nopt": {
|
"nopt": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
|
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5826,14 +5826,14 @@
|
||||||
},
|
},
|
||||||
"npm-bundled": {
|
"npm-bundled": {
|
||||||
"version": "1.0.6",
|
"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==",
|
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"npm-packlist": {
|
"npm-packlist": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
|
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5844,7 +5844,7 @@
|
||||||
},
|
},
|
||||||
"npmlog": {
|
"npmlog": {
|
||||||
"version": "4.1.2",
|
"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==",
|
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5857,20 +5857,20 @@
|
||||||
},
|
},
|
||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -5879,21 +5879,21 @@
|
||||||
},
|
},
|
||||||
"os-homedir": {
|
"os-homedir": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"os-tmpdir": {
|
"os-tmpdir": {
|
||||||
"version": "1.0.2",
|
"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=",
|
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"osenv": {
|
"osenv": {
|
||||||
"version": "0.1.5",
|
"version": "0.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5904,21 +5904,21 @@
|
||||||
},
|
},
|
||||||
"path-is-absolute": {
|
"path-is-absolute": {
|
||||||
"version": "1.0.1",
|
"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=",
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"process-nextick-args": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.0",
|
"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==",
|
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"rc": {
|
"rc": {
|
||||||
"version": "1.2.8",
|
"version": "1.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5931,7 +5931,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
|
@ -5940,7 +5940,7 @@
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "2.3.6",
|
"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==",
|
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5956,7 +5956,7 @@
|
||||||
},
|
},
|
||||||
"rimraf": {
|
"rimraf": {
|
||||||
"version": "2.6.3",
|
"version": "2.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -5966,48 +5966,48 @@
|
||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"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==",
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"sax": {
|
"sax": {
|
||||||
"version": "1.2.4",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.7.0",
|
"version": "5.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"set-blocking": {
|
"set-blocking": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"signal-exit": {
|
"signal-exit": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -6018,7 +6018,7 @@
|
||||||
},
|
},
|
||||||
"string_decoder": {
|
"string_decoder": {
|
||||||
"version": "1.1.1",
|
"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==",
|
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -6028,7 +6028,7 @@
|
||||||
},
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
|
@ -6037,14 +6037,14 @@
|
||||||
},
|
},
|
||||||
"strip-json-comments": {
|
"strip-json-comments": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "4.4.8",
|
"version": "4.4.8",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
|
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -6060,14 +6060,14 @@
|
||||||
},
|
},
|
||||||
"util-deprecate": {
|
"util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"wide-align": {
|
"wide-align": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
|
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
@ -6077,13 +6077,13 @@
|
||||||
},
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": false,
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"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==",
|
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
|
@ -6347,9 +6347,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"google-libphonenumber": {
|
"google-libphonenumber": {
|
||||||
"version": "3.2.3",
|
"version": "3.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/google-libphonenumber/-/google-libphonenumber-3.2.5.tgz",
|
||||||
"integrity": "sha512-8n4JyRptifaIRlHANKRlfqLR8fANm7+Q+1qvDuUsUeStSLtLGTVsZWe1llWDfgWTm1y07cEUyiRuNIv6cs2ovg==",
|
"integrity": "sha512-Y0r7MFCI11UDLn0KaMPBEInhROyIOkWkQIyvWMFVF2I+h+sHE3vbl5a7FVe39td6u/w+nlKDdUMP9dMOZyv+2Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"graceful-fs": {
|
"graceful-fs": {
|
||||||
|
@ -13583,9 +13583,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"react-modal": {
|
"react-modal": {
|
||||||
"version": "3.8.2",
|
"version": "3.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.10.1.tgz",
|
||||||
"integrity": "sha512-wxNk94wy/DMh2LyJa8K+LyOQDhQfhKuBrZ4SxS091p75cpW+STfY+9GpAuvl6P6Yt2r/+wxYH8Z3G5Ww/L8Tiw==",
|
"integrity": "sha512-2DKIfdOc8+WY+SYJ/xf/WBwOYMmNAYAyGkYlc4e1TCs9rk1xY4QBz04hB3UHGcrLChh7ce77rHAe6VPNmuLYsQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"exenv": "^1.2.0",
|
"exenv": "^1.2.0",
|
||||||
|
@ -15076,15 +15076,15 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scratch-gui": {
|
"scratch-gui": {
|
||||||
"version": "0.1.0-prerelease.20191022185825",
|
"version": "0.1.0-prerelease.20191030020251",
|
||||||
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191022185825.tgz",
|
"resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191030020251.tgz",
|
||||||
"integrity": "sha512-nH8DgoEtxKSk3PIajHHNExEtxDvvYIvzKxHQcb654+A5g6OkP848Tm69aTHRF9sYe/UapwWHt5EXM/RAzgy8Zw==",
|
"integrity": "sha512-gI//FZ+tQabykTwhkP8WdCDsQgnPU6ACgBwwJUo8Pm8q9YWu0fDW+7PnzptClAeV9FCZyT52Koo8+neQbYs/Gw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"scratch-l10n": {
|
"scratch-l10n": {
|
||||||
"version": "3.6.20191008224547",
|
"version": "3.6.20191029224007",
|
||||||
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191008224547.tgz",
|
"resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191029224007.tgz",
|
||||||
"integrity": "sha512-J6AgB6oB+/ibamUNeyTdtSvkPzJchiD50xoUqzzlcPOv+AWOFSTOakGPzJnGE6/WeZ0njBThvy1rh23lamqiow==",
|
"integrity": "sha512-12LprZ35Z7j/h14CtmU0ZW+aHwOUme58bwIpF/dINil9bbUhasLzGd1Ov60y3eOmP0LO+EE4oebUbK6KV1rguQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/cli": "^7.1.2",
|
"@babel/cli": "^7.1.2",
|
||||||
|
@ -15371,9 +15371,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"glob": {
|
"glob": {
|
||||||
"version": "7.1.4",
|
"version": "7.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz",
|
||||||
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
"integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
"formsy-react-components": "1.0.0",
|
"formsy-react-components": "1.0.0",
|
||||||
"git-bundle-sha": "0.0.2",
|
"git-bundle-sha": "0.0.2",
|
||||||
"glob": "5.0.15",
|
"glob": "5.0.15",
|
||||||
"google-libphonenumber": "3.2.3",
|
"google-libphonenumber": "3.2.5",
|
||||||
"html-webpack-plugin": "2.22.0",
|
"html-webpack-plugin": "2.22.0",
|
||||||
"iso-3166-2": "0.4.0",
|
"iso-3166-2": "0.4.0",
|
||||||
"jest": "^23.6.0",
|
"jest": "^23.6.0",
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
"react": "16.2.0",
|
"react": "16.2.0",
|
||||||
"react-dom": "16.2.0",
|
"react-dom": "16.2.0",
|
||||||
"react-intl": "2.8.0",
|
"react-intl": "2.8.0",
|
||||||
"react-modal": "3.8.2",
|
"react-modal": "3.10.1",
|
||||||
"react-onclickoutside": "6.7.1",
|
"react-onclickoutside": "6.7.1",
|
||||||
"react-redux": "5.0.7",
|
"react-redux": "5.0.7",
|
||||||
"react-responsive": "3.0.0",
|
"react-responsive": "3.0.0",
|
||||||
|
@ -126,7 +126,7 @@
|
||||||
"redux-mock-store": "^1.2.3",
|
"redux-mock-store": "^1.2.3",
|
||||||
"redux-thunk": "2.0.1",
|
"redux-thunk": "2.0.1",
|
||||||
"sass-loader": "6.0.6",
|
"sass-loader": "6.0.6",
|
||||||
"scratch-gui": "0.1.0-prerelease.20191022185825",
|
"scratch-gui": "0.1.0-prerelease.20191030020251",
|
||||||
"scratch-l10n": "latest",
|
"scratch-l10n": "latest",
|
||||||
"selenium-webdriver": "3.6.0",
|
"selenium-webdriver": "3.6.0",
|
||||||
"slick-carousel": "1.6.0",
|
"slick-carousel": "1.6.0",
|
||||||
|
|
|
@ -28,8 +28,9 @@ $background-color: hsla(0, 0, 99, 1); //#FDFDFD
|
||||||
$ui-aqua: hsla(163, 85, 40, 1); // #0FBD8C Extension Primary
|
$ui-aqua: hsla(163, 85, 40, 1); // #0FBD8C Extension Primary
|
||||||
$ui-purple: hsla(260, 100, 70, 1); // #9966FF Looks Primary
|
$ui-purple: hsla(260, 100, 70, 1); // #9966FF Looks Primary
|
||||||
$ui-purple-dark: hsla(260, 60, 60, 1); // #774DCB Looks Secondary
|
$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: hsla(350, 100, 70, 1); // #FF6680 More Blocks Primary
|
||||||
$ui-coral-dark: hsla(350, 100, 60, 1); // #FF3355 More Blocks tertiary
|
$ui-coral-dark: hsla(350, 100, 60, 1); // #FF3355 More Blocks tertiary
|
||||||
|
|
||||||
|
@ -63,3 +64,4 @@ $link-blue: $ui-blue;
|
||||||
|
|
||||||
/* Down Deep */
|
/* Down Deep */
|
||||||
$dd-darkblue: hsla(195, 72.4, 17.1, 1);
|
$dd-darkblue: hsla(195, 72.4, 17.1, 1);
|
||||||
|
$dd-medium-blue: hsla(195, 72.4, 42, .65);
|
||||||
|
|
|
@ -17,6 +17,10 @@ class ErrorBoundary extends React.Component {
|
||||||
componentDidCatch (error, errorInfo) {
|
componentDidCatch (error, errorInfo) {
|
||||||
// Display fallback UI
|
// Display fallback UI
|
||||||
Sentry.withScope(scope => {
|
Sentry.withScope(scope => {
|
||||||
|
scope.setTag('project', 'scratch-www');
|
||||||
|
if (this.props.componentName) {
|
||||||
|
scope.setTag('component', this.props.componentName);
|
||||||
|
}
|
||||||
Object.keys(errorInfo).forEach(key => {
|
Object.keys(errorInfo).forEach(key => {
|
||||||
scope.setExtra(key, errorInfo[key]);
|
scope.setExtra(key, errorInfo[key]);
|
||||||
});
|
});
|
||||||
|
@ -46,7 +50,8 @@ class ErrorBoundary extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ErrorBoundary.propTypes = {
|
ErrorBoundary.propTypes = {
|
||||||
children: PropTypes.node
|
children: PropTypes.node,
|
||||||
|
componentName: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ErrorBoundary;
|
module.exports = ErrorBoundary;
|
||||||
|
|
|
@ -89,8 +89,12 @@ const FormikRadioButton = ({
|
||||||
>
|
>
|
||||||
{isCustomInput && (
|
{isCustomInput && (
|
||||||
<FormikInput
|
<FormikInput
|
||||||
|
autoCapitalize="off"
|
||||||
|
autoComplete="off"
|
||||||
|
autoCorrect="off"
|
||||||
className="formik-radio-input"
|
className="formik-radio-input"
|
||||||
name="custom"
|
name="custom"
|
||||||
|
spellCheck={false}
|
||||||
wrapperClassName="formik-radio-input-wrapper"
|
wrapperClassName="formik-radio-input-wrapper"
|
||||||
/* eslint-disable react/jsx-no-bind */
|
/* eslint-disable react/jsx-no-bind */
|
||||||
onChange={event => onSetCustom(event.target.value)}
|
onChange={event => onSetCustom(event.target.value)}
|
||||||
|
|
|
@ -39,7 +39,7 @@ input[type="radio"].formik-radio-button {
|
||||||
|
|
||||||
input.formik-radio-input, .formik-radio-input input {
|
input.formik-radio-input, .formik-radio-input input {
|
||||||
height: 2.1875rem;
|
height: 2.1875rem;
|
||||||
width: 10.25rem;
|
width: 100%;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
background-color: $ui-white;
|
background-color: $ui-white;
|
||||||
|
@ -52,6 +52,7 @@ input.formik-radio-input, .formik-radio-input input {
|
||||||
.formik-radio-input-wrapper {
|
.formik-radio-input-wrapper {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: .25rem;
|
margin-right: .25rem;
|
||||||
|
width: 10.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formik-radio-label-other {
|
.formik-radio-label-other {
|
||||||
|
|
|
@ -44,12 +44,12 @@ class Intro extends React.Component {
|
||||||
<a
|
<a
|
||||||
className="intro-button join-button button"
|
className="intro-button join-button button"
|
||||||
href="#"
|
href="#"
|
||||||
onClick={this.props.handleOpenRegistration}
|
onClick={this.props.handleClickRegistration}
|
||||||
>
|
>
|
||||||
{this.props.messages['intro.join']}
|
{this.props.messages['intro.join']}
|
||||||
</a>
|
</a>
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
|
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
<FlexRow className="intro-video-container">
|
<FlexRow className="intro-video-container">
|
||||||
{this.state.videoOpen ?
|
{this.state.videoOpen ?
|
||||||
|
@ -77,7 +77,7 @@ class Intro extends React.Component {
|
||||||
}
|
}
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
</FlexRow>
|
</FlexRow>
|
||||||
|
|
||||||
<FlexRow className="intro-subnav">
|
<FlexRow className="intro-subnav">
|
||||||
<a
|
<a
|
||||||
href="/about"
|
href="/about"
|
||||||
|
@ -107,7 +107,7 @@ class Intro extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
Intro.propTypes = {
|
Intro.propTypes = {
|
||||||
handleOpenRegistration: PropTypes.func,
|
handleClickRegistration: PropTypes.func,
|
||||||
messages: PropTypes.shape({
|
messages: PropTypes.shape({
|
||||||
'intro.aboutScratch': PropTypes.string,
|
'intro.aboutScratch': PropTypes.string,
|
||||||
'intro.forEducators': PropTypes.string,
|
'intro.forEducators': PropTypes.string,
|
||||||
|
@ -139,9 +139,9 @@ const mapStateToProps = state => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
handleOpenRegistration: event => {
|
handleClickRegistration: event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
dispatch(navigationActions.setRegistrationOpen(true));
|
dispatch(navigationActions.handleRegistrationRequested());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,7 @@ class BirthDateStep extends React.Component {
|
||||||
} = props;
|
} = props;
|
||||||
return (
|
return (
|
||||||
<JoinFlowStep
|
<JoinFlowStep
|
||||||
|
headerImgClass="birthdate-step-image"
|
||||||
headerImgSrc="/images/join-flow/birthdate-header.png"
|
headerImgSrc="/images/join-flow/birthdate-header.png"
|
||||||
innerClassName="join-flow-inner-birthdate-step"
|
innerClassName="join-flow-inner-birthdate-step"
|
||||||
title={this.props.intl.formatMessage({id: 'registration.birthDateStepTitle'})}
|
title={this.props.intl.formatMessage({id: 'registration.birthDateStepTitle'})}
|
||||||
|
|
|
@ -69,6 +69,7 @@ class CountryStep extends React.Component {
|
||||||
} = props;
|
} = props;
|
||||||
return (
|
return (
|
||||||
<JoinFlowStep
|
<JoinFlowStep
|
||||||
|
headerImgClass="country-step-image"
|
||||||
headerImgSrc="/images/join-flow/country-header.png"
|
headerImgSrc="/images/join-flow/country-header.png"
|
||||||
innerClassName="join-flow-inner-country-step"
|
innerClassName="join-flow-inner-country-step"
|
||||||
title={this.props.intl.formatMessage({id: 'registration.countryStepTitle'})}
|
title={this.props.intl.formatMessage({id: 'registration.countryStepTitle'})}
|
||||||
|
|
|
@ -21,6 +21,7 @@ class EmailStep extends React.Component {
|
||||||
'handleSetEmailRef',
|
'handleSetEmailRef',
|
||||||
'handleValidSubmit',
|
'handleValidSubmit',
|
||||||
'validateEmail',
|
'validateEmail',
|
||||||
|
'validateEmailRemotelyWithCache',
|
||||||
'validateForm',
|
'validateForm',
|
||||||
'setCaptchaRef',
|
'setCaptchaRef',
|
||||||
'captchaSolved',
|
'captchaSolved',
|
||||||
|
@ -30,14 +31,18 @@ class EmailStep extends React.Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
captchaIsLoading: true
|
captchaIsLoading: true
|
||||||
};
|
};
|
||||||
|
// simple object to memoize remote requests for email addresses.
|
||||||
|
// keeps us from submitting multiple requests for same data.
|
||||||
|
this.emailRemoteCache = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
// automatically start with focus on username field
|
// automatically start with focus on username field
|
||||||
if (this.emailInput) this.emailInput.focus();
|
if (this.emailInput) this.emailInput.focus();
|
||||||
|
|
||||||
// If grecaptcha doesn't exist on window, we havent loaded the captcha js yet. Load it.
|
if (window.grecaptcha) {
|
||||||
if (!window.grecaptcha) {
|
this.onCaptchaLoad();
|
||||||
|
} else {
|
||||||
|
// If grecaptcha doesn't exist on window, we havent loaded the captcha js yet. Load it.
|
||||||
// ReCaptcha calls a callback when the grecatpcha object is usable. That callback
|
// ReCaptcha calls a callback when the grecatpcha object is usable. That callback
|
||||||
// needs to be global so set it on the window.
|
// needs to be global so set it on the window.
|
||||||
window.grecaptchaOnLoad = this.onCaptchaLoad;
|
window.grecaptchaOnLoad = this.onCaptchaLoad;
|
||||||
|
@ -78,11 +83,24 @@ class EmailStep extends React.Component {
|
||||||
},
|
},
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
// simple function to memoize remote requests for usernames
|
||||||
|
validateEmailRemotelyWithCache (email) {
|
||||||
|
if (this.emailRemoteCache.hasOwnProperty(email)) {
|
||||||
|
return Promise.resolve(this.emailRemoteCache[email]);
|
||||||
|
}
|
||||||
|
// email is not in our cache
|
||||||
|
return validate.validateEmailRemotely(email).then(
|
||||||
|
remoteResult => {
|
||||||
|
this.emailRemoteCache[email] = remoteResult;
|
||||||
|
return remoteResult;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
validateEmail (email) {
|
validateEmail (email) {
|
||||||
if (!email) return this.props.intl.formatMessage({id: 'general.required'});
|
if (!email) return this.props.intl.formatMessage({id: 'general.required'});
|
||||||
const localResult = validate.validateEmailLocally(email);
|
const localResult = validate.validateEmailLocally(email);
|
||||||
if (!localResult.valid) return this.props.intl.formatMessage({id: localResult.errMsgId});
|
if (!localResult.valid) return this.props.intl.formatMessage({id: localResult.errMsgId});
|
||||||
return validate.validateEmailRemotely(email).then(
|
return this.validateEmailRemotelyWithCache(email).then(
|
||||||
remoteResult => {
|
remoteResult => {
|
||||||
if (remoteResult.valid === true) {
|
if (remoteResult.valid === true) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -151,6 +169,7 @@ class EmailStep extends React.Component {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
headerImgClass="email-step-image"
|
||||||
headerImgSrc="/images/join-flow/email-header.png"
|
headerImgSrc="/images/join-flow/email-header.png"
|
||||||
innerClassName="join-flow-inner-email-step"
|
innerClassName="join-flow-inner-email-step"
|
||||||
nextButton={this.props.intl.formatMessage({id: 'registration.createAccount'})}
|
nextButton={this.props.intl.formatMessage({id: 'registration.createAccount'})}
|
||||||
|
@ -160,6 +179,9 @@ class EmailStep extends React.Component {
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
<FormikInput
|
<FormikInput
|
||||||
|
autoCapitalize="off"
|
||||||
|
autoComplete="off"
|
||||||
|
autoCorrect="off"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'join-flow-input',
|
'join-flow-input',
|
||||||
'join-flow-input-tall',
|
'join-flow-input-tall',
|
||||||
|
@ -169,6 +191,7 @@ class EmailStep extends React.Component {
|
||||||
id="email"
|
id="email"
|
||||||
name="email"
|
name="email"
|
||||||
placeholder={this.props.intl.formatMessage({id: 'general.emailAddress'})}
|
placeholder={this.props.intl.formatMessage({id: 'general.emailAddress'})}
|
||||||
|
type="email"
|
||||||
validate={this.validateEmail}
|
validate={this.validateEmail}
|
||||||
validationClassName="validation-full-width-input"
|
validationClassName="validation-full-width-input"
|
||||||
/* eslint-disable react/jsx-no-bind */
|
/* eslint-disable react/jsx-no-bind */
|
||||||
|
|
|
@ -14,6 +14,7 @@ const JoinFlowStep = ({
|
||||||
description,
|
description,
|
||||||
descriptionClassName,
|
descriptionClassName,
|
||||||
footerContent,
|
footerContent,
|
||||||
|
headerImgClass,
|
||||||
headerImgSrc,
|
headerImgSrc,
|
||||||
nextButton,
|
nextButton,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
@ -21,10 +22,18 @@ const JoinFlowStep = ({
|
||||||
titleClassName,
|
titleClassName,
|
||||||
waiting
|
waiting
|
||||||
}) => (
|
}) => (
|
||||||
<form onSubmit={onSubmit}>
|
<form
|
||||||
|
autoComplete="off"
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
>
|
||||||
<div className="join-flow-outer-content">
|
<div className="join-flow-outer-content">
|
||||||
{headerImgSrc && (
|
{headerImgSrc && (
|
||||||
<div className="join-flow-header-image-wrapper">
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'join-flow-header-image-wrapper',
|
||||||
|
headerImgClass
|
||||||
|
)}
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
className="join-flow-header-image"
|
className="join-flow-header-image"
|
||||||
src={headerImgSrc}
|
src={headerImgSrc}
|
||||||
|
@ -80,6 +89,7 @@ JoinFlowStep.propTypes = {
|
||||||
description: PropTypes.string,
|
description: PropTypes.string,
|
||||||
descriptionClassName: PropTypes.string,
|
descriptionClassName: PropTypes.string,
|
||||||
footerContent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
footerContent: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||||
|
headerImgClass: PropTypes.string,
|
||||||
headerImgSrc: PropTypes.string,
|
headerImgSrc: PropTypes.string,
|
||||||
innerClassName: PropTypes.string,
|
innerClassName: PropTypes.string,
|
||||||
nextButton: PropTypes.node,
|
nextButton: PropTypes.node,
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
.join-flow-inner-content {
|
.join-flow-inner-content {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
width: calc(100% - 5.875rem);
|
width: calc(50% + 7.84375rem);
|
||||||
/* must use padding for top, rather than margin, because margins will collapse */
|
/* must use padding for top, rather than margin, because margins will collapse */
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2.3125rem 0 2.5rem;
|
padding: 2.3125rem 0 2.5rem;
|
||||||
|
@ -36,8 +36,7 @@
|
||||||
/* overflow will only work if this class is set on parent of img, not img itself */
|
/* overflow will only work if this class is set on parent of img, not img itself */
|
||||||
.join-flow-header-image-wrapper {
|
.join-flow-header-image-wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 7.5rem;
|
height: 7.5rem;
|
||||||
max-height: 8.75rem;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-top-left-radius: 1rem;
|
border-top-left-radius: 1rem;
|
||||||
|
|
|
@ -89,10 +89,18 @@
|
||||||
.select .join-flow-select-month {
|
.select .join-flow-select-month {
|
||||||
margin-right: .5rem;
|
margin-right: .5rem;
|
||||||
width: 9.125rem;
|
width: 9.125rem;
|
||||||
|
|
||||||
|
@media #{$small} {
|
||||||
|
width: 8.25rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select .join-flow-select-year {
|
.select .join-flow-select-year {
|
||||||
width: 9.125rem;
|
width: 9.125rem;
|
||||||
|
|
||||||
|
@media #{$small} {
|
||||||
|
width: 8.25rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select .join-flow-select-country {
|
.select .join-flow-select-country {
|
||||||
|
@ -100,6 +108,10 @@
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.country-step-image {
|
||||||
|
background-color: $ui-purple;
|
||||||
|
}
|
||||||
|
|
||||||
.join-flow-password-section {
|
.join-flow-password-section {
|
||||||
margin-top: 1.125rem;
|
margin-top: 1.125rem;
|
||||||
}
|
}
|
||||||
|
@ -109,6 +121,10 @@
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.birthdate-step-image {
|
||||||
|
background-color: $ui-magenta;
|
||||||
|
}
|
||||||
|
|
||||||
.join-flow-privacy-message {
|
.join-flow-privacy-message {
|
||||||
margin: 1rem auto;
|
margin: 1rem auto;
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
|
@ -157,7 +173,12 @@
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.email-step-image {
|
||||||
|
background-color: $dd-medium-blue;
|
||||||
|
}
|
||||||
|
|
||||||
.join-flow-registration-error {
|
.join-flow-registration-error {
|
||||||
|
user-select: text; /* make text selectable, so users can copy errors */
|
||||||
padding-top: 5.5rem;
|
padding-top: 5.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,9 +204,13 @@
|
||||||
margin-bottom: 1.25rem;
|
margin-bottom: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.welcome-step-image {
|
||||||
|
background-color: $ui-yellow;
|
||||||
|
}
|
||||||
|
|
||||||
.gender-radio-row {
|
.gender-radio-row {
|
||||||
transition: all .125s ease;
|
transition: all .125s ease;
|
||||||
width: 20.875rem;
|
width: 97%;
|
||||||
min-height: 2.85rem;
|
min-height: 2.85rem;
|
||||||
background-color: $ui-gray;
|
background-color: $ui-gray;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
|
|
|
@ -23,17 +23,26 @@ class JoinFlow extends React.Component {
|
||||||
super(props);
|
super(props);
|
||||||
bindAll(this, [
|
bindAll(this, [
|
||||||
'handleAdvanceStep',
|
'handleAdvanceStep',
|
||||||
|
'handleErrorNext',
|
||||||
'handleRegistrationError',
|
'handleRegistrationError',
|
||||||
'handlePrepareToRegister',
|
'handlePrepareToRegister',
|
||||||
'handleRegistrationResponse',
|
'handleRegistrationResponse',
|
||||||
'handleSubmitRegistration'
|
'handleSubmitRegistration'
|
||||||
]);
|
]);
|
||||||
this.state = {
|
this.initialState = {
|
||||||
|
numAttempts: 0,
|
||||||
formData: {},
|
formData: {},
|
||||||
registrationError: null,
|
registrationError: null,
|
||||||
step: 0,
|
step: 0,
|
||||||
waiting: false
|
waiting: false
|
||||||
};
|
};
|
||||||
|
// it's ok to set state by reference, because state is treated as immutable,
|
||||||
|
// so any changes to its fields will result in a new state which does not
|
||||||
|
// reference its past fields
|
||||||
|
this.state = this.initialState;
|
||||||
|
}
|
||||||
|
canTryAgain () {
|
||||||
|
return (this.state.numAttempts <= 1);
|
||||||
}
|
}
|
||||||
handleRegistrationError (message) {
|
handleRegistrationError (message) {
|
||||||
if (!message) {
|
if (!message) {
|
||||||
|
@ -64,7 +73,11 @@ class JoinFlow extends React.Component {
|
||||||
// "success": false
|
// "success": false
|
||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
this.setState({waiting: false}, () => {
|
// username: 'username exists'
|
||||||
|
this.setState({
|
||||||
|
numAttempts: this.state.numAttempts + 1,
|
||||||
|
waiting: false
|
||||||
|
}, () => {
|
||||||
let errStr = '';
|
let errStr = '';
|
||||||
if (!err && res.statusCode === 200) {
|
if (!err && res.statusCode === 200) {
|
||||||
if (body && body[0]) {
|
if (body && body[0]) {
|
||||||
|
@ -100,7 +113,9 @@ class JoinFlow extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleSubmitRegistration (formData) {
|
handleSubmitRegistration (formData) {
|
||||||
this.setState({waiting: true}, () => {
|
this.setState({
|
||||||
|
waiting: true
|
||||||
|
}, () => {
|
||||||
api({
|
api({
|
||||||
host: '',
|
host: '',
|
||||||
uri: '/accounts/register_new_user/',
|
uri: '/accounts/register_new_user/',
|
||||||
|
@ -133,14 +148,25 @@ class JoinFlow extends React.Component {
|
||||||
step: this.state.step + 1
|
step: this.state.step + 1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
handleErrorNext () {
|
||||||
|
if (this.canTryAgain()) {
|
||||||
|
this.handleSubmitRegistration(this.state.formData);
|
||||||
|
} else {
|
||||||
|
this.resetState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetState () {
|
||||||
|
this.setState(this.initialState);
|
||||||
|
}
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{this.state.registrationError ? (
|
{this.state.registrationError ? (
|
||||||
<RegistrationErrorStep
|
<RegistrationErrorStep
|
||||||
|
canTryAgain={this.canTryAgain()}
|
||||||
errorMsg={this.state.registrationError}
|
errorMsg={this.state.registrationError}
|
||||||
/* eslint-disable react/jsx-no-bind */
|
/* eslint-disable react/jsx-no-bind */
|
||||||
onTryAgain={() => this.handleSubmitRegistration(this.state.formData)}
|
onSubmit={this.handleErrorNext}
|
||||||
/* eslint-enable react/jsx-no-bind */
|
/* eslint-enable react/jsx-no-bind */
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -19,14 +19,17 @@ class RegistrationErrorStep extends React.Component {
|
||||||
// But here, we're not really submitting, so we need to prevent
|
// But here, we're not really submitting, so we need to prevent
|
||||||
// the form from navigating away from the current page.
|
// the form from navigating away from the current page.
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.onTryAgain();
|
this.props.onSubmit();
|
||||||
}
|
}
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<JoinFlowStep
|
<JoinFlowStep
|
||||||
description={this.props.errorMsg}
|
description={this.props.errorMsg}
|
||||||
innerClassName="join-flow-registration-error"
|
innerClassName="join-flow-registration-error"
|
||||||
nextButton={this.props.intl.formatMessage({id: 'general.tryAgain'})}
|
nextButton={this.props.canTryAgain ?
|
||||||
|
this.props.intl.formatMessage({id: 'general.tryAgain'}) :
|
||||||
|
this.props.intl.formatMessage({id: 'general.startOver'})
|
||||||
|
}
|
||||||
title={this.props.intl.formatMessage({id: 'registration.generalError'})}
|
title={this.props.intl.formatMessage({id: 'registration.generalError'})}
|
||||||
onSubmit={this.handleSubmit}
|
onSubmit={this.handleSubmit}
|
||||||
/>
|
/>
|
||||||
|
@ -35,9 +38,10 @@ class RegistrationErrorStep extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
RegistrationErrorStep.propTypes = {
|
RegistrationErrorStep.propTypes = {
|
||||||
|
canTryAgain: PropTypes.bool,
|
||||||
errorMsg: PropTypes.string,
|
errorMsg: PropTypes.string,
|
||||||
intl: intlShape,
|
intl: intlShape,
|
||||||
onTryAgain: PropTypes.func
|
onSubmit: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
const IntlRegistrationErrorStep = injectIntl(RegistrationErrorStep);
|
const IntlRegistrationErrorStep = injectIntl(RegistrationErrorStep);
|
||||||
|
|
|
@ -26,11 +26,15 @@ class UsernameStep extends React.Component {
|
||||||
'validatePasswordIfPresent',
|
'validatePasswordIfPresent',
|
||||||
'validatePasswordConfirmIfPresent',
|
'validatePasswordConfirmIfPresent',
|
||||||
'validateUsernameIfPresent',
|
'validateUsernameIfPresent',
|
||||||
|
'validateUsernameRemotelyWithCache',
|
||||||
'validateForm'
|
'validateForm'
|
||||||
]);
|
]);
|
||||||
this.state = {
|
this.state = {
|
||||||
focused: null
|
focused: null
|
||||||
};
|
};
|
||||||
|
// simple object to memoize remote requests for usernames.
|
||||||
|
// keeps us from submitting multiple requests for same data.
|
||||||
|
this.usernameRemoteCache = {};
|
||||||
}
|
}
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
// automatically start with focus on username field
|
// automatically start with focus on username field
|
||||||
|
@ -44,12 +48,25 @@ class UsernameStep extends React.Component {
|
||||||
handleSetUsernameRef (usernameInputRef) {
|
handleSetUsernameRef (usernameInputRef) {
|
||||||
this.usernameInput = 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
|
// we allow username to be empty on blur, since you might not have typed anything yet
|
||||||
validateUsernameIfPresent (username) {
|
validateUsernameIfPresent (username) {
|
||||||
if (!username) return null; // skip validation if username is blank; null indicates valid
|
if (!username) return null; // skip validation if username is blank; null indicates valid
|
||||||
// if username is not blank, run both local and remote validations
|
// if username is not blank, run both local and remote validations
|
||||||
const localResult = validate.validateUsernameLocally(username);
|
const localResult = validate.validateUsernameLocally(username);
|
||||||
return validate.validateUsernameRemotely(username).then(
|
return this.validateUsernameRemotelyWithCache(username).then(
|
||||||
remoteResult => {
|
remoteResult => {
|
||||||
// there may be multiple validation errors. Prioritize vulgarity, then
|
// there may be multiple validation errors. Prioritize vulgarity, then
|
||||||
// length, then having invalid chars, then all other remote reports
|
// 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'})}
|
{this.props.intl.formatMessage({id: 'registration.createUsername'})}
|
||||||
</div>
|
</div>
|
||||||
<FormikInput
|
<FormikInput
|
||||||
|
autoCapitalize="off"
|
||||||
|
autoComplete="off"
|
||||||
|
autoCorrect="off"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'join-flow-input'
|
'join-flow-input'
|
||||||
)}
|
)}
|
||||||
|
@ -150,6 +170,7 @@ class UsernameStep extends React.Component {
|
||||||
id="username"
|
id="username"
|
||||||
name="username"
|
name="username"
|
||||||
placeholder={this.props.intl.formatMessage({id: 'general.username'})}
|
placeholder={this.props.intl.formatMessage({id: 'general.username'})}
|
||||||
|
spellCheck={false}
|
||||||
toolTip={this.state.focused === 'username' && !touched.username &&
|
toolTip={this.state.focused === 'username' && !touched.username &&
|
||||||
this.props.intl.formatMessage({id: 'registration.usernameAdviceShort'})}
|
this.props.intl.formatMessage({id: 'registration.usernameAdviceShort'})}
|
||||||
validate={this.validateUsernameIfPresent}
|
validate={this.validateUsernameIfPresent}
|
||||||
|
@ -170,6 +191,9 @@ class UsernameStep extends React.Component {
|
||||||
{this.props.intl.formatMessage({id: 'registration.choosePasswordStepTitle'})}
|
{this.props.intl.formatMessage({id: 'registration.choosePasswordStepTitle'})}
|
||||||
</div>
|
</div>
|
||||||
<FormikInput
|
<FormikInput
|
||||||
|
autoCapitalize="off"
|
||||||
|
autoComplete={values.showPassword ? 'off' : 'new-password'}
|
||||||
|
autoCorrect="off"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'join-flow-input',
|
'join-flow-input',
|
||||||
{'join-flow-input-password':
|
{'join-flow-input-password':
|
||||||
|
@ -179,6 +203,7 @@ class UsernameStep extends React.Component {
|
||||||
id="password"
|
id="password"
|
||||||
name="password"
|
name="password"
|
||||||
placeholder={this.props.intl.formatMessage({id: 'general.password'})}
|
placeholder={this.props.intl.formatMessage({id: 'general.password'})}
|
||||||
|
spellCheck={false}
|
||||||
toolTip={this.state.focused === 'password' && !touched.password &&
|
toolTip={this.state.focused === 'password' && !touched.password &&
|
||||||
this.props.intl.formatMessage({id: 'registration.passwordAdviceShort'})}
|
this.props.intl.formatMessage({id: 'registration.passwordAdviceShort'})}
|
||||||
type={values.showPassword ? 'text' : 'password'}
|
type={values.showPassword ? 'text' : 'password'}
|
||||||
|
@ -195,6 +220,9 @@ class UsernameStep extends React.Component {
|
||||||
/* eslint-enable react/jsx-no-bind */
|
/* eslint-enable react/jsx-no-bind */
|
||||||
/>
|
/>
|
||||||
<FormikInput
|
<FormikInput
|
||||||
|
autoCapitalize="off"
|
||||||
|
autoComplete={values.showPassword ? 'off' : 'new-password'}
|
||||||
|
autoCorrect="off"
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'join-flow-input',
|
'join-flow-input',
|
||||||
'join-flow-password-confirm',
|
'join-flow-password-confirm',
|
||||||
|
@ -210,6 +238,7 @@ class UsernameStep extends React.Component {
|
||||||
placeholder={this.props.intl.formatMessage({
|
placeholder={this.props.intl.formatMessage({
|
||||||
id: 'registration.confirmPasswordInstruction'
|
id: 'registration.confirmPasswordInstruction'
|
||||||
})}
|
})}
|
||||||
|
spellCheck={false}
|
||||||
toolTip={
|
toolTip={
|
||||||
this.state.focused === 'passwordConfirm' && !touched.passwordConfirm &&
|
this.state.focused === 'passwordConfirm' && !touched.passwordConfirm &&
|
||||||
this.props.intl.formatMessage({
|
this.props.intl.formatMessage({
|
||||||
|
|
|
@ -43,6 +43,7 @@ class WelcomeStep extends React.Component {
|
||||||
id: 'registration.welcomeStepDescriptionNonEducator'
|
id: 'registration.welcomeStepDescriptionNonEducator'
|
||||||
})}
|
})}
|
||||||
descriptionClassName="join-flow-welcome-description"
|
descriptionClassName="join-flow-welcome-description"
|
||||||
|
headerImgClass="welcome-step-image"
|
||||||
headerImgSrc="/images/join-flow/welcome-header.png"
|
headerImgSrc="/images/join-flow/welcome-header.png"
|
||||||
innerClassName="join-flow-inner-welcome-step"
|
innerClassName="join-flow-inner-welcome-step"
|
||||||
nextButton={this.props.createProjectOnComplete ? (
|
nextButton={this.props.createProjectOnComplete ? (
|
||||||
|
|
|
@ -27,7 +27,6 @@ class Navigation extends React.Component {
|
||||||
super(props);
|
super(props);
|
||||||
bindAll(this, [
|
bindAll(this, [
|
||||||
'getProfileUrl',
|
'getProfileUrl',
|
||||||
'handleClickRegistration',
|
|
||||||
'handleSearchSubmit'
|
'handleSearchSubmit'
|
||||||
]);
|
]);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -78,13 +77,6 @@ class Navigation extends React.Component {
|
||||||
if (!this.props.user) return;
|
if (!this.props.user) return;
|
||||||
return `/users/${this.props.user.username}/`;
|
return `/users/${this.props.user.username}/`;
|
||||||
}
|
}
|
||||||
handleClickRegistration (event) {
|
|
||||||
if (this.props.useScratch3Registration) {
|
|
||||||
this.props.navigateToRegistration(event);
|
|
||||||
} else {
|
|
||||||
this.props.handleOpenRegistration(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handleSearchSubmit (formData) {
|
handleSearchSubmit (formData) {
|
||||||
let targetUrl = '/search/projects';
|
let targetUrl = '/search/projects';
|
||||||
if (formData.q) {
|
if (formData.q) {
|
||||||
|
@ -201,7 +193,7 @@ class Navigation extends React.Component {
|
||||||
<a
|
<a
|
||||||
className="registrationLink"
|
className="registrationLink"
|
||||||
href="#"
|
href="#"
|
||||||
onClick={this.handleClickRegistration}
|
onClick={this.props.handleClickRegistration}
|
||||||
>
|
>
|
||||||
<FormattedMessage id="general.joinScratch" />
|
<FormattedMessage id="general.joinScratch" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -239,13 +231,12 @@ class Navigation extends React.Component {
|
||||||
Navigation.propTypes = {
|
Navigation.propTypes = {
|
||||||
accountNavOpen: PropTypes.bool,
|
accountNavOpen: PropTypes.bool,
|
||||||
getMessageCount: PropTypes.func,
|
getMessageCount: PropTypes.func,
|
||||||
|
handleClickRegistration: PropTypes.func,
|
||||||
handleCloseAccountNav: PropTypes.func,
|
handleCloseAccountNav: PropTypes.func,
|
||||||
handleLogOut: PropTypes.func,
|
handleLogOut: PropTypes.func,
|
||||||
handleOpenRegistration: PropTypes.func,
|
|
||||||
handleToggleAccountNav: PropTypes.func,
|
handleToggleAccountNav: PropTypes.func,
|
||||||
handleToggleLoginOpen: PropTypes.func,
|
handleToggleLoginOpen: PropTypes.func,
|
||||||
intl: intlShape,
|
intl: intlShape,
|
||||||
navigateToRegistration: PropTypes.func,
|
|
||||||
permissions: PropTypes.shape({
|
permissions: PropTypes.shape({
|
||||||
admin: PropTypes.bool,
|
admin: PropTypes.bool,
|
||||||
social: PropTypes.bool,
|
social: PropTypes.bool,
|
||||||
|
@ -296,9 +287,9 @@ const mapDispatchToProps = dispatch => ({
|
||||||
handleCloseAccountNav: () => {
|
handleCloseAccountNav: () => {
|
||||||
dispatch(navigationActions.setAccountNavOpen(false));
|
dispatch(navigationActions.setAccountNavOpen(false));
|
||||||
},
|
},
|
||||||
handleOpenRegistration: event => {
|
handleClickRegistration: event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
dispatch(navigationActions.setRegistrationOpen(true));
|
dispatch(navigationActions.handleRegistrationRequested());
|
||||||
},
|
},
|
||||||
handleLogOut: event => {
|
handleLogOut: event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -308,10 +299,6 @@ const mapDispatchToProps = dispatch => ({
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
dispatch(navigationActions.toggleLoginOpen());
|
dispatch(navigationActions.toggleLoginOpen());
|
||||||
},
|
},
|
||||||
navigateToRegistration: event => {
|
|
||||||
event.preventDefault();
|
|
||||||
navigationActions.navigateToRegistration();
|
|
||||||
},
|
|
||||||
setMessageCount: newCount => {
|
setMessageCount: newCount => {
|
||||||
dispatch(messageCountActions.setCount(newCount));
|
dispatch(messageCountActions.setCount(newCount));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ const Page = ({
|
||||||
children,
|
children,
|
||||||
className
|
className
|
||||||
}) => (
|
}) => (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary componentName="Page">
|
||||||
<div className={classNames('page', className)}>
|
<div className={classNames('page', className)}>
|
||||||
<div
|
<div
|
||||||
className={classNames({
|
className={classNames({
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
"general.search": "Search",
|
"general.search": "Search",
|
||||||
"general.searchEmpty": "Nothing found",
|
"general.searchEmpty": "Nothing found",
|
||||||
"general.signIn": "Sign in",
|
"general.signIn": "Sign in",
|
||||||
|
"general.startOver": "Start over",
|
||||||
"general.statistics": "Statistics",
|
"general.statistics": "Statistics",
|
||||||
"general.studios": "Studios",
|
"general.studios": "Studios",
|
||||||
"general.support": "Support",
|
"general.support": "Support",
|
||||||
|
@ -182,7 +183,7 @@
|
||||||
"registration.invitedBy": "invited by",
|
"registration.invitedBy": "invited by",
|
||||||
"registration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account",
|
"registration.lastStepTitle": "Thank you for requesting a Scratch Teacher Account",
|
||||||
"registration.lastStepDescription": "We are currently processing your application. ",
|
"registration.lastStepDescription": "We are currently processing your application. ",
|
||||||
"registration.makeProject": "Make a Project",
|
"registration.makeProject": "Make a project",
|
||||||
"registration.mustBeNewStudent": "You must be a new student to complete your registration",
|
"registration.mustBeNewStudent": "You must be a new student to complete your registration",
|
||||||
"registration.nameStepTooltip": "This information is used for verification and to aggregate usage statistics.",
|
"registration.nameStepTooltip": "This information is used for verification and to aggregate usage statistics.",
|
||||||
"registration.newPassword": "New Password",
|
"registration.newPassword": "New Password",
|
||||||
|
|
|
@ -1060,23 +1060,25 @@ const dupeCommonCountries = module.exports.dupeCommonCountries = (startingCountr
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* registrationCountryOptions is the result of taking the standard countryInfo,
|
* registrationCountryOptions is the result of taking the standard countryInfo,
|
||||||
* and duplicating 'United States of America' and 'United Kingdom' at the top of the list.
|
* setting a 'value' key and a 'label' key both to the country data's 'name' value,
|
||||||
|
* but using the 'display' value for 'label' instead of 'name' if 'display' exists;
|
||||||
|
* then duplicating 'United States of America' and 'United Kingdom' at the top of the list.
|
||||||
* The result is an array like:
|
* The result is an array like:
|
||||||
* [
|
* [
|
||||||
* {code: 'us', name: 'United States', display: 'United States of America'},
|
* {value: 'United States', label: 'United States of America'},
|
||||||
* {code: 'gb', name: 'United Kingdom'},
|
* {value: 'United Kingdom', label: 'United Kingdom'},
|
||||||
* {code: 'af', name: 'Afghanistan'},
|
* {value: 'Afghanistan', label: 'Afghanistan'},
|
||||||
* ...
|
* ...
|
||||||
* {code: 'ae', name: 'United Arab Emirates'},
|
* {value: 'United Arab Emirates', label: 'United Arab Emirates'},
|
||||||
* {code: 'us', name: 'United States', display: 'United States of America'},
|
* {value: 'United States', label: 'United States of America'},
|
||||||
* {code: 'gb', name: 'United Kingdom'},
|
* {value: 'United Kingdom', label: 'United Kingdom'},
|
||||||
* {code: 'uz', name: 'Uzbekistan'},
|
* {value: 'Uzbekistan', label: 'Uzbekistan'},
|
||||||
* ...
|
* ...
|
||||||
* {code: 'zm', name: 'Zimbabwe'}
|
* {value: 'Zimbabwe', label: 'Zimbabwe'}
|
||||||
* ]
|
* ]
|
||||||
*/
|
*/
|
||||||
module.exports.registrationCountryOptions =
|
module.exports.registrationCountryOptions =
|
||||||
countryOptions(dupeCommonCountries(countryInfo, ['us', 'gb']), 'code');
|
countryOptions(dupeCommonCountries(countryInfo, ['us', 'gb']), 'name');
|
||||||
|
|
||||||
/* subdivisionOptions uses iso-3166 data to produce an array like:
|
/* subdivisionOptions uses iso-3166 data to produce an array like:
|
||||||
* [
|
* [
|
||||||
|
|
|
@ -14,7 +14,8 @@ const Types = keyMirror({
|
||||||
SET_LOGIN_OPEN: null,
|
SET_LOGIN_OPEN: null,
|
||||||
TOGGLE_LOGIN_OPEN: null,
|
TOGGLE_LOGIN_OPEN: null,
|
||||||
SET_CANCELED_DELETION_OPEN: null,
|
SET_CANCELED_DELETION_OPEN: null,
|
||||||
SET_REGISTRATION_OPEN: null
|
SET_REGISTRATION_OPEN: null,
|
||||||
|
HANDLE_REGISTRATION_REQUESTED: null
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.getInitialState = () => ({
|
module.exports.getInitialState = () => ({
|
||||||
|
@ -49,6 +50,12 @@ module.exports.navigationReducer = (state, action) => {
|
||||||
return defaults({canceledDeletionOpen: action.isOpen}, state);
|
return defaults({canceledDeletionOpen: action.isOpen}, state);
|
||||||
case Types.SET_REGISTRATION_OPEN:
|
case Types.SET_REGISTRATION_OPEN:
|
||||||
return defaults({registrationOpen: action.isOpen}, state);
|
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:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -92,9 +99,9 @@ module.exports.setSearchTerm = searchTerm => ({
|
||||||
searchTerm: searchTerm
|
searchTerm: searchTerm
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.navigateToRegistration = () => {
|
module.exports.handleRegistrationRequested = () => ({
|
||||||
window.location = '/join';
|
type: Types.HANDLE_REGISTRATION_REQUESTED
|
||||||
};
|
});
|
||||||
|
|
||||||
module.exports.handleCompleteRegistration = createProject => (dispatch => {
|
module.exports.handleCompleteRegistration = createProject => (dispatch => {
|
||||||
if (createProject) {
|
if (createProject) {
|
||||||
|
|
|
@ -512,7 +512,13 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "fly-tutorial-redirect",
|
"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/?$",
|
"routeAlias": "/(makeit)?fly/?$",
|
||||||
"redirect": "/projects/editor/?tutorial=make-it-fly"
|
"redirect": "/projects/editor/?tutorial=make-it-fly"
|
||||||
},
|
},
|
||||||
|
@ -561,6 +567,16 @@
|
||||||
"pattern": "^/bearstack/?$",
|
"pattern": "^/bearstack/?$",
|
||||||
"redirect": "/ideas"
|
"redirect": "/ideas"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "talking-tales-tutorial-redirect",
|
||||||
|
"pattern": "^/talking-tales/?$",
|
||||||
|
"redirect": "/projects/editor?tutorial=talking"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "code-a-cartoon-tutorial-redirect",
|
||||||
|
"pattern": "^/code-a-cartoon/?$",
|
||||||
|
"redirect": "/projects/331474033/editor/?tutorial=code-cartoon"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "favorite-tutorial-redirect",
|
"name": "favorite-tutorial-redirect",
|
||||||
"pattern": "^/favorite/?$",
|
"pattern": "^/favorite/?$",
|
||||||
|
|
|
@ -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...
|
// 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 Page = require('../../components/page/www/page.jsx'); // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
|
const initSentry = require('../../lib/sentry.js');
|
||||||
|
initSentry();
|
||||||
|
|
||||||
require('./join.scss');
|
require('./join.scss');
|
||||||
const Register = () => (
|
const Register = () => (
|
||||||
<ErrorBoundary>
|
<ErrorBoundary componentName="Join">
|
||||||
<div className="join">
|
<div className="join">
|
||||||
<a
|
<a
|
||||||
aria-label="Scratch"
|
aria-label="Scratch"
|
||||||
|
|
|
@ -5,7 +5,6 @@ const PropTypes = require('prop-types');
|
||||||
const connect = require('react-redux').connect;
|
const connect = require('react-redux').connect;
|
||||||
const injectIntl = require('react-intl').injectIntl;
|
const injectIntl = require('react-intl').injectIntl;
|
||||||
|
|
||||||
const ErrorBoundary = require('../../components/errorboundary/errorboundary.jsx');
|
|
||||||
const projectShape = require('./projectshape.jsx').projectShape;
|
const projectShape = require('./projectshape.jsx').projectShape;
|
||||||
const NotAvailable = require('../../components/not-available/not-available.jsx');
|
const NotAvailable = require('../../components/not-available/not-available.jsx');
|
||||||
const Meta = require('./meta.jsx');
|
const Meta = require('./meta.jsx');
|
||||||
|
@ -35,11 +34,9 @@ class EmbedView extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
if (this.props.projectNotAvailable || this.state.invalidProject) {
|
if (this.props.projectNotAvailable || this.state.invalidProject) {
|
||||||
return (
|
return (
|
||||||
<ErrorBoundary>
|
<div className="preview">
|
||||||
<div className="preview">
|
<NotAvailable />
|
||||||
<NotAvailable />
|
</div>
|
||||||
</div>
|
|
||||||
</ErrorBoundary>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,9 @@ const UnsupportedBrowser = require('./unsupported-browser.jsx');
|
||||||
if (isSupportedBrowser()) {
|
if (isSupportedBrowser()) {
|
||||||
const EmbedView = require('./embed-view.jsx');
|
const EmbedView = require('./embed-view.jsx');
|
||||||
render(
|
render(
|
||||||
<EmbedView.View />,
|
<ErrorBoundary componentName="EmbedView">
|
||||||
|
<EmbedView.View />
|
||||||
|
</ErrorBoundary>,
|
||||||
document.getElementById('app'),
|
document.getElementById('app'),
|
||||||
{
|
{
|
||||||
preview: previewActions.previewReducer,
|
preview: previewActions.previewReducer,
|
||||||
|
@ -26,5 +28,8 @@ if (isSupportedBrowser()) {
|
||||||
EmbedView.guiMiddleware
|
EmbedView.guiMiddleware
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
render(<ErrorBoundary><UnsupportedBrowser /></ErrorBoundary>, document.getElementById('app'));
|
render(
|
||||||
|
<ErrorBoundary componentName="UnsupportedBrowser"><UnsupportedBrowser /></ErrorBoundary>,
|
||||||
|
document.getElementById('app')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,30 @@
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
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 JoinFlowStep = require('../../../src/components/join-flow/join-flow-step.jsx');
|
||||||
const FormikInput = require('../../../src/components/formik-forms/formik-input.jsx');
|
const FormikInput = require('../../../src/components/formik-forms/formik-input.jsx');
|
||||||
const FormikCheckbox = require('../../../src/components/formik-forms/formik-checkbox.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', () => {
|
describe('EmailStep test', () => {
|
||||||
|
afterEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
test('send correct props to formik', () => {
|
test('send correct props to formik', () => {
|
||||||
const wrapper = shallowWithIntl(<EmailStep />);
|
const wrapper = shallowWithIntl(<EmailStep />);
|
||||||
|
|
||||||
|
@ -174,4 +193,66 @@ describe('EmailStep test', () => {
|
||||||
const val = formikWrapper.instance().validateEmail();
|
const val = formikWrapper.instance().validateEmail();
|
||||||
expect(val).toBe('general.required');
|
expect(val).toBe('general.required');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('validateEmailRemotelyWithCache calls validate.validateEmailRemotely', done => {
|
||||||
|
const wrapper = shallowWithIntl(
|
||||||
|
<EmailStep />);
|
||||||
|
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(
|
||||||
|
<EmailStep />
|
||||||
|
);
|
||||||
|
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(
|
||||||
|
<EmailStep />
|
||||||
|
);
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
76
test/unit/components/errorboundary.test.jsx
Normal file
76
test/unit/components/errorboundary.test.jsx
Normal file
|
@ -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 = () => (
|
||||||
|
<div>
|
||||||
|
Children here
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
errorBoundaryWrapper = mountWithIntl(
|
||||||
|
<ErrorBoundary
|
||||||
|
componentName="TestEBName"
|
||||||
|
>
|
||||||
|
<ChildClass id="childClass" />
|
||||||
|
</ErrorBoundary>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
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');
|
||||||
|
});
|
||||||
|
});
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
||||||
|
const defaults = require('lodash.defaultsdeep');
|
||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
import JoinFlow from '../../../src/components/join-flow/join-flow';
|
import JoinFlow from '../../../src/components/join-flow/join-flow';
|
||||||
import Progression from '../../../src/components/progression/progression.jsx';
|
import Progression from '../../../src/components/progression/progression.jsx';
|
||||||
|
@ -126,6 +127,7 @@ describe('JoinFlow', () => {
|
||||||
expect(joinFlowInstance.props.refreshSession).not.toHaveBeenCalled();
|
expect(joinFlowInstance.props.refreshSession).not.toHaveBeenCalled();
|
||||||
expect(joinFlowInstance.state.registrationError).toBe('registration.generalError (400)');
|
expect(joinFlowInstance.state.registrationError).toBe('registration.generalError (400)');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('handleRegistrationError with no message ', () => {
|
test('handleRegistrationError with no message ', () => {
|
||||||
const joinFlowInstance = getJoinFlowWrapper().instance();
|
const joinFlowInstance = getJoinFlowWrapper().instance();
|
||||||
joinFlowInstance.setState({});
|
joinFlowInstance.setState({});
|
||||||
|
@ -175,4 +177,71 @@ describe('JoinFlow', () => {
|
||||||
expect(registrationErrorWrapper).toHaveLength(0);
|
expect(registrationErrorWrapper).toHaveLength(0);
|
||||||
expect(progressionWrapper).toHaveLength(1);
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,7 @@ const React = require('react');
|
||||||
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
const {shallowWithIntl} = require('../../helpers/intl-helpers.jsx');
|
||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
const Navigation = require('../../../src/components/navigation/www/navigation.jsx');
|
const Navigation = require('../../../src/components/navigation/www/navigation.jsx');
|
||||||
|
const Registration = require('../../../src/components/registration/registration.jsx');
|
||||||
const sessionActions = require('../../../src/redux/session.js');
|
const sessionActions = require('../../../src/redux/session.js');
|
||||||
|
|
||||||
describe('Navigation', () => {
|
describe('Navigation', () => {
|
||||||
|
@ -24,7 +25,41 @@ describe('Navigation', () => {
|
||||||
.dive(); // unwrap injectIntl(JoinFlow)
|
.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(<Registration />)).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(<Registration />)).toEqual(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('when using old join flow, clicking Join Scratch calls handleRegistrationRequested', () => {
|
||||||
store = mockStore({
|
store = mockStore({
|
||||||
navigation: {
|
navigation: {
|
||||||
useScratch3Registration: false
|
useScratch3Registration: false
|
||||||
|
@ -37,16 +72,17 @@ describe('Navigation', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const props = {
|
const props = {
|
||||||
handleOpenRegistration: jest.fn()
|
handleClickRegistration: jest.fn()
|
||||||
};
|
};
|
||||||
const navWrapper = getNavigationWrapper(props);
|
const navWrapper = getNavigationWrapper(props);
|
||||||
const navInstance = navWrapper.instance();
|
const navInstance = navWrapper.instance();
|
||||||
|
|
||||||
navWrapper.find('a.registrationLink').simulate('click');
|
// simulate click, with mocked event
|
||||||
expect(navInstance.props.handleOpenRegistration).toHaveBeenCalled();
|
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({
|
store = mockStore({
|
||||||
navigation: {
|
navigation: {
|
||||||
useScratch3Registration: true
|
useScratch3Registration: true
|
||||||
|
@ -59,12 +95,12 @@ describe('Navigation', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const props = {
|
const props = {
|
||||||
navigateToRegistration: jest.fn()
|
handleClickRegistration: jest.fn()
|
||||||
};
|
};
|
||||||
const navWrapper = getNavigationWrapper(props);
|
const navWrapper = getNavigationWrapper(props);
|
||||||
const navInstance = navWrapper.instance();
|
const navInstance = navWrapper.instance();
|
||||||
|
|
||||||
navWrapper.find('a.registrationLink').simulate('click');
|
navWrapper.find('a.registrationLink').simulate('click', {preventDefault () {}});
|
||||||
expect(navInstance.props.navigateToRegistration).toHaveBeenCalled();
|
expect(navInstance.props.handleClickRegistration).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,30 +4,46 @@ import JoinFlowStep from '../../../src/components/join-flow/join-flow-step';
|
||||||
import RegistrationErrorStep from '../../../src/components/join-flow/registration-error-step';
|
import RegistrationErrorStep from '../../../src/components/join-flow/registration-error-step';
|
||||||
|
|
||||||
describe('RegistrationErrorStep', () => {
|
describe('RegistrationErrorStep', () => {
|
||||||
const onTryAgain = jest.fn();
|
const onSubmit = jest.fn();
|
||||||
let wrapper;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
const getRegistrationErrorStepWrapper = props => {
|
||||||
wrapper = shallowWithIntl(
|
const wrapper = shallowWithIntl(
|
||||||
<RegistrationErrorStep
|
<RegistrationErrorStep
|
||||||
errorMsg={'error message'}
|
errorMsg={'error message'}
|
||||||
onTryAgain={onTryAgain}
|
onSubmit={onSubmit}
|
||||||
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
return wrapper
|
||||||
|
.dive(); // unwrap injectIntl()
|
||||||
|
};
|
||||||
|
|
||||||
test('shows JoinFlowStep with props', () => {
|
test('when canTryAgain is true, show tryAgain message', () => {
|
||||||
// Dive to get past the anonymous component.
|
const props = {canTryAgain: true};
|
||||||
const joinFlowStepWrapper = wrapper.dive().find(JoinFlowStep);
|
const joinFlowStepWrapper = getRegistrationErrorStepWrapper(props).find(JoinFlowStep);
|
||||||
expect(joinFlowStepWrapper).toHaveLength(1);
|
expect(joinFlowStepWrapper).toHaveLength(1);
|
||||||
expect(joinFlowStepWrapper.props().description).toBe('error message');
|
expect(joinFlowStepWrapper.props().description).toBe('error message');
|
||||||
expect(joinFlowStepWrapper.props().nextButton).toBe('general.tryAgain');
|
expect(joinFlowStepWrapper.props().nextButton).toBe('general.tryAgain');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('when submitted, onTryAgain is called', () => {
|
test('when canTryAgain is false, show startOver message', () => {
|
||||||
// Dive to get past the anonymous component.
|
const props = {canTryAgain: false};
|
||||||
const joinFlowStepWrapper = wrapper.dive().find(JoinFlowStep);
|
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
|
joinFlowStepWrapper.props().onSubmit(new Event('event')); // eslint-disable-line no-undef
|
||||||
expect(onTryAgain).toHaveBeenCalled();
|
expect(onSubmit).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
118
test/unit/components/username-step.test.jsx
Normal file
118
test/unit/components/username-step.test.jsx
Normal file
|
@ -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(<UsernameStep />);
|
||||||
|
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(
|
||||||
|
<UsernameStep
|
||||||
|
onNextStep={mockedOnNextStep}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
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(
|
||||||
|
<UsernameStep />);
|
||||||
|
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(
|
||||||
|
<UsernameStep />
|
||||||
|
);
|
||||||
|
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(
|
||||||
|
<UsernameStep />
|
||||||
|
);
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -74,6 +74,15 @@ describe('unit test lib/country-data.js', () => {
|
||||||
expect(ukItems.length).toEqual(2);
|
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', () => {
|
test('registrationCountryOptions object places USA and UK at start, with display name versions', () => {
|
||||||
expect(typeof registrationCountryOptions).toBe('object');
|
expect(typeof registrationCountryOptions).toBe('object');
|
||||||
const numCountries = countryInfo.length;
|
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
|
// test that the two entries have been added to the start of the array, and that
|
||||||
// the name of the USA includes "America"
|
// the name of the USA includes "America"
|
||||||
expect(registrationCountryOptions.length).toEqual(numCountries + 2);
|
expect(registrationCountryOptions.length).toEqual(numCountries + 2);
|
||||||
expect(registrationCountryOptions[0]).toEqual({value: 'us', label: 'United States of America'});
|
expect(registrationCountryOptions[0]).toEqual({value: 'United States', label: 'United States of America'});
|
||||||
expect(registrationCountryOptions[1]).toEqual({value: 'gb', label: 'United Kingdom'});
|
expect(registrationCountryOptions[1]).toEqual({value: 'United Kingdom', label: 'United Kingdom'});
|
||||||
|
|
||||||
// test that there are now two entries for USA
|
// test that there are now two entries for USA
|
||||||
const usaOptions = registrationCountryOptions.reduce((acc, thisCountry) => (
|
const usaOptions = registrationCountryOptions.reduce((acc, thisCountry) => (
|
||||||
thisCountry.value === 'us' ? [...acc, thisCountry] : acc
|
thisCountry.value === 'United States' ? [...acc, thisCountry] : acc
|
||||||
), []);
|
), []);
|
||||||
expect(usaOptions.length).toEqual(2);
|
expect(usaOptions.length).toEqual(2);
|
||||||
// test that there are now two entries for UK
|
// test that there are now two entries for UK
|
||||||
const ukOptions = registrationCountryOptions.reduce((acc, thisCountry) => (
|
const ukOptions = registrationCountryOptions.reduce((acc, thisCountry) => (
|
||||||
thisCountry.value === 'gb' ? [...acc, thisCountry] : acc
|
thisCountry.value === 'United Kingdom' ? [...acc, thisCountry] : acc
|
||||||
), []);
|
), []);
|
||||||
expect(ukOptions.length).toEqual(2);
|
expect(ukOptions.length).toEqual(2);
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,11 +7,17 @@ const {
|
||||||
setLoginOpen,
|
setLoginOpen,
|
||||||
setRegistrationOpen,
|
setRegistrationOpen,
|
||||||
setSearchTerm,
|
setSearchTerm,
|
||||||
toggleLoginOpen
|
toggleLoginOpen,
|
||||||
|
handleRegistrationRequested
|
||||||
} = require('../../../src/redux/navigation');
|
} = require('../../../src/redux/navigation');
|
||||||
|
|
||||||
|
|
||||||
describe('unit test lib/validate.js', () => {
|
describe('unit test lib/validate.js', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
// mock window navigation
|
||||||
|
global.window.location.assign = jest.fn();
|
||||||
|
});
|
||||||
|
|
||||||
test('initialState', () => {
|
test('initialState', () => {
|
||||||
let defaultState;
|
let defaultState;
|
||||||
/* navigationReducer(state, action) */
|
/* navigationReducer(state, action) */
|
||||||
|
@ -238,4 +244,28 @@ describe('unit test lib/validate.js', () => {
|
||||||
const resultState = navigationReducer(initialState, action);
|
const resultState = navigationReducer(initialState, action);
|
||||||
expect(resultState.loginOpen).toBe(false);
|
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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue