diff --git a/package-lock.json b/package-lock.json index d89412950..f09de5985 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/cli": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.6.4.tgz", - "integrity": "sha512-tqrDyvPryBM6xjIyKKUwr3s8CzmmYidwgdswd7Uc/Cv0ogZcuS1TYQTLx/eWKP3UbJ6JxZAiYlBZabXm/rtRsQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.7.0.tgz", + "integrity": "sha512-jECEqAq6Ngf3pOhLSg7od9WKyrIacyh1oNNYtRXNn+ummSHCTXBamGywOAtiae34Vk7zKuQNnLvo2BKTMCoV4A==", "dev": true, "requires": { "chokidar": "^2.1.8", @@ -16,8 +16,7 @@ "fs-readdir-recursive": "^1.1.0", "glob": "^7.0.0", "lodash": "^4.17.13", - "mkdirp": "^0.5.1", - "output-file-sync": "^2.0.0", + "make-dir": "^2.1.0", "slash": "^2.0.0", "source-map": "^0.5.0" }, @@ -287,9 +286,9 @@ } }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -408,6 +407,16 @@ "dev": true, "optional": true }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -444,17 +453,6 @@ "dev": true, "optional": true }, - "output-file-sync": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", - "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "is-plain-obj": "^1.1.0", - "mkdirp": "^0.5.1" - } - }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -479,19 +477,19 @@ } }, "@babel/core": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.4.tgz", - "integrity": "sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxCp6s4Uk6eJ+XQ==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz", + "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.4", - "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.4", - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.3", - "@babel/types": "^7.6.3", - "convert-source-map": "^1.1.0", + "@babel/generator": "^7.7.2", + "@babel/helpers": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", + "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", "lodash": "^4.17.13", @@ -510,55 +508,84 @@ } }, "@babel/generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", - "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "dev": true, "requires": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", + "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", "dev": true }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/traverse": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", - "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -566,6 +593,15 @@ "to-fast-properties": "^2.0.0" } }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -685,57 +721,86 @@ } }, "@babel/helpers": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz", - "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz", + "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==", "dev": true, "requires": { - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.0" + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" }, "dependencies": { "@babel/generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", - "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz", + "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==", "dev": true, "requires": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, + "@babel/helper-function-name": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz", + "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz", + "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz", + "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.0" + } + }, "@babel/parser": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", - "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz", + "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==", "dev": true }, "@babel/template": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", - "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz", + "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } }, "@babel/traverse": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", - "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz", + "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==", "dev": true, "requires": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.2", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -753,9 +818,9 @@ } }, "@babel/types": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", - "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz", + "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -1035,9 +1100,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.7.tgz", - "integrity": "sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw==", + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.8.tgz", + "integrity": "sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -15569,15 +15634,15 @@ } }, "scratch-gui": { - "version": "0.1.0-prerelease.20191114160340", - "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191114160340.tgz", - "integrity": "sha512-car3Cdq3b7/4Aq0HXVhE9CiFsoNVc+y1Cm0URcKBW66xXdzWQbI0H5LH96MoLOHcMgthTnblmqQH1NITMikVRw==", + "version": "0.1.0-prerelease.20191120175131", + "resolved": "https://registry.npmjs.org/scratch-gui/-/scratch-gui-0.1.0-prerelease.20191120175131.tgz", + "integrity": "sha512-eNr4hNLW4EI3/5WO5w2/7fzhKL8h3imHS5WbjP8SQMS3CIGrE9un7e30RepR0jT9VnsWoNL7nNMLVclBZpeoLA==", "dev": true }, "scratch-l10n": { - "version": "3.6.20191008224547", - "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191008224547.tgz", - "integrity": "sha512-J6AgB6oB+/ibamUNeyTdtSvkPzJchiD50xoUqzzlcPOv+AWOFSTOakGPzJnGE6/WeZ0njBThvy1rh23lamqiow==", + "version": "3.6.20191120161253", + "resolved": "https://registry.npmjs.org/scratch-l10n/-/scratch-l10n-3.6.20191120161253.tgz", + "integrity": "sha512-M315ak1Y/VF+0Yv2nrSlQM8qIEV2MlkPC2VVHz7/Ag64ib6PJBuPNLXmQ26u4ToDxA97ouzgBDWUoupJS3n96g==", "dev": true, "requires": { "@babel/cli": "^7.1.2", diff --git a/package.json b/package.json index 77c90bfd1..273993c99 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "redux-mock-store": "^1.2.3", "redux-thunk": "2.0.1", "sass-loader": "6.0.6", - "scratch-gui": "0.1.0-prerelease.20191114160340", + "scratch-gui": "0.1.0-prerelease.20191120175131", "scratch-l10n": "latest", "selenium-webdriver": "3.6.0", "slick-carousel": "1.6.0", diff --git a/src/components/join-flow/username-step.jsx b/src/components/join-flow/username-step.jsx index 647ad3506..138141f6a 100644 --- a/src/components/join-flow/username-step.jsx +++ b/src/components/join-flow/username-step.jsx @@ -39,7 +39,7 @@ class UsernameStep extends React.Component { componentDidMount () { // Send info to analytics when we aren't on the standalone page. // If we are on the standalone join page, the page load will take care of this. - if (!window.location.pathname.includes('/join')) { + if (window.location.pathname.indexOf('/join') === -1) { if (this.props.sendAnalytics) { this.props.sendAnalytics('join-username-modal'); } diff --git a/src/l10n.json b/src/l10n.json index ed4fc9b69..840295d2c 100644 --- a/src/l10n.json +++ b/src/l10n.json @@ -230,6 +230,7 @@ "registration.validationUsernameNotAllowed": "Username not allowed", "registration.validationUsernameVulgar": "Hmm, that looks inappropriate", "registration.validationUsernameInvalid": "Invalid username", + "registration.validationUsernameSpaces": "Usernames can't have spaces", "registration.validationEmailInvalid": "Email doesn’t look right. Try another?", "registration.waitForApproval": "Wait for Approval", "registration.waitForApprovalDescription": "You can log into your Scratch Account now, but the features specific to Teachers are not yet available. Your information is being reviewed. Please be patient, the approval process can take up to one day. You will receive an email indicating your account has been upgraded once your account has been approved.", diff --git a/src/lib/validate.js b/src/lib/validate.js index fa9aa1f27..85e733788 100644 --- a/src/lib/validate.js +++ b/src/lib/validate.js @@ -9,6 +9,8 @@ module.exports.validateUsernameLocally = username => { return {valid: false, errMsgId: 'registration.validationUsernameMinLength'}; } else if (username.length > 20) { return {valid: false, errMsgId: 'registration.validationUsernameMaxLength'}; + } else if (/\s/i.test(username)) { + return {valid: false, errMsgId: 'registration.validationUsernameSpaces'}; } else if (!/^[\w-]+$/i.test(username)) { return {valid: false, errMsgId: 'registration.validationUsernameRegexp'}; } diff --git a/src/views/ideas/l10n-static.json b/src/views/ideas/l10n-static.json index 519439686..afbec418a 100644 --- a/src/views/ideas/l10n-static.json +++ b/src/views/ideas/l10n-static.json @@ -6,10 +6,16 @@ "cards.story-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/story-cards.pdf", "cards.chase-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/chase-cards.pdf", "cards.video-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/video-cards.pdf", + "cards.pong-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/pong-cards.pdf", + "cards.fly-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/fly-cards.pdf", + "cards.imagine-cardsLink": "https://resources.scratch.mit.edu/www/cards/en/imagine-cards.pdf", "guides.NameGuideLink": "https://resources.scratch.mit.edu/www/guides/en/NameGuide.pdf", "guides.AnimateGuideLink": "https://resources.scratch.mit.edu/www/guides/en/AnimateGuide.pdf", "guides.MusicGuideLink": "https://resources.scratch.mit.edu/www/guides/en/MusicGuide.pdf", "guides.StoryGuideLink": "https://resources.scratch.mit.edu/www/guides/en/StoryGuide.pdf", "guides.ChaseGuideLink": "https://resources.scratch.mit.edu/www/guides/en/ChaseGuide.pdf", - "guides.VideoGuideLink": "https://resources.scratch.mit.edu/www/guides/en/VideoGuide.pdf" + "guides.VideoGuideLink": "https://resources.scratch.mit.edu/www/guides/en/VideoGuide.pdf", + "guides.PongGuideLink": "https://resources.scratch.mit.edu/www/guides/en/PongGuide.pdf", + "guides.FlyGuideLink": "https://resources.scratch.mit.edu/www/guides/en/FlyGuide.pdf", + "guides.ImagineGuideLink": "https://resources.scratch.mit.edu/www/guides/en/ImagineGuide.pdf" } diff --git a/src/views/ideas/l10n.json b/src/views/ideas/l10n.json index a2975778a..5ba0df501 100644 --- a/src/views/ideas/l10n.json +++ b/src/views/ideas/l10n.json @@ -34,7 +34,7 @@ "ideas.cardsPurchase": "Purchase Printed Set", "ideas.MakeItFlyTitle": "Make It Fly", - "ideas.MakeItFlyDescription": "Animate the Scratch Cat, The Powerpuff Girls, or even a taco!", + "ideas.MakeItFlyDescription": "Choose any character and make it fly!", "ideas.RaceTitle": "Race to the Finish", "ideas.RaceDescription": "Make a game where two characters race each other.", "ideas.HideAndSeekTitle": "Hide and Seek", @@ -43,6 +43,8 @@ "ideas.FashionDescription": "Make a game where you dress a character with different clothes and styles.", "ideas.PongTitle": "Pong Game", "ideas.PongDescription": "Make a bouncing ball game with sounds, points, and other effects.", + "ideas.ImagineTitle": "Imagine a World", + "ideas.ImagineDescription": "Imagine a world where anything is possible.", "ideas.DanceTitle": "Let's Dance", "ideas.DanceDescription": "Design an animated dance scene with music and dance moves.", "ideas.CatchTitle": "Catch Game", diff --git a/src/views/ideas/ttt.json b/src/views/ideas/ttt.json index 6e92a31f8..1c3ea3bab 100644 --- a/src/views/ideas/ttt.json +++ b/src/views/ideas/ttt.json @@ -9,13 +9,22 @@ "guideUrl": "guides.NameGuideLink" }, { - "title": "ideas.animateACharacterTitle", - "description": "ideas.animateACharacterDescription", - "thumbImage": "/images/ideas/activities/animate-a-character-thumb.jpg", - "modalImage": "/images/ideas/activities/animate-a-character-modal.jpg", - "tutorialUrl": "animate-a-character", - "cardsUrl": "cards.animation-cardsLink", - "guideUrl": "guides.AnimateGuideLink" + "title": "ideas.ImagineTitle", + "description": "ideas.ImagineDescription", + "thumbImage": "/images/ideas/activities/imagine-thumb.jpg", + "modalImage": "/images/ideas/activities/imagine-modal.jpg", + "tutorialUrl": "imagine", + "cardsUrl": "cards.imagine-cardsLink", + "guideUrl": "guides.ImagineGuideLink" + }, + { + "title": "ideas.chaseGameTitle", + "description": "ideas.chaseGameDescription", + "thumbImage": "/images/ideas/activities/chase-game-thumb.jpg", + "modalImage": "/images/ideas/activities/chase-game-modal.jpg", + "tutorialUrl": "chase-game", + "cardsUrl": "cards.chase-cardsLink", + "guideUrl": "guides.ChaseGuideLink" }, { "title": "ideas.makeMusicTitle", @@ -36,13 +45,31 @@ "guideUrl": "guides.StoryGuideLink" }, { - "title": "ideas.chaseGameTitle", - "description": "ideas.chaseGameDescription", - "thumbImage": "/images/ideas/activities/chase-game-thumb.jpg", - "modalImage": "/images/ideas/activities/chase-game-modal.jpg", - "tutorialUrl": "chase-game", - "cardsUrl": "cards.chase-cardsLink", - "guideUrl": "guides.ChaseGuideLink" + "title": "ideas.MakeItFlyTitle", + "description": "ideas.MakeItFlyDescription", + "thumbImage": "/images/ideas/activities/fly-thumb.jpg", + "modalImage": "/images/ideas/activities/fly-modal.jpg", + "tutorialUrl": "make-it-fly", + "cardsUrl": "cards.fly-cardsLink", + "guideUrl": "guides.FlyGuideLink" + }, + { + "title": "ideas.PongTitle", + "description": "ideas.PongDescription", + "thumbImage": "/images/ideas/activities/pong-thumb.jpg", + "modalImage": "/images/ideas/activities/pong-modal.jpg", + "tutorialUrl": "pong", + "cardsUrl": "cards.pong-cardsLink", + "guideUrl": "guides.PongGuideLink" + }, + { + "title": "ideas.animateACharacterTitle", + "description": "ideas.animateACharacterDescription", + "thumbImage": "/images/ideas/activities/animate-a-character-thumb.jpg", + "modalImage": "/images/ideas/activities/animate-a-character-modal.jpg", + "tutorialUrl": "animate-a-character", + "cardsUrl": "cards.animation-cardsLink", + "guideUrl": "guides.AnimateGuideLink" }, { "title": "ideas.videoSensingTitle", diff --git a/static/images/ideas/activities/fly-modal.jpg b/static/images/ideas/activities/fly-modal.jpg new file mode 100644 index 000000000..2cfc51f03 Binary files /dev/null and b/static/images/ideas/activities/fly-modal.jpg differ diff --git a/static/images/ideas/activities/fly-thumb.jpg b/static/images/ideas/activities/fly-thumb.jpg new file mode 100644 index 000000000..3bce97750 Binary files /dev/null and b/static/images/ideas/activities/fly-thumb.jpg differ diff --git a/static/images/ideas/activities/imagine-modal.jpg b/static/images/ideas/activities/imagine-modal.jpg new file mode 100644 index 000000000..1f65b8233 Binary files /dev/null and b/static/images/ideas/activities/imagine-modal.jpg differ diff --git a/static/images/ideas/activities/imagine-thumb.jpg b/static/images/ideas/activities/imagine-thumb.jpg new file mode 100644 index 000000000..c419d6e87 Binary files /dev/null and b/static/images/ideas/activities/imagine-thumb.jpg differ diff --git a/static/images/ideas/activities/pong-modal.jpg b/static/images/ideas/activities/pong-modal.jpg new file mode 100644 index 000000000..b2f6b17b4 Binary files /dev/null and b/static/images/ideas/activities/pong-modal.jpg differ diff --git a/static/images/ideas/activities/pong-thumb.jpg b/static/images/ideas/activities/pong-thumb.jpg new file mode 100644 index 000000000..631aa1521 Binary files /dev/null and b/static/images/ideas/activities/pong-thumb.jpg differ diff --git a/test/unit/lib/validate.test.js b/test/unit/lib/validate.test.js index d34eef808..374209c75 100644 --- a/test/unit/lib/validate.test.js +++ b/test/unit/lib/validate.test.js @@ -33,7 +33,7 @@ describe('unit test lib/validate.js', () => { test('validate username spaces not allowed', () => { const response = validate.validateUsernameLocally('abc def'); - expect(response).toEqual({valid: false, errMsgId: 'registration.validationUsernameRegexp'}); + expect(response).toEqual({valid: false, errMsgId: 'registration.validationUsernameSpaces'}); }); test('validate username special chars not allowed', () => {