Compare commits
50 Commits
open-relea
...
temp-main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
826f631201 | ||
|
|
b41fca3605 | ||
|
|
ac2548913f | ||
|
|
cd9b3bd084 | ||
|
|
efc07aac67 | ||
|
|
2d50ed224f | ||
|
|
d10f9b932b | ||
|
|
05aa85a5fb | ||
|
|
56bd6d835e | ||
|
|
afd4d24360 | ||
|
|
4898864416 | ||
|
|
739f94d624 | ||
|
|
1819edc9b7 | ||
|
|
ad0d75ab0d | ||
|
|
a90ebb7d4d | ||
|
|
f8290adab5 | ||
|
|
788a42b341 | ||
|
|
4f48e82959 | ||
|
|
99850574fb | ||
|
|
d66afe98f0 | ||
|
|
e2cdfce832 | ||
|
|
c1e63da778 | ||
|
|
ecf4c3ae53 | ||
|
|
2428b4c389 | ||
|
|
099fe8d717 | ||
|
|
4755540be8 | ||
|
|
9a30f053c7 | ||
|
|
6b983e18d3 | ||
|
|
327210192c | ||
|
|
0d603b5fa1 | ||
|
|
efaa83a1bc | ||
|
|
bd63bb1f15 | ||
|
|
5754c2961a | ||
|
|
dcbd644a25 | ||
|
|
52e438652c | ||
|
|
d8947a4c0a | ||
|
|
03d1666c2c | ||
|
|
3782503983 | ||
|
|
b219fe3683 | ||
|
|
90f650ce3e | ||
|
|
6f325c20c3 | ||
|
|
de12dfbf9e | ||
|
|
c663f6fa30 | ||
|
|
dba93333fd | ||
|
|
611af07326 | ||
|
|
564ec70d9e | ||
|
|
65e95a4d1b | ||
|
|
cf2b50005b | ||
|
|
faf4ff8488 | ||
|
|
7d64220852 |
@@ -10,7 +10,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
autoupdate:
|
autoupdate:
|
||||||
name: autoupdate
|
name: autoupdate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: docker://chinthakagodawita/autoupdate-action:v1
|
- uses: docker://chinthakagodawita/autoupdate-action:v1
|
||||||
env:
|
env:
|
||||||
|
|||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -10,7 +10,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node: [18, 20]
|
node: [18, 20]
|
||||||
|
|||||||
205
package-lock.json
generated
205
package-lock.json
generated
@@ -32,11 +32,11 @@
|
|||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-helmet": "6.1.0",
|
"react-helmet": "6.1.0",
|
||||||
"react-loading-skeleton": "3.5.0",
|
"react-loading-skeleton": "3.4.0",
|
||||||
"react-redux": "7.2.9",
|
"react-redux": "7.2.9",
|
||||||
"react-responsive": "8.2.0",
|
"react-responsive": "8.2.0",
|
||||||
"react-router": "6.26.2",
|
"react-router": "6.26.1",
|
||||||
"react-router-dom": "6.26.2",
|
"react-router-dom": "6.26.1",
|
||||||
"react-zendesk": "^0.1.13",
|
"react-zendesk": "^0.1.13",
|
||||||
"redux": "4.2.1",
|
"redux": "4.2.1",
|
||||||
"redux-logger": "3.0.6",
|
"redux-logger": "3.0.6",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"@edx/reactifex": "1.1.0",
|
"@edx/reactifex": "1.1.0",
|
||||||
"@openedx/frontend-build": "^14.0.3",
|
"@openedx/frontend-build": "^14.0.3",
|
||||||
"babel-plugin-formatjs": "10.5.16",
|
"babel-plugin-formatjs": "10.5.16",
|
||||||
"eslint-plugin-import": "2.30.0",
|
"eslint-plugin-import": "2.29.1",
|
||||||
"glob": "7.2.3",
|
"glob": "7.2.3",
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"husky": "7.0.4",
|
"husky": "7.0.4",
|
||||||
@@ -2017,9 +2017,7 @@
|
|||||||
"license": "AGPL-3.0"
|
"license": "AGPL-3.0"
|
||||||
},
|
},
|
||||||
"node_modules/@edx/eslint-config": {
|
"node_modules/@edx/eslint-config": {
|
||||||
"version": "4.2.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@edx/eslint-config/-/eslint-config-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-2wuIw49uyj6gRwS74qJ8WhBU+X2FOP4uot40sthIC4YU9qCM7WJOcOuAhkRPP1FvZKd3UQH3gZM7eJ85xzDBqA==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||||
@@ -2125,9 +2123,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@edx/typescript-config": {
|
"node_modules/@edx/typescript-config": {
|
||||||
"version": "1.1.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@edx/typescript-config/-/typescript-config-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-HF+7dsSgA2YQ6f/qV4HnrEYBoIhIdxVQZgDyYk/YGvaVGqT6IFuaHnYUP7ImpCUMOUmx/Jl7EyuVeaMe2LrMcA==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^4.9.4"
|
||||||
@@ -3082,9 +3078,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build": {
|
"node_modules/@openedx/frontend-build": {
|
||||||
"version": "14.1.4",
|
"version": "14.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@openedx/frontend-build/-/frontend-build-14.1.4.tgz",
|
|
||||||
"integrity": "sha512-DMzkitHqemtqwxmDsF8y7zRVAJcW8URPfWcLKtFvXffqJ3WW7fJXXMmiZWKra/vGBw3SRyYRqvdzQG1d2giPAw==",
|
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/cli": "7.24.8",
|
"@babel/cli": "7.24.8",
|
||||||
@@ -3095,9 +3089,9 @@
|
|||||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||||
"@babel/preset-env": "7.24.8",
|
"@babel/preset-env": "7.24.8",
|
||||||
"@babel/preset-react": "7.24.7",
|
"@babel/preset-react": "7.24.7",
|
||||||
"@edx/eslint-config": "4.2.0",
|
"@edx/eslint-config": "4.1.0",
|
||||||
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
|
"@edx/new-relic-source-map-webpack-plugin": "2.1.0",
|
||||||
"@edx/typescript-config": "1.1.0",
|
"@edx/typescript-config": "1.0.1",
|
||||||
"@formatjs/cli": "^6.0.3",
|
"@formatjs/cli": "^6.0.3",
|
||||||
"@fullhuman/postcss-purgecss": "5.0.0",
|
"@fullhuman/postcss-purgecss": "5.0.0",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
||||||
@@ -3105,7 +3099,7 @@
|
|||||||
"@types/jest": "29.5.12",
|
"@types/jest": "29.5.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||||
"@typescript-eslint/parser": "^5.58.0",
|
"@typescript-eslint/parser": "^5.58.0",
|
||||||
"autoprefixer": "10.4.20",
|
"autoprefixer": "10.4.19",
|
||||||
"babel-jest": "29.6.1",
|
"babel-jest": "29.6.1",
|
||||||
"babel-loader": "9.1.3",
|
"babel-loader": "9.1.3",
|
||||||
"babel-plugin-formatjs": "^10.4.0",
|
"babel-plugin-formatjs": "^10.4.0",
|
||||||
@@ -3133,8 +3127,7 @@
|
|||||||
"jest": "29.6.1",
|
"jest": "29.6.1",
|
||||||
"jest-environment-jsdom": "29.6.1",
|
"jest-environment-jsdom": "29.6.1",
|
||||||
"mini-css-extract-plugin": "1.6.2",
|
"mini-css-extract-plugin": "1.6.2",
|
||||||
"parse5": "7.1.2",
|
"postcss": "8.4.39",
|
||||||
"postcss": "8.4.47",
|
|
||||||
"postcss-custom-media": "10.0.8",
|
"postcss-custom-media": "10.0.8",
|
||||||
"postcss-loader": "7.3.4",
|
"postcss-loader": "7.3.4",
|
||||||
"postcss-rtlcss": "5.1.2",
|
"postcss-rtlcss": "5.1.2",
|
||||||
@@ -3153,8 +3146,7 @@
|
|||||||
"webpack-bundle-analyzer": "^4.10.1",
|
"webpack-bundle-analyzer": "^4.10.1",
|
||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-dev-server": "^4.15.1",
|
"webpack-dev-server": "^4.15.1",
|
||||||
"webpack-merge": "^5.10.0",
|
"webpack-merge": "^5.10.0"
|
||||||
"webpack-remove-empty-scripts": "1.0.4"
|
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"fedx-scripts": "bin/fedx-scripts.js"
|
"fedx-scripts": "bin/fedx-scripts.js"
|
||||||
@@ -3165,8 +3157,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/@eslint/js": {
|
"node_modules/@openedx/frontend-build/node_modules/@eslint/js": {
|
||||||
"version": "8.44.0",
|
"version": "8.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz",
|
|
||||||
"integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
@@ -3174,14 +3164,10 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/argparse": {
|
"node_modules/@openedx/frontend-build/node_modules/argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
|
||||||
"license": "Python-2.0"
|
"license": "Python-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint": {
|
||||||
"version": "8.44.0",
|
"version": "8.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz",
|
|
||||||
"integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
@@ -3236,8 +3222,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import": {
|
||||||
"version": "2.27.5",
|
"version": "2.27.5",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz",
|
|
||||||
"integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"array-includes": "^3.1.6",
|
"array-includes": "^3.1.6",
|
||||||
@@ -3265,8 +3249,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import/node_modules/debug": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import/node_modules/debug": {
|
||||||
"version": "3.2.7",
|
"version": "3.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
|
||||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": "^2.1.1"
|
"ms": "^2.1.1"
|
||||||
@@ -3274,8 +3256,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import/node_modules/doctrine": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint-plugin-import/node_modules/doctrine": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esutils": "^2.0.2"
|
"esutils": "^2.0.2"
|
||||||
@@ -3286,8 +3266,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint-scope": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint-scope": {
|
||||||
"version": "7.2.2",
|
"version": "7.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
|
|
||||||
"integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
|
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esrecurse": "^4.3.0",
|
"esrecurse": "^4.3.0",
|
||||||
@@ -3302,8 +3280,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/eslint-visitor-keys": {
|
"node_modules/@openedx/frontend-build/node_modules/eslint-visitor-keys": {
|
||||||
"version": "3.4.3",
|
"version": "3.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
|
|
||||||
"integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
@@ -3314,8 +3290,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/find-up": {
|
"node_modules/@openedx/frontend-build/node_modules/find-up": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"locate-path": "^6.0.0",
|
"locate-path": "^6.0.0",
|
||||||
@@ -3330,8 +3304,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/glob-parent": {
|
"node_modules/@openedx/frontend-build/node_modules/glob-parent": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
|
|
||||||
"integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
|
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-glob": "^4.0.3"
|
"is-glob": "^4.0.3"
|
||||||
@@ -3342,8 +3314,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/globals": {
|
"node_modules/@openedx/frontend-build/node_modules/globals": {
|
||||||
"version": "13.24.0",
|
"version": "13.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
|
|
||||||
"integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"type-fest": "^0.20.2"
|
"type-fest": "^0.20.2"
|
||||||
@@ -3357,8 +3327,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/jest": {
|
"node_modules/@openedx/frontend-build/node_modules/jest": {
|
||||||
"version": "29.6.1",
|
"version": "29.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.6.1.tgz",
|
|
||||||
"integrity": "sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jest/core": "^29.6.1",
|
"@jest/core": "^29.6.1",
|
||||||
@@ -3383,8 +3351,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/js-yaml": {
|
"node_modules/@openedx/frontend-build/node_modules/js-yaml": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"argparse": "^2.0.1"
|
"argparse": "^2.0.1"
|
||||||
@@ -3395,8 +3361,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/locate-path": {
|
"node_modules/@openedx/frontend-build/node_modules/locate-path": {
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"p-locate": "^5.0.0"
|
"p-locate": "^5.0.0"
|
||||||
@@ -3410,8 +3374,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/p-locate": {
|
"node_modules/@openedx/frontend-build/node_modules/p-locate": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"p-limit": "^3.0.2"
|
"p-limit": "^3.0.2"
|
||||||
@@ -3425,8 +3387,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/frontend-build/node_modules/type-fest": {
|
"node_modules/@openedx/frontend-build/node_modules/type-fest": {
|
||||||
"version": "0.20.2",
|
"version": "0.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
|
||||||
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
|
||||||
"license": "(MIT OR CC0-1.0)",
|
"license": "(MIT OR CC0-1.0)",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
@@ -3436,9 +3396,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@openedx/paragon": {
|
"node_modules/@openedx/paragon": {
|
||||||
"version": "22.8.1",
|
"version": "22.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-22.8.1.tgz",
|
|
||||||
"integrity": "sha512-lm2x0tvNZrtJvp0L+cjvLLmkE9NoUbNIzt9L1FaOx9g92gf8rFVgq4aadq7IVAjN12HW19/QJMEJaQ0SVsvY2A==",
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"example",
|
"example",
|
||||||
@@ -3489,8 +3447,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/paragon/node_modules/@fortawesome/react-fontawesome": {
|
"node_modules/@openedx/paragon/node_modules/@fortawesome/react-fontawesome": {
|
||||||
"version": "0.1.19",
|
"version": "0.1.19",
|
||||||
"resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.19.tgz",
|
|
||||||
"integrity": "sha512-Hyb+lB8T18cvLNX0S3llz7PcSOAJMLwiVKBuuzwM/nI5uoBw+gQjnf9il0fR1C3DKOI5Kc79pkJ4/xB0Uw9aFQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prop-types": "^15.8.1"
|
"prop-types": "^15.8.1"
|
||||||
@@ -3502,8 +3458,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/paragon/node_modules/brace-expansion": {
|
"node_modules/@openedx/paragon/node_modules/brace-expansion": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^1.0.0"
|
"balanced-match": "^1.0.0"
|
||||||
@@ -3511,9 +3465,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/paragon/node_modules/glob": {
|
"node_modules/@openedx/paragon/node_modules/glob": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
|
|
||||||
"integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
|
|
||||||
"deprecated": "Glob versions prior to v9 are no longer supported",
|
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
@@ -3531,8 +3482,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/@openedx/paragon/node_modules/minimatch": {
|
"node_modules/@openedx/paragon/node_modules/minimatch": {
|
||||||
"version": "5.1.6",
|
"version": "5.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
|
||||||
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^2.0.1"
|
"brace-expansion": "^2.0.1"
|
||||||
@@ -3772,10 +3721,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@remix-run/router": {
|
"node_modules/@remix-run/router": {
|
||||||
"version": "1.19.2",
|
"version": "1.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.2.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz",
|
||||||
"integrity": "sha512-baiMx18+IMuD1yyvOGaHM9QrVUPGGG0jC+z+IPHnRJWUAUvaKuWKyE8gjDj2rzv3sz9zOGoRSPgeBVHRhZnBlA==",
|
"integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==",
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
@@ -3797,12 +3745,6 @@
|
|||||||
"react": ">=16.8.0"
|
"react": ">=16.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rtsao/scc": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/@sinclair/typebox": {
|
"node_modules/@sinclair/typebox": {
|
||||||
"version": "0.27.8",
|
"version": "0.27.8",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
@@ -5108,19 +5050,6 @@
|
|||||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ansis": {
|
|
||||||
"version": "1.5.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansis/-/ansis-1.5.2.tgz",
|
|
||||||
"integrity": "sha512-T3vUABrcgSj/HXv27P+A/JxGk5b/ydx0JjN3lgjBTC2iZUFxQGjh43zCzLSbU4C1QTgmx9oaPeWNJFM+auI8qw==",
|
|
||||||
"license": "ISC",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.13"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "patreon",
|
|
||||||
"url": "https://patreon.com/biodiscus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/anymatch": {
|
"node_modules/anymatch": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
@@ -5317,9 +5246,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/autoprefixer": {
|
"node_modules/autoprefixer": {
|
||||||
"version": "10.4.20",
|
"version": "10.4.19",
|
||||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz",
|
|
||||||
"integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==",
|
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@@ -5336,11 +5263,11 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"browserslist": "^4.23.3",
|
"browserslist": "^4.23.0",
|
||||||
"caniuse-lite": "^1.0.30001646",
|
"caniuse-lite": "^1.0.30001599",
|
||||||
"fraction.js": "^4.3.7",
|
"fraction.js": "^4.3.7",
|
||||||
"normalize-range": "^0.1.2",
|
"normalize-range": "^0.1.2",
|
||||||
"picocolors": "^1.0.1",
|
"picocolors": "^1.0.0",
|
||||||
"postcss-value-parser": "^4.2.0"
|
"postcss-value-parser": "^4.2.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@@ -7562,9 +7489,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-module-utils": {
|
"node_modules/eslint-module-utils": {
|
||||||
"version": "2.11.0",
|
"version": "2.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.11.0.tgz",
|
|
||||||
"integrity": "sha512-gbBE5Hitek/oG6MUVj6sFuzEjA/ClzNflVrLovHi/JgLdC7fiN5gLAY1WIPW1a0V5I999MnsrvVrCOGmmVqDBQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^3.2.7"
|
"debug": "^3.2.7"
|
||||||
@@ -7751,27 +7676,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-import": {
|
"node_modules/eslint-plugin-import": {
|
||||||
"version": "2.30.0",
|
"version": "2.29.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz",
|
|
||||||
"integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@rtsao/scc": "^1.1.0",
|
"array-includes": "^3.1.7",
|
||||||
"array-includes": "^3.1.8",
|
"array.prototype.findlastindex": "^1.2.3",
|
||||||
"array.prototype.findlastindex": "^1.2.5",
|
|
||||||
"array.prototype.flat": "^1.3.2",
|
"array.prototype.flat": "^1.3.2",
|
||||||
"array.prototype.flatmap": "^1.3.2",
|
"array.prototype.flatmap": "^1.3.2",
|
||||||
"debug": "^3.2.7",
|
"debug": "^3.2.7",
|
||||||
"doctrine": "^2.1.0",
|
"doctrine": "^2.1.0",
|
||||||
"eslint-import-resolver-node": "^0.3.9",
|
"eslint-import-resolver-node": "^0.3.9",
|
||||||
"eslint-module-utils": "^2.9.0",
|
"eslint-module-utils": "^2.8.0",
|
||||||
"hasown": "^2.0.2",
|
"hasown": "^2.0.0",
|
||||||
"is-core-module": "^2.15.1",
|
"is-core-module": "^2.13.1",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
"minimatch": "^3.1.2",
|
"minimatch": "^3.1.2",
|
||||||
"object.fromentries": "^2.0.8",
|
"object.fromentries": "^2.0.7",
|
||||||
"object.groupby": "^1.0.3",
|
"object.groupby": "^1.0.1",
|
||||||
"object.values": "^1.2.0",
|
"object.values": "^1.1.7",
|
||||||
"semver": "^6.3.1",
|
"semver": "^6.3.1",
|
||||||
"tsconfig-paths": "^3.15.0"
|
"tsconfig-paths": "^3.15.0"
|
||||||
},
|
},
|
||||||
@@ -7784,8 +7706,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-import/node_modules/debug": {
|
"node_modules/eslint-plugin-import/node_modules/debug": {
|
||||||
"version": "3.2.7",
|
"version": "3.2.7",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
|
||||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": "^2.1.1"
|
"ms": "^2.1.1"
|
||||||
@@ -7793,8 +7713,6 @@
|
|||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-import/node_modules/doctrine": {
|
"node_modules/eslint-plugin-import/node_modules/doctrine": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esutils": "^2.0.2"
|
"esutils": "^2.0.2"
|
||||||
@@ -9656,9 +9574,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/is-core-module": {
|
"node_modules/is-core-module": {
|
||||||
"version": "2.15.1",
|
"version": "2.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
|
|
||||||
"integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"hasown": "^2.0.2"
|
"hasown": "^2.0.2"
|
||||||
@@ -12086,9 +12002,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/picocolors": {
|
"node_modules/picocolors": {
|
||||||
"version": "1.1.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==",
|
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
@@ -12293,9 +12207,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.4.47",
|
"version": "8.4.39",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz",
|
|
||||||
"integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
|
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@@ -12313,8 +12225,8 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.7",
|
"nanoid": "^3.3.7",
|
||||||
"picocolors": "^1.1.0",
|
"picocolors": "^1.0.1",
|
||||||
"source-map-js": "^1.2.1"
|
"source-map-js": "^1.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^10 || ^12 || >=14"
|
"node": "^10 || ^12 || >=14"
|
||||||
@@ -13446,9 +13358,7 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/react-loading-skeleton": {
|
"node_modules/react-loading-skeleton": {
|
||||||
"version": "3.5.0",
|
"version": "3.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-loading-skeleton/-/react-loading-skeleton-3.5.0.tgz",
|
|
||||||
"integrity": "sha512-gxxSyLbrEAdXTKgfbpBEFZCO/P153DnqSCQau2+o6lNy1jgMRr2MmRmOzMmyrwSaSYLRB8g7b0waYPmUjz7IhQ==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=16.8.0"
|
"react": ">=16.8.0"
|
||||||
@@ -13583,12 +13493,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "6.26.2",
|
"version": "6.26.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz",
|
||||||
"integrity": "sha512-tvN1iuT03kHgOFnLPfLJ8V95eijteveqdOSk+srqfePtQvqCExB8eHOYnlilbOcyJyKnYkr1vJvf7YqotAJu1A==",
|
"integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.19.2"
|
"@remix-run/router": "1.19.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -13598,13 +13507,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "6.26.2",
|
"version": "6.26.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz",
|
||||||
"integrity": "sha512-z7YkaEW0Dy35T3/QKPYB1LjMK2R1fxnHO8kWpUMTBdfVzZrWOiY9a7CtN8HqdWtDUWd5FY6Dl8HFsqVwH4uOtQ==",
|
"integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.19.2",
|
"@remix-run/router": "1.19.1",
|
||||||
"react-router": "6.26.2"
|
"react-router": "6.26.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -14592,9 +14500,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/source-map-js": {
|
"node_modules/source-map-js": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -16172,25 +16078,6 @@
|
|||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webpack-remove-empty-scripts": {
|
|
||||||
"version": "1.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/webpack-remove-empty-scripts/-/webpack-remove-empty-scripts-1.0.4.tgz",
|
|
||||||
"integrity": "sha512-W/Vd94oNXMsQam+W9G+aAzGgFlX1aItcJpkG3byuHGDaxyK3H17oD/b5RcqS/ZHzStIKepksdLDznejDhDUs+Q==",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"ansis": "1.5.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.14"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "patreon",
|
|
||||||
"url": "https://patreon.com/biodiscus"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"webpack": ">=5.32.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webpack-sources": {
|
"node_modules/webpack-sources": {
|
||||||
"version": "1.4.3",
|
"version": "1.4.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -55,11 +55,11 @@
|
|||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
"react-helmet": "6.1.0",
|
"react-helmet": "6.1.0",
|
||||||
"react-loading-skeleton": "3.5.0",
|
"react-loading-skeleton": "3.4.0",
|
||||||
"react-redux": "7.2.9",
|
"react-redux": "7.2.9",
|
||||||
"react-responsive": "8.2.0",
|
"react-responsive": "8.2.0",
|
||||||
"react-router": "6.26.2",
|
"react-router": "6.26.1",
|
||||||
"react-router-dom": "6.26.2",
|
"react-router-dom": "6.26.1",
|
||||||
"react-zendesk": "^0.1.13",
|
"react-zendesk": "^0.1.13",
|
||||||
"redux": "4.2.1",
|
"redux": "4.2.1",
|
||||||
"redux-logger": "3.0.6",
|
"redux-logger": "3.0.6",
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
"@edx/reactifex": "1.1.0",
|
"@edx/reactifex": "1.1.0",
|
||||||
"@openedx/frontend-build": "^14.0.3",
|
"@openedx/frontend-build": "^14.0.3",
|
||||||
"babel-plugin-formatjs": "10.5.16",
|
"babel-plugin-formatjs": "10.5.16",
|
||||||
"eslint-plugin-import": "2.30.0",
|
"eslint-plugin-import": "2.29.1",
|
||||||
"glob": "7.2.3",
|
"glob": "7.2.3",
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"husky": "7.0.4",
|
"husky": "7.0.4",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const InstitutionLogistration = props => {
|
|||||||
className="btn nav-item p-0 mb-1 institutions--provider-link"
|
className="btn nav-item p-0 mb-1 institutions--provider-link"
|
||||||
destination={lmsBaseUrl + provider.loginUrl}
|
destination={lmsBaseUrl + provider.loginUrl}
|
||||||
>
|
>
|
||||||
{provider.name}
|
{provider?.name}
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Navigate } from 'react-router-dom';
|
|||||||
import {
|
import {
|
||||||
AUTHN_PROGRESSIVE_PROFILING, RECOMMENDATIONS, REDIRECT,
|
AUTHN_PROGRESSIVE_PROFILING, RECOMMENDATIONS, REDIRECT,
|
||||||
} from '../data/constants';
|
} from '../data/constants';
|
||||||
import { setCookie } from '../data/utils';
|
import setCookie from '../data/utils/cookies';
|
||||||
|
|
||||||
const RedirectLogistration = (props) => {
|
const RedirectLogistration = (props) => {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||||
@@ -8,15 +9,20 @@ import { Login } from '@openedx/paragon/icons';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import messages from './messages';
|
import messages from './messages';
|
||||||
import { LOGIN_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants';
|
import { LOGIN_PAGE, REGISTER_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants';
|
||||||
|
import { setCookie } from '../data/utils';
|
||||||
|
|
||||||
const SocialAuthProviders = (props) => {
|
const SocialAuthProviders = (props) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
const { referrer, socialAuthProviders } = props;
|
const { referrer, socialAuthProviders } = props;
|
||||||
|
const registrationFields = useSelector(state => state.register.registrationFormData);
|
||||||
|
|
||||||
function handleSubmit(e) {
|
function handleSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (referrer === REGISTER_PAGE) {
|
||||||
|
setCookie('marketingEmailsOptIn', registrationFields?.configurableFormFields?.marketingEmailsOptIn);
|
||||||
|
}
|
||||||
const url = e.currentTarget.dataset.providerUrl;
|
const url = e.currentTarget.dataset.providerUrl;
|
||||||
window.location.href = getConfig().LMS_BASE_URL + url;
|
window.location.href = getConfig().LMS_BASE_URL + url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
import messages from './messages';
|
import messages from './messages';
|
||||||
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
|
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
|
||||||
|
import setCookie from '../data/utils/cookies';
|
||||||
|
|
||||||
const ThirdPartyAuthAlert = (props) => {
|
const ThirdPartyAuthAlert = (props) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -20,7 +21,10 @@ const ThirdPartyAuthAlert = (props) => {
|
|||||||
message = formatMessage(messages['register.third.party.auth.account.not.linked'], { currentProvider, platformName });
|
message = formatMessage(messages['register.third.party.auth.account.not.linked'], { currentProvider, platformName });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!currentProvider) {
|
if (currentProvider) {
|
||||||
|
// Setting this cookie to capture marketingEmailsOptIn for SSO flow on the onboarding component
|
||||||
|
setCookie('ssoPipelineRedirectionDone', true);
|
||||||
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ import { getConfig } from '@edx/frontend-platform';
|
|||||||
import { fetchAuthenticatedUser, getAuthenticatedUser } from '@edx/frontend-platform/auth';
|
import { fetchAuthenticatedUser, getAuthenticatedUser } from '@edx/frontend-platform/auth';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import {
|
import { RESET_PAGE } from '../data/constants';
|
||||||
DEFAULT_REDIRECT_URL,
|
import { updatePathWithQueryParams } from '../data/utils';
|
||||||
} from '../data/constants';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This wrapper redirects the requester to our default redirect url if they are
|
* This wrapper redirects the requester to our default redirect url if they are
|
||||||
@@ -25,7 +24,12 @@ const UnAuthOnlyRoute = ({ children }) => {
|
|||||||
|
|
||||||
if (isReady) {
|
if (isReady) {
|
||||||
if (authUser && authUser.username) {
|
if (authUser && authUser.username) {
|
||||||
global.location.href = getConfig().LMS_BASE_URL.concat(DEFAULT_REDIRECT_URL);
|
const updatedPath = updatePathWithQueryParams(window.location.pathname);
|
||||||
|
if (updatedPath.startsWith(RESET_PAGE)) {
|
||||||
|
global.location.href = getConfig().LMS_BASE_URL;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
global.location.href = getConfig().LMS_BASE_URL.concat(updatedPath);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
79
src/common-components/data/constants.js
Normal file
79
src/common-components/data/constants.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
export const registerFields = {
|
||||||
|
fields: {
|
||||||
|
country: {
|
||||||
|
name: 'country',
|
||||||
|
error_message: 'Select your country or region of residence',
|
||||||
|
},
|
||||||
|
honor_code: {
|
||||||
|
name: 'honor_code',
|
||||||
|
type: 'tos_and_honor_code',
|
||||||
|
error_message: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const progressiveProfilingFields = {
|
||||||
|
extended_profile: [],
|
||||||
|
fields: {
|
||||||
|
level_of_education: {
|
||||||
|
name: 'level_of_education',
|
||||||
|
type: 'select',
|
||||||
|
label: 'Highest level of education completed',
|
||||||
|
error_message: '',
|
||||||
|
options: [
|
||||||
|
[
|
||||||
|
'p',
|
||||||
|
'Doctorate',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'm',
|
||||||
|
"Master's or professional degree",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'b',
|
||||||
|
"Bachelor's degree",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'a',
|
||||||
|
'Associate degree',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'hs',
|
||||||
|
'Secondary/high school',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'jhs',
|
||||||
|
'Junior secondary/junior high/middle school',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'none',
|
||||||
|
'No formal education',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'other',
|
||||||
|
'Other education',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
gender: {
|
||||||
|
name: 'gender',
|
||||||
|
type: 'select',
|
||||||
|
label: 'Gender',
|
||||||
|
error_message: '',
|
||||||
|
options: [
|
||||||
|
[
|
||||||
|
'm',
|
||||||
|
'Male',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'f',
|
||||||
|
'Female',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'o',
|
||||||
|
'Other/Prefer Not to Say',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { logError } from '@edx/frontend-platform/logging';
|
import { logError } from '@edx/frontend-platform/logging';
|
||||||
import { call, put, takeEvery } from 'redux-saga/effects';
|
import { call, put, takeEvery } from 'redux-saga/effects';
|
||||||
|
|
||||||
@@ -7,6 +8,7 @@ import {
|
|||||||
getThirdPartyAuthContextSuccess,
|
getThirdPartyAuthContextSuccess,
|
||||||
THIRD_PARTY_AUTH_CONTEXT,
|
THIRD_PARTY_AUTH_CONTEXT,
|
||||||
} from './actions';
|
} from './actions';
|
||||||
|
import { progressiveProfilingFields, registerFields } from './constants';
|
||||||
import {
|
import {
|
||||||
getThirdPartyAuthContext,
|
getThirdPartyAuthContext,
|
||||||
} from './service';
|
} from './service';
|
||||||
@@ -20,7 +22,16 @@ export function* fetchThirdPartyAuthContext(action) {
|
|||||||
} = yield call(getThirdPartyAuthContext, action.payload.urlParams);
|
} = yield call(getThirdPartyAuthContext, action.payload.urlParams);
|
||||||
|
|
||||||
yield put(setCountryFromThirdPartyAuthContext(thirdPartyAuthContext.countryCode));
|
yield put(setCountryFromThirdPartyAuthContext(thirdPartyAuthContext.countryCode));
|
||||||
|
// hard code country field, level of education and gender fields
|
||||||
|
if (getConfig().ENABLE_HARD_CODE_OPTIONAL_FIELDS) {
|
||||||
|
yield put(getThirdPartyAuthContextSuccess(
|
||||||
|
registerFields,
|
||||||
|
progressiveProfilingFields,
|
||||||
|
thirdPartyAuthContext,
|
||||||
|
));
|
||||||
|
} else {
|
||||||
yield put(getThirdPartyAuthContextSuccess(fieldDescriptions, optionalFields, thirdPartyAuthContext));
|
yield put(getThirdPartyAuthContextSuccess(fieldDescriptions, optionalFields, thirdPartyAuthContext));
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
yield put(getThirdPartyAuthContextFailure());
|
yield put(getThirdPartyAuthContextFailure());
|
||||||
logError(e);
|
logError(e);
|
||||||
|
|||||||
@@ -1,16 +1,35 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Provider } from 'react-redux';
|
||||||
|
|
||||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
import configureStore from 'redux-mock-store';
|
||||||
|
|
||||||
import registerIcons from '../RegisterFaIcons';
|
import registerIcons from '../RegisterFaIcons';
|
||||||
import SocialAuthProviders from '../SocialAuthProviders';
|
import SocialAuthProviders from '../SocialAuthProviders';
|
||||||
|
|
||||||
registerIcons();
|
registerIcons();
|
||||||
|
const mockStore = configureStore();
|
||||||
|
|
||||||
describe('SocialAuthProviders', () => {
|
describe('SocialAuthProviders', () => {
|
||||||
let props = {};
|
let props = {};
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
register: {
|
||||||
|
registrationFormData: {
|
||||||
|
configurableFormFields: {
|
||||||
|
marketingEmailsOptIn: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const store = mockStore(initialState);
|
||||||
|
const reduxWrapper = children => (
|
||||||
|
<IntlProvider locale="en">
|
||||||
|
<Provider store={store}>{children}</Provider>
|
||||||
|
</IntlProvider>
|
||||||
|
);
|
||||||
|
|
||||||
const appleProvider = {
|
const appleProvider = {
|
||||||
id: 'oa2-apple-id',
|
id: 'oa2-apple-id',
|
||||||
name: 'Apple',
|
name: 'Apple',
|
||||||
@@ -30,11 +49,11 @@ describe('SocialAuthProviders', () => {
|
|||||||
it('should match social auth provider with iconImage snapshot', () => {
|
it('should match social auth provider with iconImage snapshot', () => {
|
||||||
props = { socialAuthProviders: [appleProvider, facebookProvider] };
|
props = { socialAuthProviders: [appleProvider, facebookProvider] };
|
||||||
|
|
||||||
const tree = renderer.create(
|
const tree = renderer.create(reduxWrapper(
|
||||||
<IntlProvider locale="en">
|
<IntlProvider locale="en">
|
||||||
<SocialAuthProviders {...props} />
|
<SocialAuthProviders {...props} />
|
||||||
</IntlProvider>,
|
</IntlProvider>,
|
||||||
).toJSON();
|
)).toJSON();
|
||||||
|
|
||||||
expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
@@ -48,11 +67,11 @@ describe('SocialAuthProviders', () => {
|
|||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
const tree = renderer.create(
|
const tree = renderer.create(reduxWrapper(
|
||||||
<IntlProvider locale="en">
|
<IntlProvider locale="en">
|
||||||
<SocialAuthProviders {...props} />
|
<SocialAuthProviders {...props} />
|
||||||
</IntlProvider>,
|
</IntlProvider>,
|
||||||
).toJSON();
|
)).toJSON();
|
||||||
|
|
||||||
expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
@@ -66,11 +85,11 @@ describe('SocialAuthProviders', () => {
|
|||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
|
||||||
const tree = renderer.create(
|
const tree = renderer.create(reduxWrapper(
|
||||||
<IntlProvider locale="en">
|
<IntlProvider locale="en">
|
||||||
<SocialAuthProviders {...props} />
|
<SocialAuthProviders {...props} />
|
||||||
</IntlProvider>,
|
</IntlProvider>,
|
||||||
).toJSON();
|
)).toJSON();
|
||||||
|
|
||||||
expect(tree).toMatchSnapshot();
|
expect(tree).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const configuration = {
|
|||||||
MARKETING_EMAILS_OPT_IN: process.env.MARKETING_EMAILS_OPT_IN || '',
|
MARKETING_EMAILS_OPT_IN: process.env.MARKETING_EMAILS_OPT_IN || '',
|
||||||
SHOW_CONFIGURABLE_EDX_FIELDS: process.env.SHOW_CONFIGURABLE_EDX_FIELDS || false,
|
SHOW_CONFIGURABLE_EDX_FIELDS: process.env.SHOW_CONFIGURABLE_EDX_FIELDS || false,
|
||||||
SHOW_REGISTRATION_LINKS: process.env.SHOW_REGISTRATION_LINKS !== 'false',
|
SHOW_REGISTRATION_LINKS: process.env.SHOW_REGISTRATION_LINKS !== 'false',
|
||||||
|
ENABLE_HARD_CODE_OPTIONAL_FIELDS: process.env.ENABLE_HARD_CODE_OPTIONAL_FIELDS || false,
|
||||||
ENABLE_IMAGE_LAYOUT: process.env.ENABLE_IMAGE_LAYOUT || false,
|
ENABLE_IMAGE_LAYOUT: process.env.ENABLE_IMAGE_LAYOUT || false,
|
||||||
// Links
|
// Links
|
||||||
ACTIVATION_EMAIL_SUPPORT_LINK: process.env.ACTIVATION_EMAIL_SUPPORT_LINK || null,
|
ACTIVATION_EMAIL_SUPPORT_LINK: process.env.ACTIVATION_EMAIL_SUPPORT_LINK || null,
|
||||||
@@ -35,6 +36,7 @@ const configuration = {
|
|||||||
ZENDESK_LOGO_URL: process.env.ZENDESK_LOGO_URL,
|
ZENDESK_LOGO_URL: process.env.ZENDESK_LOGO_URL,
|
||||||
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID || '',
|
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID || '',
|
||||||
ALGOLIA_SEARCH_API_KEY: process.env.ALGOLIA_SEARCH_API_KEY || '',
|
ALGOLIA_SEARCH_API_KEY: process.env.ALGOLIA_SEARCH_API_KEY || '',
|
||||||
|
AUTO_GENERATED_USERNAME_EXPERIMENT_ID: process.env.AUTO_GENERATED_USERNAME_EXPERIMENT_ID || '',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default configuration;
|
export default configuration;
|
||||||
|
|||||||
@@ -37,3 +37,4 @@ export const VALID_EMAIL_REGEX = '(^[-!#$%&\'*+/=?^_`{}|~0-9A-Z]+(\\.[-!#$%&\'*+
|
|||||||
// things like auto-enrollment upon login and registration.
|
// things like auto-enrollment upon login and registration.
|
||||||
export const AUTH_PARAMS = ['course_id', 'enrollment_action', 'course_mode', 'email_opt_in', 'purchase_workflow', 'next', 'register_for_free', 'track', 'is_account_recovery', 'variant', 'host', 'cta'];
|
export const AUTH_PARAMS = ['course_id', 'enrollment_action', 'course_mode', 'email_opt_in', 'purchase_workflow', 'next', 'register_for_free', 'track', 'is_account_recovery', 'variant', 'host', 'cta'];
|
||||||
export const REDIRECT = 'redirect';
|
export const REDIRECT = 'redirect';
|
||||||
|
export const APP_NAME = 'authn_mfe';
|
||||||
|
|||||||
37
src/data/segment/utils.js
Normal file
37
src/data/segment/utils.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/* eslint-disable import/prefer-default-export */
|
||||||
|
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
|
||||||
|
|
||||||
|
import { APP_NAME } from '../constants';
|
||||||
|
|
||||||
|
export const LINK_TIMEOUT = 300;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an event tracker function that sends a tracking event with the given name and options.
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the event to be tracked.
|
||||||
|
* @param {object} [options={}] - Additional options to be included with the event.
|
||||||
|
* @returns {function} - A function that, when called, sends the tracking event.
|
||||||
|
*/
|
||||||
|
export const createEventTracker = (name, options = {}) => () => sendTrackEvent(
|
||||||
|
name,
|
||||||
|
{ ...options, app_name: APP_NAME },
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an event tracker function that sends a tracking event with the given name and options.
|
||||||
|
*
|
||||||
|
* @param {string} name - The name of the event to be tracked.
|
||||||
|
* @param {object} [options={}] - Additional options to be included with the event.
|
||||||
|
* @returns {function} - A function that, when called, sends the tracking event.
|
||||||
|
*/
|
||||||
|
export const createPageEventTracker = (name, options = null) => () => sendPageEvent(
|
||||||
|
name,
|
||||||
|
options,
|
||||||
|
{ app_name: APP_NAME },
|
||||||
|
);
|
||||||
|
|
||||||
|
export const createLinkTracker = (tracker, href) => (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
tracker();
|
||||||
|
return setTimeout(() => { window.location.href = href; }, LINK_TIMEOUT);
|
||||||
|
};
|
||||||
@@ -11,3 +11,11 @@ export default function setCookie(cookieName, cookieValue, cookieExpiry) {
|
|||||||
cookies.set(cookieName, cookieValue, options);
|
cookies.set(cookieName, cookieValue, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function removeCookie(cookieName) {
|
||||||
|
if (cookieName) {
|
||||||
|
const cookies = new Cookies();
|
||||||
|
const options = { domain: getConfig().SESSION_COOKIE_DOMAIN, path: '/' };
|
||||||
|
cookies.remove(cookieName, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ export {
|
|||||||
windowScrollTo,
|
windowScrollTo,
|
||||||
} from './dataUtils';
|
} from './dataUtils';
|
||||||
export { default as AsyncActionType } from './reduxUtils';
|
export { default as AsyncActionType } from './reduxUtils';
|
||||||
export { default as setCookie } from './cookies';
|
export { default as setCookie, removeCookie } from './cookies';
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
|
|
||||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@@ -25,6 +24,10 @@ import BaseContainer from '../base-container';
|
|||||||
import { FormGroup } from '../common-components';
|
import { FormGroup } from '../common-components';
|
||||||
import { DEFAULT_STATE, LOGIN_PAGE, VALID_EMAIL_REGEX } from '../data/constants';
|
import { DEFAULT_STATE, LOGIN_PAGE, VALID_EMAIL_REGEX } from '../data/constants';
|
||||||
import { updatePathWithQueryParams, windowScrollTo } from '../data/utils';
|
import { updatePathWithQueryParams, windowScrollTo } from '../data/utils';
|
||||||
|
import {
|
||||||
|
trackForgotPasswordPageEvent,
|
||||||
|
trackForgotPasswordPageViewed,
|
||||||
|
} from '../tracking/trackers/forgotpassword';
|
||||||
|
|
||||||
const ForgotPasswordPage = (props) => {
|
const ForgotPasswordPage = (props) => {
|
||||||
const platformName = getConfig().SITE_NAME;
|
const platformName = getConfig().SITE_NAME;
|
||||||
@@ -41,8 +44,8 @@ const ForgotPasswordPage = (props) => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sendPageEvent('login_and_registration', 'reset');
|
trackForgotPasswordPageEvent();
|
||||||
sendTrackEvent('edx.bi.password_reset_form.viewed', { category: 'user-engagement' });
|
trackForgotPasswordPageViewed();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
|
|
||||||
import { injectIntl, useIntl } from '@edx/frontend-platform/i18n';
|
import { injectIntl, useIntl } from '@edx/frontend-platform/i18n';
|
||||||
import {
|
import {
|
||||||
Form, StatefulButton,
|
Form, StatefulButton,
|
||||||
@@ -42,7 +41,11 @@ import {
|
|||||||
getTpaProvider,
|
getTpaProvider,
|
||||||
updatePathWithQueryParams,
|
updatePathWithQueryParams,
|
||||||
} from '../data/utils';
|
} from '../data/utils';
|
||||||
|
import { removeCookie } from '../data/utils/cookies';
|
||||||
import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess';
|
import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess';
|
||||||
|
import {
|
||||||
|
trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess,
|
||||||
|
} from '../tracking/trackers/login';
|
||||||
|
|
||||||
const LoginPage = (props) => {
|
const LoginPage = (props) => {
|
||||||
const {
|
const {
|
||||||
@@ -78,9 +81,18 @@ const LoginPage = (props) => {
|
|||||||
const tpaHint = getTpaHint();
|
const tpaHint = getTpaHint();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
sendPageEvent('login_and_registration', 'login');
|
trackLoginPageViewed();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (loginResult.success) {
|
||||||
|
trackLoginSuccess();
|
||||||
|
|
||||||
|
// Remove this cookie that was set to capture marketingEmailsOptIn for the onboarding component
|
||||||
|
removeCookie('ssoPipelineRedirectionDone');
|
||||||
|
}
|
||||||
|
}, [loginResult]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const payload = { ...queryParams };
|
const payload = { ...queryParams };
|
||||||
if (tpaHint) {
|
if (tpaHint) {
|
||||||
@@ -170,9 +182,6 @@ const LoginPage = (props) => {
|
|||||||
const { name } = event.target;
|
const { name } = event.target;
|
||||||
setErrors(prevErrors => ({ ...prevErrors, [name]: '' }));
|
setErrors(prevErrors => ({ ...prevErrors, [name]: '' }));
|
||||||
};
|
};
|
||||||
const trackForgotPasswordLinkClick = () => {
|
|
||||||
sendTrackEvent('edx.bi.password-reset_form.toggled', { category: 'user-engagement' });
|
|
||||||
};
|
|
||||||
|
|
||||||
const { provider, skipHintedLogin } = getTpaProvider(tpaHint, providers, secondaryProviders);
|
const { provider, skipHintedLogin } = getTpaProvider(tpaHint, providers, secondaryProviders);
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import { act } from 'react-dom/test-utils';
|
|||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
|
|
||||||
import { COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE } from '../../data/constants';
|
import {
|
||||||
|
APP_NAME, COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE,
|
||||||
|
} from '../../data/constants';
|
||||||
import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from '../data/actions';
|
import { backupLoginFormBegin, dismissPasswordResetBanner, loginRequest } from '../data/actions';
|
||||||
import { INTERNAL_SERVER_ERROR } from '../data/constants';
|
import { INTERNAL_SERVER_ERROR } from '../data/constants';
|
||||||
import LoginPage from '../LoginPage';
|
import LoginPage from '../LoginPage';
|
||||||
@@ -751,7 +753,7 @@ describe('LoginPage', () => {
|
|||||||
|
|
||||||
it('should send page event when login page is rendered', () => {
|
it('should send page event when login page is rendered', () => {
|
||||||
render(reduxWrapper(<IntlLoginPage {...props} />));
|
render(reduxWrapper(<IntlLoginPage {...props} />));
|
||||||
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'login');
|
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'login', { app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tests that form is in invalid state when it is submitted', () => {
|
it('tests that form is in invalid state when it is submitted', () => {
|
||||||
@@ -784,7 +786,7 @@ describe('LoginPage', () => {
|
|||||||
{ selector: '#forgot-password' },
|
{ selector: '#forgot-password' },
|
||||||
));
|
));
|
||||||
|
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.password-reset_form.toggled', { category: 'user-engagement' });
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.password-reset_form.toggled', { category: 'user-engagement', app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should backup the login form state when shouldBackupState is true', () => {
|
it('should backup the login form state when shouldBackupState is true', () => {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
tpaProvidersSelector,
|
tpaProvidersSelector,
|
||||||
} from '../common-components/data/selectors';
|
} from '../common-components/data/selectors';
|
||||||
import messages from '../common-components/messages';
|
import messages from '../common-components/messages';
|
||||||
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
|
import { APP_NAME, LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
|
||||||
import {
|
import {
|
||||||
getTpaHint, getTpaProvider, updatePathWithQueryParams,
|
getTpaHint, getTpaProvider, updatePathWithQueryParams,
|
||||||
} from '../data/utils';
|
} from '../data/utils';
|
||||||
@@ -56,11 +56,11 @@ const Logistration = (props) => {
|
|||||||
}, [navigate, disablePublicAccountCreation]);
|
}, [navigate, disablePublicAccountCreation]);
|
||||||
|
|
||||||
const handleInstitutionLogin = (e) => {
|
const handleInstitutionLogin = (e) => {
|
||||||
sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement' });
|
sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement', app_name: APP_NAME });
|
||||||
if (typeof e === 'string') {
|
if (typeof e === 'string') {
|
||||||
sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register');
|
sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register', { app_name: APP_NAME });
|
||||||
} else {
|
} else {
|
||||||
sendPageEvent('login_and_registration', e.target.dataset.eventName);
|
sendPageEvent('login_and_registration', e.target.dataset.eventName, { app_name: APP_NAME });
|
||||||
}
|
}
|
||||||
|
|
||||||
setInstitutionLogin(!institutionLogin);
|
setInstitutionLogin(!institutionLogin);
|
||||||
@@ -70,7 +70,7 @@ const Logistration = (props) => {
|
|||||||
if (tabKey === currentTab) {
|
if (tabKey === currentTab) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' });
|
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement', app_name: APP_NAME });
|
||||||
props.clearThirdPartyAuthContextErrorMessage();
|
props.clearThirdPartyAuthContextErrorMessage();
|
||||||
if (tabKey === LOGIN_PAGE) {
|
if (tabKey === LOGIN_PAGE) {
|
||||||
props.backupRegistrationForm();
|
props.backupRegistrationForm();
|
||||||
|
|||||||
@@ -11,16 +11,21 @@ import configureStore from 'redux-mock-store';
|
|||||||
import Logistration from './Logistration';
|
import Logistration from './Logistration';
|
||||||
import { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions';
|
import { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions';
|
||||||
import {
|
import {
|
||||||
|
APP_NAME,
|
||||||
COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE,
|
COMPLETE_STATE, LOGIN_PAGE, REGISTER_PAGE,
|
||||||
} from '../data/constants';
|
} from '../data/constants';
|
||||||
import { backupLoginForm } from '../login/data/actions';
|
import { backupLoginForm } from '../login/data/actions';
|
||||||
import { backupRegistrationForm } from '../register/data/actions';
|
import { backupRegistrationForm } from '../register/data/actions';
|
||||||
|
import { NOT_INITIALIZED } from '../register/data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation
|
||||||
|
from '../register/data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
|
|
||||||
jest.mock('@edx/frontend-platform/analytics', () => ({
|
jest.mock('@edx/frontend-platform/analytics', () => ({
|
||||||
sendPageEvent: jest.fn(),
|
sendPageEvent: jest.fn(),
|
||||||
sendTrackEvent: jest.fn(),
|
sendTrackEvent: jest.fn(),
|
||||||
}));
|
}));
|
||||||
jest.mock('@edx/frontend-platform/auth');
|
jest.mock('@edx/frontend-platform/auth');
|
||||||
|
jest.mock('../register/data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation', () => jest.fn());
|
||||||
|
|
||||||
const mockStore = configureStore();
|
const mockStore = configureStore();
|
||||||
const IntlLogistration = injectIntl(Logistration);
|
const IntlLogistration = injectIntl(Logistration);
|
||||||
@@ -84,6 +89,7 @@ describe('Logistration', () => {
|
|||||||
})),
|
})),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
useAutoGeneratedUsernameExperimentVariation.mockReturnValue(NOT_INITIALIZED);
|
||||||
configure({
|
configure({
|
||||||
loggingService: { logError: jest.fn() },
|
loggingService: { logError: jest.fn() },
|
||||||
config: {
|
config: {
|
||||||
@@ -224,8 +230,8 @@ describe('Logistration', () => {
|
|||||||
render(reduxWrapper(<IntlLogistration {...props} />));
|
render(reduxWrapper(<IntlLogistration {...props} />));
|
||||||
fireEvent.click(screen.getByText('Institution/campus credentials'));
|
fireEvent.click(screen.getByText('Institution/campus credentials'));
|
||||||
|
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.institution_login_form.toggled', { category: 'user-engagement' });
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.institution_login_form.toggled', { category: 'user-engagement', app_name: APP_NAME });
|
||||||
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'institution_login');
|
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'institution_login', { app_name: APP_NAME });
|
||||||
|
|
||||||
mergeConfig({
|
mergeConfig({
|
||||||
DISABLE_ENTERPRISE_LOGIN: '',
|
DISABLE_ENTERPRISE_LOGIN: '',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig, snakeCaseObject } from '@edx/frontend-platform';
|
import { getConfig, snakeCaseObject } from '@edx/frontend-platform';
|
||||||
import { identifyAuthenticatedUser, sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
|
import { identifyAuthenticatedUser } from '@edx/frontend-platform/analytics';
|
||||||
import {
|
import {
|
||||||
AxiosJwtAuthService,
|
AxiosJwtAuthService,
|
||||||
configure as configureAuth,
|
configure as configureAuth,
|
||||||
@@ -39,6 +39,13 @@ import {
|
|||||||
import isOneTrustFunctionalCookieEnabled from '../data/oneTrust';
|
import isOneTrustFunctionalCookieEnabled from '../data/oneTrust';
|
||||||
import { getAllPossibleQueryParams, isHostAvailableInQueryParams } from '../data/utils';
|
import { getAllPossibleQueryParams, isHostAvailableInQueryParams } from '../data/utils';
|
||||||
import { FormFieldRenderer } from '../field-renderer';
|
import { FormFieldRenderer } from '../field-renderer';
|
||||||
|
import {
|
||||||
|
trackDisablePostRegistrationRecommendations,
|
||||||
|
trackProgressiveProfilingPageViewed,
|
||||||
|
trackProgressiveProfilingSkipLinkClick,
|
||||||
|
trackProgressiveProfilingSubmitClick,
|
||||||
|
trackProgressiveProfilingSupportLinkCLick,
|
||||||
|
} from '../tracking/trackers/progressive-profiling';
|
||||||
|
|
||||||
const ProgressiveProfiling = (props) => {
|
const ProgressiveProfiling = (props) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -98,14 +105,13 @@ const ProgressiveProfiling = (props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (authenticatedUser?.userId) {
|
if (authenticatedUser?.userId) {
|
||||||
identifyAuthenticatedUser(authenticatedUser.userId);
|
identifyAuthenticatedUser(authenticatedUser.userId);
|
||||||
sendPageEvent('login_and_registration', 'welcome');
|
trackProgressiveProfilingPageViewed();
|
||||||
}
|
}
|
||||||
}, [authenticatedUser]);
|
}, [authenticatedUser]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!enablePostRegistrationRecommendations) {
|
if (!enablePostRegistrationRecommendations) {
|
||||||
sendTrackEvent(
|
trackDisablePostRegistrationRecommendations(
|
||||||
'edx.bi.user.recommendations.not.enabled',
|
|
||||||
{ functionalCookiesConsent, page: 'authn_recommendations' },
|
{ functionalCookiesConsent, page: 'authn_recommendations' },
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -149,29 +155,23 @@ const ProgressiveProfiling = (props) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
props.saveUserProfile(authenticatedUser.username, snakeCaseObject(payload));
|
props.saveUserProfile(authenticatedUser.username, snakeCaseObject(payload));
|
||||||
|
const eventProperties = {
|
||||||
sendTrackEvent(
|
|
||||||
'edx.bi.welcome.page.submit.clicked',
|
|
||||||
{
|
|
||||||
isGenderSelected: !!values.gender,
|
isGenderSelected: !!values.gender,
|
||||||
isYearOfBirthSelected: !!values.year_of_birth,
|
isYearOfBirthSelected: !!values.year_of_birth,
|
||||||
isLevelOfEducationSelected: !!values.level_of_education,
|
isLevelOfEducationSelected: !!values.level_of_education,
|
||||||
isWorkExperienceSelected: !!values.work_experience,
|
isWorkExperienceSelected: !!values.work_experience,
|
||||||
host: queryParams?.host || '',
|
host: queryParams?.host || '',
|
||||||
},
|
};
|
||||||
);
|
trackProgressiveProfilingSubmitClick(eventProperties);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSkip = (e) => {
|
const handleSkip = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.history.replaceState(location.state, null, '');
|
window.history.replaceState(location.state, null, '');
|
||||||
setShowModal(true);
|
setShowModal(true);
|
||||||
sendTrackEvent(
|
trackProgressiveProfilingSkipLinkClick({
|
||||||
'edx.bi.welcome.page.skip.link.clicked',
|
|
||||||
{
|
|
||||||
host: queryParams?.host || '',
|
host: queryParams?.host || '',
|
||||||
},
|
});
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChangeHandler = (e) => {
|
const onChangeHandler = (e) => {
|
||||||
@@ -242,7 +242,7 @@ const ProgressiveProfiling = (props) => {
|
|||||||
destination={getConfig().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK}
|
destination={getConfig().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
showLaunchIcon={false}
|
showLaunchIcon={false}
|
||||||
onClick={() => (sendTrackEvent('edx.bi.welcome.page.support.link.clicked'))}
|
onClick={() => (trackProgressiveProfilingSupportLinkCLick())}
|
||||||
>
|
>
|
||||||
{formatMessage(messages['optional.fields.information.link'])}
|
{formatMessage(messages['optional.fields.information.link'])}
|
||||||
</Hyperlink>
|
</Hyperlink>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { MemoryRouter, mockNavigate, useLocation } from 'react-router-dom';
|
|||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
APP_NAME,
|
||||||
AUTHN_PROGRESSIVE_PROFILING,
|
AUTHN_PROGRESSIVE_PROFILING,
|
||||||
COMPLETE_STATE, DEFAULT_REDIRECT_URL,
|
COMPLETE_STATE, DEFAULT_REDIRECT_URL,
|
||||||
EMBEDDED,
|
EMBEDDED,
|
||||||
@@ -143,8 +144,9 @@ describe('ProgressiveProfilingTests', () => {
|
|||||||
const modalContentContainer = document.getElementsByClassName('.pgn__modal-content-container');
|
const modalContentContainer = document.getElementsByClassName('.pgn__modal-content-container');
|
||||||
|
|
||||||
expect(modalContentContainer).toBeTruthy();
|
expect(modalContentContainer).toBeTruthy();
|
||||||
|
const payload = { host: '', app_name: APP_NAME };
|
||||||
|
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.skip.link.clicked', { host: '' });
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.skip.link.clicked', payload);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ******** test event functionality ********
|
// ******** test event functionality ********
|
||||||
@@ -165,7 +167,7 @@ describe('ProgressiveProfilingTests', () => {
|
|||||||
const supportLink = screen.getByRole('link', { name: /learn more about how we use this information/i });
|
const supportLink = screen.getByRole('link', { name: /learn more about how we use this information/i });
|
||||||
fireEvent.click(supportLink);
|
fireEvent.click(supportLink);
|
||||||
|
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.support.link.clicked');
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.support.link.clicked', { app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set empty host property value for non-embedded experience', () => {
|
it('should set empty host property value for non-embedded experience', () => {
|
||||||
@@ -175,6 +177,7 @@ describe('ProgressiveProfilingTests', () => {
|
|||||||
isLevelOfEducationSelected: false,
|
isLevelOfEducationSelected: false,
|
||||||
isWorkExperienceSelected: false,
|
isWorkExperienceSelected: false,
|
||||||
host: '',
|
host: '',
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
delete window.location;
|
delete window.location;
|
||||||
window.location = { href: getConfig().BASE_URL.concat(AUTHN_PROGRESSIVE_PROFILING) };
|
window.location = { href: getConfig().BASE_URL.concat(AUTHN_PROGRESSIVE_PROFILING) };
|
||||||
@@ -316,7 +319,7 @@ describe('ProgressiveProfilingTests', () => {
|
|||||||
const skipLinkButton = screen.getByText('Skip for now');
|
const skipLinkButton = screen.getByText('Skip for now');
|
||||||
fireEvent.click(skipLinkButton);
|
fireEvent.click(skipLinkButton);
|
||||||
|
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.skip.link.clicked', { host });
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.welcome.page.skip.link.clicked', { host, app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show spinner while fetching the optional fields', () => {
|
it('should show spinner while fetching the optional fields', () => {
|
||||||
@@ -349,6 +352,7 @@ describe('ProgressiveProfilingTests', () => {
|
|||||||
isLevelOfEducationSelected: false,
|
isLevelOfEducationSelected: false,
|
||||||
isWorkExperienceSelected: false,
|
isWorkExperienceSelected: false,
|
||||||
host: 'http://example.com',
|
host: 'http://example.com',
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
delete window.location;
|
delete window.location;
|
||||||
window.location = {
|
window.location = {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const generateProductKey = (product) => (
|
|||||||
export const getProductMapping = (recommendedProducts) => recommendedProducts.map((product) => ({
|
export const getProductMapping = (recommendedProducts) => recommendedProducts.map((product) => ({
|
||||||
product_key: generateProductKey(product),
|
product_key: generateProductKey(product),
|
||||||
product_line: product.cardType,
|
product_line: product.cardType,
|
||||||
product_source: product.productSource.name,
|
product_source: product?.productSource?.name,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const trackRecommendationClick = (product, position, userId) => {
|
export const trackRecommendationClick = (product, position, userId) => {
|
||||||
@@ -25,7 +25,7 @@ export const trackRecommendationClick = (product, position, userId) => {
|
|||||||
recommendation_type: product.recommendationType,
|
recommendation_type: product.recommendationType,
|
||||||
product_key: generateProductKey(product),
|
product_key: generateProductKey(product),
|
||||||
product_line: product.cardType,
|
product_line: product.cardType,
|
||||||
product_source: product.productSource.name,
|
product_source: product?.productSource?.name,
|
||||||
user_id: userId,
|
user_id: userId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const INVALID_NAME_REGEX = /https?:\/\/(?:[-\w.]|(?:%[\da-fA-F]{2}))*/g;
|
|||||||
|
|
||||||
const validateName = (value, formatMessage) => {
|
const validateName = (value, formatMessage) => {
|
||||||
let fieldError = '';
|
let fieldError = '';
|
||||||
if (!value.trim()) {
|
if (!value || (value && !value.trim())) {
|
||||||
fieldError = formatMessage(messages['empty.name.field.error']);
|
fieldError = formatMessage(messages['empty.name.field.error']);
|
||||||
} else if (URL_REGEX.test(value) || HTML_REGEX.test(value) || INVALID_NAME_REGEX.test(value)) {
|
} else if (URL_REGEX.test(value) || HTML_REGEX.test(value) || INVALID_NAME_REGEX.test(value)) {
|
||||||
fieldError = formatMessage(messages['name.validation.message']);
|
fieldError = formatMessage(messages['name.validation.message']);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import React, {
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
|
|
||||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||||
import { Form, Spinner, StatefulButton } from '@openedx/paragon';
|
import { Form, Spinner, StatefulButton } from '@openedx/paragon';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
@@ -18,6 +17,7 @@ import {
|
|||||||
backupRegistrationFormBegin,
|
backupRegistrationFormBegin,
|
||||||
clearRegistrationBackendError,
|
clearRegistrationBackendError,
|
||||||
registerNewUser,
|
registerNewUser,
|
||||||
|
setAutoGeneratedUsernameExperimentData,
|
||||||
setEmailSuggestionInStore,
|
setEmailSuggestionInStore,
|
||||||
setUserPipelineDataLoaded,
|
setUserPipelineDataLoaded,
|
||||||
} from './data/actions';
|
} from './data/actions';
|
||||||
@@ -25,6 +25,8 @@ import {
|
|||||||
FORM_SUBMISSION_ERROR,
|
FORM_SUBMISSION_ERROR,
|
||||||
TPA_AUTHENTICATION_FAILURE,
|
TPA_AUTHENTICATION_FAILURE,
|
||||||
} from './data/constants';
|
} from './data/constants';
|
||||||
|
import { AUTO_GENERATED_USERNAME_REGISTRATION_EXP_VARIATION, NOT_INITIALIZED } from './data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation from './data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
import getBackendValidations from './data/selectors';
|
import getBackendValidations from './data/selectors';
|
||||||
import {
|
import {
|
||||||
isFormValid, prepareRegistrationPayload,
|
isFormValid, prepareRegistrationPayload,
|
||||||
@@ -41,11 +43,12 @@ import { getThirdPartyAuthContext as getRegistrationDataFromBackend } from '../c
|
|||||||
import EnterpriseSSO from '../common-components/EnterpriseSSO';
|
import EnterpriseSSO from '../common-components/EnterpriseSSO';
|
||||||
import ThirdPartyAuth from '../common-components/ThirdPartyAuth';
|
import ThirdPartyAuth from '../common-components/ThirdPartyAuth';
|
||||||
import {
|
import {
|
||||||
COMPLETE_STATE, PENDING_STATE, REGISTER_PAGE,
|
APP_NAME, COMPLETE_STATE, PENDING_STATE, REGISTER_PAGE,
|
||||||
} from '../data/constants';
|
} from '../data/constants';
|
||||||
import {
|
import {
|
||||||
getAllPossibleQueryParams, getTpaHint, getTpaProvider, isHostAvailableInQueryParams, setCookie,
|
getAllPossibleQueryParams, getTpaHint, getTpaProvider, isHostAvailableInQueryParams, removeCookie, setCookie,
|
||||||
} from '../data/utils';
|
} from '../data/utils';
|
||||||
|
import { trackRegistrationPageViewed, trackRegistrationSuccess } from '../tracking/trackers/register';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main Registration Page component
|
* Main Registration Page component
|
||||||
@@ -68,6 +71,7 @@ const RegistrationPage = (props) => {
|
|||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const backedUpFormData = useSelector(state => state.register.registrationFormData);
|
const backedUpFormData = useSelector(state => state.register.registrationFormData);
|
||||||
|
const initExpVariation = useSelector(state => state.register.autoGeneratedUsernameExperimentVariation);
|
||||||
const registrationError = useSelector(state => state.register.registrationError);
|
const registrationError = useSelector(state => state.register.registrationError);
|
||||||
const registrationErrorCode = registrationError?.errorCode;
|
const registrationErrorCode = registrationError?.errorCode;
|
||||||
const registrationResult = useSelector(state => state.register.registrationResult);
|
const registrationResult = useSelector(state => state.register.registrationResult);
|
||||||
@@ -103,6 +107,12 @@ const RegistrationPage = (props) => {
|
|||||||
? formatMessage(messages['create.account.cta.button'], { label: cta })
|
? formatMessage(messages['create.account.cta.button'], { label: cta })
|
||||||
: formatMessage(messages['create.account.for.free.button']);
|
: formatMessage(messages['create.account.for.free.button']);
|
||||||
|
|
||||||
|
const autoGeneratedUsernameExpVariation = useAutoGeneratedUsernameExperimentVariation(
|
||||||
|
initExpVariation, registrationEmbedded, tpaHint, currentProvider, thirdPartyAuthApiStatus,
|
||||||
|
);
|
||||||
|
|
||||||
|
const hideUsernameField = flags.autoGeneratedUsernameEnabled
|
||||||
|
|| autoGeneratedUsernameExpVariation === AUTO_GENERATED_USERNAME_REGISTRATION_EXP_VARIATION;
|
||||||
/**
|
/**
|
||||||
* Set the userPipelineDetails data in formFields for only first time
|
* Set the userPipelineDetails data in formFields for only first time
|
||||||
*/
|
*/
|
||||||
@@ -128,7 +138,7 @@ const RegistrationPage = (props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!formStartTime) {
|
if (!formStartTime) {
|
||||||
sendPageEvent('login_and_registration', 'register');
|
trackRegistrationPageViewed();
|
||||||
const payload = { ...queryParams, is_register_page: true };
|
const payload = { ...queryParams, is_register_page: true };
|
||||||
if (tpaHint) {
|
if (tpaHint) {
|
||||||
payload.tpa_hint = tpaHint;
|
payload.tpa_hint = tpaHint;
|
||||||
@@ -149,8 +159,10 @@ const RegistrationPage = (props) => {
|
|||||||
formFields: { ...formFields },
|
formFields: { ...formFields },
|
||||||
errors: { ...errors },
|
errors: { ...errors },
|
||||||
}));
|
}));
|
||||||
|
dispatch(setAutoGeneratedUsernameExperimentData(autoGeneratedUsernameExpVariation));
|
||||||
}
|
}
|
||||||
}, [shouldBackupState, configurableFormFields, formFields, errors, dispatch, backedUpFormData]);
|
}, [shouldBackupState, configurableFormFields, // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
formFields, errors, dispatch, backedUpFormData]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (backendValidations) {
|
if (backendValidations) {
|
||||||
@@ -171,10 +183,15 @@ const RegistrationPage = (props) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (registrationResult.success) {
|
if (registrationResult.success) {
|
||||||
// This event is used by GTM
|
// This event is used by GTM
|
||||||
sendTrackEvent('edx.bi.user.account.registered.client', {});
|
trackRegistrationSuccess();
|
||||||
|
|
||||||
// This is used by the "User Retention Rate Event" on GTM
|
// This is used by the "User Retention Rate Event" on GTM
|
||||||
setCookie(getConfig().USER_RETENTION_COOKIE_NAME, true);
|
setCookie(getConfig().USER_RETENTION_COOKIE_NAME, true);
|
||||||
|
|
||||||
|
// Remove marketingEmailsOptIn cookie that was set on SSO registration flow
|
||||||
|
removeCookie('marketingEmailsOptIn');
|
||||||
|
// Remove this cookie that was set to capture marketingEmailsOptIn for the onboarding component
|
||||||
|
removeCookie('ssoPipelineRedirectionDone');
|
||||||
}
|
}
|
||||||
}, [registrationResult]);
|
}, [registrationResult]);
|
||||||
|
|
||||||
@@ -210,13 +227,13 @@ const RegistrationPage = (props) => {
|
|||||||
|
|
||||||
const registerUser = () => {
|
const registerUser = () => {
|
||||||
const totalRegistrationTime = (Date.now() - formStartTime) / 1000;
|
const totalRegistrationTime = (Date.now() - formStartTime) / 1000;
|
||||||
let payload = { ...formFields };
|
let payload = { ...formFields, app_name: APP_NAME };
|
||||||
|
|
||||||
if (currentProvider) {
|
if (currentProvider) {
|
||||||
delete payload.password;
|
delete payload.password;
|
||||||
payload.social_auth_provider = currentProvider;
|
payload.social_auth_provider = currentProvider;
|
||||||
}
|
}
|
||||||
if (flags.autoGeneratedUsernameEnabled) {
|
if (hideUsernameField) {
|
||||||
delete payload.username;
|
delete payload.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +303,11 @@ const RegistrationPage = (props) => {
|
|||||||
getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && !!Object.keys(optionalFields.fields).length
|
getConfig().ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN && !!Object.keys(optionalFields.fields).length
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{autoSubmitRegForm && !errorCode.type ? (
|
{(autoSubmitRegForm && !errorCode.type)
|
||||||
|
|| (!autoGeneratedUsernameExpVariation && !(
|
||||||
|
autoGeneratedUsernameExpVariation === NOT_INITIALIZED
|
||||||
|
|| registrationEmbedded || !!tpaHint || !!currentProvider))
|
||||||
|
? (
|
||||||
<div className="mw-xs mt-5 text-center">
|
<div className="mw-xs mt-5 text-center">
|
||||||
<Spinner animation="border" variant="primary" id="tpa-spinner" />
|
<Spinner animation="border" variant="primary" id="tpa-spinner" />
|
||||||
</div>
|
</div>
|
||||||
@@ -328,7 +349,7 @@ const RegistrationPage = (props) => {
|
|||||||
helpText={[formatMessage(messages['help.text.email'])]}
|
helpText={[formatMessage(messages['help.text.email'])]}
|
||||||
floatingLabel={formatMessage(messages['registration.email.label'])}
|
floatingLabel={formatMessage(messages['registration.email.label'])}
|
||||||
/>
|
/>
|
||||||
{!flags.autoGeneratedUsernameEnabled && (
|
{!hideUsernameField && (
|
||||||
<UsernameField
|
<UsernameField
|
||||||
name="username"
|
name="username"
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
@@ -385,7 +406,6 @@ const RegistrationPage = (props) => {
|
|||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ import {
|
|||||||
setUserPipelineDataLoaded,
|
setUserPipelineDataLoaded,
|
||||||
} from './data/actions';
|
} from './data/actions';
|
||||||
import { INTERNAL_SERVER_ERROR } from './data/constants';
|
import { INTERNAL_SERVER_ERROR } from './data/constants';
|
||||||
|
import { NOT_INITIALIZED } from './data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation
|
||||||
|
from './data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
import RegistrationPage from './RegistrationPage';
|
import RegistrationPage from './RegistrationPage';
|
||||||
import {
|
import {
|
||||||
AUTHN_PROGRESSIVE_PROFILING, COMPLETE_STATE, PENDING_STATE, REGISTER_PAGE,
|
APP_NAME, AUTHN_PROGRESSIVE_PROFILING, COMPLETE_STATE, PENDING_STATE, REGISTER_PAGE,
|
||||||
} from '../data/constants';
|
} from '../data/constants';
|
||||||
|
|
||||||
jest.mock('@edx/frontend-platform/analytics', () => ({
|
jest.mock('@edx/frontend-platform/analytics', () => ({
|
||||||
@@ -30,6 +33,7 @@ jest.mock('@edx/frontend-platform/i18n', () => ({
|
|||||||
...jest.requireActual('@edx/frontend-platform/i18n'),
|
...jest.requireActual('@edx/frontend-platform/i18n'),
|
||||||
getLocale: jest.fn(),
|
getLocale: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
jest.mock('./data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation', () => jest.fn());
|
||||||
|
|
||||||
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
||||||
const mockStore = configureStore();
|
const mockStore = configureStore();
|
||||||
@@ -128,6 +132,7 @@ describe('RegistrationPage', () => {
|
|||||||
institutionLogin: false,
|
institutionLogin: false,
|
||||||
};
|
};
|
||||||
window.location = { search: '' };
|
window.location = { search: '' };
|
||||||
|
useAutoGeneratedUsernameExperimentVariation.mockReturnValue(NOT_INITIALIZED);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -185,6 +190,7 @@ describe('RegistrationPage', () => {
|
|||||||
honor_code: true,
|
honor_code: true,
|
||||||
total_registration_time: 0,
|
total_registration_time: 0,
|
||||||
next: '/course/demo-course-url',
|
next: '/course/demo-course-url',
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
store.dispatch = jest.fn(store.dispatch);
|
store.dispatch = jest.fn(store.dispatch);
|
||||||
@@ -207,6 +213,7 @@ describe('RegistrationPage', () => {
|
|||||||
honor_code: true,
|
honor_code: true,
|
||||||
social_auth_provider: 'Apple',
|
social_auth_provider: 'Apple',
|
||||||
total_registration_time: 0,
|
total_registration_time: 0,
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
store = mockStore({
|
store = mockStore({
|
||||||
@@ -292,6 +299,7 @@ describe('RegistrationPage', () => {
|
|||||||
honor_code: true,
|
honor_code: true,
|
||||||
total_registration_time: 0,
|
total_registration_time: 0,
|
||||||
marketing_emails_opt_in: true,
|
marketing_emails_opt_in: true,
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
store.dispatch = jest.fn(store.dispatch);
|
store.dispatch = jest.fn(store.dispatch);
|
||||||
@@ -318,6 +326,7 @@ describe('RegistrationPage', () => {
|
|||||||
country: 'Pakistan',
|
country: 'Pakistan',
|
||||||
honor_code: true,
|
honor_code: true,
|
||||||
total_registration_time: 0,
|
total_registration_time: 0,
|
||||||
|
app_name: APP_NAME,
|
||||||
};
|
};
|
||||||
|
|
||||||
store.dispatch = jest.fn(store.dispatch);
|
store.dispatch = jest.fn(store.dispatch);
|
||||||
@@ -592,7 +601,7 @@ describe('RegistrationPage', () => {
|
|||||||
|
|
||||||
it('should send page event when register page is rendered', () => {
|
it('should send page event when register page is rendered', () => {
|
||||||
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
||||||
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'register');
|
expect(sendPageEvent).toHaveBeenCalledWith('login_and_registration', 'register', { app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should send track event when user has successfully registered', () => {
|
it('should send track event when user has successfully registered', () => {
|
||||||
@@ -610,7 +619,7 @@ describe('RegistrationPage', () => {
|
|||||||
delete window.location;
|
delete window.location;
|
||||||
window.location = { href: getConfig().BASE_URL };
|
window.location = { href: getConfig().BASE_URL };
|
||||||
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
||||||
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.user.account.registered.client', {});
|
expect(sendTrackEvent).toHaveBeenCalledWith('edx.bi.user.account.registered.client', { app_name: APP_NAME });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should populate form with pipeline user details', () => {
|
it('should populate form with pipeline user details', () => {
|
||||||
@@ -883,6 +892,7 @@ describe('RegistrationPage', () => {
|
|||||||
country: 'PK',
|
country: 'PK',
|
||||||
social_auth_provider: 'Apple',
|
social_auth_provider: 'Apple',
|
||||||
total_registration_time: 0,
|
total_registration_time: 0,
|
||||||
|
app_name: APP_NAME,
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import { getConfig } from '@edx/frontend-platform';
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
import { getCountryList, getLocale, useIntl } from '@edx/frontend-platform/i18n';
|
import { getCountryList, getLocale, useIntl } from '@edx/frontend-platform/i18n';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { FormFieldRenderer } from '../../field-renderer';
|
import { FormFieldRenderer } from '../../field-renderer';
|
||||||
|
import { backupRegistrationFormBegin } from '../data/actions';
|
||||||
import { FIELDS } from '../data/constants';
|
import { FIELDS } from '../data/constants';
|
||||||
import messages from '../messages';
|
import messages from '../messages';
|
||||||
import { CountryField, HonorCode, TermsOfService } from '../RegistrationFields';
|
import { CountryField, HonorCode, TermsOfService } from '../RegistrationFields';
|
||||||
@@ -32,12 +34,16 @@ const ConfigurableRegistrationForm = (props) => {
|
|||||||
setFormFields,
|
setFormFields,
|
||||||
autoSubmitRegistrationForm,
|
autoSubmitRegistrationForm,
|
||||||
} = props;
|
} = props;
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
/** The reason for adding the entry 'United States' is that Chrome browser aut-fill the form with the 'Unites
|
/** The reason for adding the entry 'United States' is that Chrome browser aut-fill the form with the 'Unites
|
||||||
States' instead of 'United States of America' which does not exist in country dropdown list and gets the user
|
States' instead of 'United States of America' which does not exist in country dropdown list and gets the user
|
||||||
confused and unable to create an account. So we added the United States entry in the dropdown list.
|
confused and unable to create an account. So we added the United States entry in the dropdown list.
|
||||||
*/
|
*/
|
||||||
const countryList = useMemo(() => getCountryList(getLocale()).concat([{ code: 'US', name: 'United States' }]), []);
|
|
||||||
|
const countryList = useMemo(() => (
|
||||||
|
getCountryList(getLocale()).concat([{ code: 'US', name: 'United States' }]).filter(country => country.code !== 'RU')
|
||||||
|
), []);
|
||||||
|
|
||||||
let showTermsOfServiceAndHonorCode = false;
|
let showTermsOfServiceAndHonorCode = false;
|
||||||
let showCountryField = false;
|
let showCountryField = false;
|
||||||
@@ -50,6 +56,8 @@ const ConfigurableRegistrationForm = (props) => {
|
|||||||
showMarketingEmailOptInCheckbox: getConfig().MARKETING_EMAILS_OPT_IN,
|
showMarketingEmailOptInCheckbox: getConfig().MARKETING_EMAILS_OPT_IN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const backedUpFormData = useSelector(state => state.register.registrationFormData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If auto submitting register form, we will check tos and honor code fields if they exist for feature parity.
|
* If auto submitting register form, we will check tos and honor code fields if they exist for feature parity.
|
||||||
*/
|
*/
|
||||||
@@ -90,6 +98,16 @@ const ConfigurableRegistrationForm = (props) => {
|
|||||||
setFieldErrors(prevErrors => ({ ...prevErrors, [name]: '' }));
|
setFieldErrors(prevErrors => ({ ...prevErrors, [name]: '' }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// setting marketingEmailsOptIn state for SSO authentication flow for register API call
|
||||||
|
if (name === 'marketingEmailsOptIn') {
|
||||||
|
dispatch(backupRegistrationFormBegin({
|
||||||
|
...backedUpFormData,
|
||||||
|
configurableFormFields: {
|
||||||
|
...backedUpFormData.configurableFormFields,
|
||||||
|
[name]: value,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
}
|
||||||
setFormFields(prevState => ({ ...prevState, [name]: value }));
|
setFormFields(prevState => ({ ...prevState, [name]: value }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,12 @@ import { fireEvent, render } from '@testing-library/react';
|
|||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import configureStore from 'redux-mock-store';
|
import configureStore from 'redux-mock-store';
|
||||||
|
|
||||||
|
import { APP_NAME } from '../../../data/constants';
|
||||||
import { registerNewUser } from '../../data/actions';
|
import { registerNewUser } from '../../data/actions';
|
||||||
import { FIELDS } from '../../data/constants';
|
import { FIELDS } from '../../data/constants';
|
||||||
|
import { NOT_INITIALIZED } from '../../data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation
|
||||||
|
from '../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
import RegistrationPage from '../../RegistrationPage';
|
import RegistrationPage from '../../RegistrationPage';
|
||||||
import ConfigurableRegistrationForm from '../ConfigurableRegistrationForm';
|
import ConfigurableRegistrationForm from '../ConfigurableRegistrationForm';
|
||||||
|
|
||||||
@@ -22,6 +26,7 @@ jest.mock('@edx/frontend-platform/i18n', () => ({
|
|||||||
...jest.requireActual('@edx/frontend-platform/i18n'),
|
...jest.requireActual('@edx/frontend-platform/i18n'),
|
||||||
getLocale: jest.fn(),
|
getLocale: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
jest.mock('../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation', () => jest.fn());
|
||||||
|
|
||||||
const IntlConfigurableRegistrationForm = injectIntl(ConfigurableRegistrationForm);
|
const IntlConfigurableRegistrationForm = injectIntl(ConfigurableRegistrationForm);
|
||||||
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
||||||
@@ -121,6 +126,7 @@ describe('ConfigurableRegistrationForm', () => {
|
|||||||
};
|
};
|
||||||
window.location = { search: '' };
|
window.location = { search: '' };
|
||||||
getLocale.mockImplementationOnce(() => ('en-us'));
|
getLocale.mockImplementationOnce(() => ('en-us'));
|
||||||
|
useAutoGeneratedUsernameExperimentVariation.mockReturnValue(NOT_INITIALIZED);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -260,7 +266,7 @@ describe('ConfigurableRegistrationForm', () => {
|
|||||||
|
|
||||||
fireEvent.click(submitButton);
|
fireEvent.click(submitButton);
|
||||||
|
|
||||||
expect(store.dispatch).toHaveBeenCalledWith(registerNewUser({ ...payload, country: 'PK' }));
|
expect(store.dispatch).toHaveBeenCalledWith(registerNewUser({ ...payload, country: 'PK', app_name: APP_NAME }));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show error messages for required fields on empty form submission', () => {
|
it('should show error messages for required fields on empty form submission', () => {
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import configureStore from 'redux-mock-store';
|
|||||||
import {
|
import {
|
||||||
FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR, TPA_AUTHENTICATION_FAILURE, TPA_SESSION_EXPIRED,
|
FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR, TPA_AUTHENTICATION_FAILURE, TPA_SESSION_EXPIRED,
|
||||||
} from '../../data/constants';
|
} from '../../data/constants';
|
||||||
|
import { NOT_INITIALIZED } from '../../data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation
|
||||||
|
from '../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
import RegistrationPage from '../../RegistrationPage';
|
import RegistrationPage from '../../RegistrationPage';
|
||||||
import RegistrationFailureMessage from '../RegistrationFailure';
|
import RegistrationFailureMessage from '../RegistrationFailure';
|
||||||
|
|
||||||
@@ -23,6 +26,7 @@ jest.mock('@edx/frontend-platform/i18n', () => ({
|
|||||||
...jest.requireActual('@edx/frontend-platform/i18n'),
|
...jest.requireActual('@edx/frontend-platform/i18n'),
|
||||||
getLocale: jest.fn(),
|
getLocale: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
jest.mock('../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation', () => jest.fn());
|
||||||
|
|
||||||
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
||||||
const IntlRegistrationFailure = injectIntl(RegistrationFailureMessage);
|
const IntlRegistrationFailure = injectIntl(RegistrationFailureMessage);
|
||||||
@@ -121,6 +125,7 @@ describe('RegistrationFailure', () => {
|
|||||||
institutionLogin: false,
|
institutionLogin: false,
|
||||||
};
|
};
|
||||||
window.location = { search: '' };
|
window.location = { search: '' };
|
||||||
|
useAutoGeneratedUsernameExperimentVariation.mockReturnValue(NOT_INITIALIZED);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import configureStore from 'redux-mock-store';
|
|||||||
import {
|
import {
|
||||||
COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE, REGISTER_PAGE,
|
COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE, REGISTER_PAGE,
|
||||||
} from '../../../data/constants';
|
} from '../../../data/constants';
|
||||||
|
import { NOT_INITIALIZED } from '../../data/optimizelyExperiment/helper';
|
||||||
|
import useAutoGeneratedUsernameExperimentVariation
|
||||||
|
from '../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation';
|
||||||
import RegistrationPage from '../../RegistrationPage';
|
import RegistrationPage from '../../RegistrationPage';
|
||||||
|
|
||||||
jest.mock('@edx/frontend-platform/analytics', () => ({
|
jest.mock('@edx/frontend-platform/analytics', () => ({
|
||||||
@@ -22,6 +25,7 @@ jest.mock('@edx/frontend-platform/i18n', () => ({
|
|||||||
...jest.requireActual('@edx/frontend-platform/i18n'),
|
...jest.requireActual('@edx/frontend-platform/i18n'),
|
||||||
getLocale: jest.fn(),
|
getLocale: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
jest.mock('../../data/optimizelyExperiment/useAutoGeneratedUsernameExperimentVariation', () => jest.fn());
|
||||||
|
|
||||||
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
||||||
const mockStore = configureStore();
|
const mockStore = configureStore();
|
||||||
@@ -120,6 +124,7 @@ describe('ThirdPartyAuth', () => {
|
|||||||
institutionLogin: false,
|
institutionLogin: false,
|
||||||
};
|
};
|
||||||
window.location = { search: '' };
|
window.location = { search: '' };
|
||||||
|
useAutoGeneratedUsernameExperimentVariation.mockReturnValue(NOT_INITIALIZED);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export const REGISTRATION_CLEAR_BACKEND_ERROR = 'REGISTRATION_CLEAR_BACKEND_ERRO
|
|||||||
export const REGISTER_SET_COUNTRY_CODE = 'REGISTER_SET_COUNTRY_CODE';
|
export const REGISTER_SET_COUNTRY_CODE = 'REGISTER_SET_COUNTRY_CODE';
|
||||||
export const REGISTER_SET_USER_PIPELINE_DATA_LOADED = 'REGISTER_SET_USER_PIPELINE_DATA_LOADED';
|
export const REGISTER_SET_USER_PIPELINE_DATA_LOADED = 'REGISTER_SET_USER_PIPELINE_DATA_LOADED';
|
||||||
export const REGISTER_SET_EMAIL_SUGGESTIONS = 'REGISTER_SET_EMAIL_SUGGESTIONS';
|
export const REGISTER_SET_EMAIL_SUGGESTIONS = 'REGISTER_SET_EMAIL_SUGGESTIONS';
|
||||||
|
export const REGISTER_SET_AUTO_GENERATED_USERNAME_REGISTRATION_EXP_DATA = 'REGISTER_SET_AUTO_GENERATED_USERNAME_REGISTRATION_EXP_DATA';
|
||||||
// Backup registration form
|
// Backup registration form
|
||||||
export const backupRegistrationForm = () => ({
|
export const backupRegistrationForm = () => ({
|
||||||
type: BACKUP_REGISTRATION_DATA.BASE,
|
type: BACKUP_REGISTRATION_DATA.BASE,
|
||||||
@@ -83,3 +83,9 @@ export const setUserPipelineDataLoaded = (value) => ({
|
|||||||
type: REGISTER_SET_USER_PIPELINE_DATA_LOADED,
|
type: REGISTER_SET_USER_PIPELINE_DATA_LOADED,
|
||||||
payload: { value },
|
payload: { value },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Auto Generated Username Registration Experiment Actions
|
||||||
|
export const setAutoGeneratedUsernameExperimentData = (autoGeneratedRegExpVariation) => ({
|
||||||
|
type: REGISTER_SET_AUTO_GENERATED_USERNAME_REGISTRATION_EXP_DATA,
|
||||||
|
payload: { autoGeneratedRegExpVariation },
|
||||||
|
});
|
||||||
|
|||||||
30
src/register/data/optimizelyExperiment/helper.js
Normal file
30
src/register/data/optimizelyExperiment/helper.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* This file contains data for auto generated username Optimizely experiment
|
||||||
|
*/
|
||||||
|
import { getConfig } from '@edx/frontend-platform';
|
||||||
|
|
||||||
|
export const NOT_INITIALIZED = 'experiment-not-initialized';
|
||||||
|
export const CONTROL = 'control-registration-page';
|
||||||
|
export const AUTO_GENERATED_USERNAME_REGISTRATION_EXP_VARIATION = 'auto-generated-username-register-page';
|
||||||
|
const AUTO_GENERATED_USERNAME_EXP_PAGE = 'targeting_for_auto_generated_username_page';
|
||||||
|
|
||||||
|
export function getAutoGeneratedUsernameExperimentVariation() {
|
||||||
|
try {
|
||||||
|
if (window.optimizely
|
||||||
|
&& window.optimizely.get('data').experiments[getConfig().AUTO_GENERATED_USERNAME_EXPERIMENT_ID]) {
|
||||||
|
const selectedVariant = window.optimizely.get('state').getVariationMap()[
|
||||||
|
getConfig().AUTO_GENERATED_USERNAME_EXPERIMENT_ID
|
||||||
|
];
|
||||||
|
return selectedVariant?.name;
|
||||||
|
}
|
||||||
|
} catch (e) { /* empty */ }
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
export function activateAutoGeneratedUsernameExperiment() {
|
||||||
|
window.optimizely = window.optimizely || [];
|
||||||
|
window.optimizely.push({
|
||||||
|
type: 'page',
|
||||||
|
pageName: AUTO_GENERATED_USERNAME_EXP_PAGE,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
activateAutoGeneratedUsernameExperiment,
|
||||||
|
getAutoGeneratedUsernameExperimentVariation,
|
||||||
|
NOT_INITIALIZED,
|
||||||
|
} from './helper';
|
||||||
|
import { COMPLETE_STATE } from '../../../data/constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This hook returns activates multi step registration experiment and returns the experiment
|
||||||
|
* variation for the user.
|
||||||
|
*/
|
||||||
|
const useAutoGeneratedUsernameExperimentVariation = (
|
||||||
|
initExpVariation,
|
||||||
|
registrationEmbedded,
|
||||||
|
tpaHint,
|
||||||
|
currentProvider,
|
||||||
|
thirdPartyAuthApiStatus,
|
||||||
|
) => {
|
||||||
|
const [variation, setVariation] = useState(initExpVariation);
|
||||||
|
useEffect(() => {
|
||||||
|
if (initExpVariation || registrationEmbedded || !!tpaHint || !!currentProvider
|
||||||
|
|| thirdPartyAuthApiStatus !== COMPLETE_STATE) {
|
||||||
|
return variation;
|
||||||
|
}
|
||||||
|
|
||||||
|
const getVariation = () => {
|
||||||
|
const expVariation = getAutoGeneratedUsernameExperimentVariation();
|
||||||
|
if (expVariation) {
|
||||||
|
setVariation(expVariation);
|
||||||
|
} else {
|
||||||
|
// This is to handle the case when user dont get variation for some reason, the register page
|
||||||
|
// shows unlimited spinner.
|
||||||
|
setVariation(NOT_INITIALIZED);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
activateAutoGeneratedUsernameExperiment();
|
||||||
|
|
||||||
|
const timer = setTimeout(getVariation, 300);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearTimeout(timer);
|
||||||
|
};
|
||||||
|
}, [ // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
initExpVariation, currentProvider, registrationEmbedded, thirdPartyAuthApiStatus, tpaHint,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return variation;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default useAutoGeneratedUsernameExperimentVariation;
|
||||||
@@ -3,6 +3,7 @@ import {
|
|||||||
REGISTER_CLEAR_USERNAME_SUGGESTIONS,
|
REGISTER_CLEAR_USERNAME_SUGGESTIONS,
|
||||||
REGISTER_FORM_VALIDATIONS,
|
REGISTER_FORM_VALIDATIONS,
|
||||||
REGISTER_NEW_USER,
|
REGISTER_NEW_USER,
|
||||||
|
REGISTER_SET_AUTO_GENERATED_USERNAME_REGISTRATION_EXP_DATA,
|
||||||
REGISTER_SET_COUNTRY_CODE,
|
REGISTER_SET_COUNTRY_CODE,
|
||||||
REGISTER_SET_EMAIL_SUGGESTIONS,
|
REGISTER_SET_EMAIL_SUGGESTIONS,
|
||||||
REGISTER_SET_USER_PIPELINE_DATA_LOADED,
|
REGISTER_SET_USER_PIPELINE_DATA_LOADED,
|
||||||
@@ -39,6 +40,7 @@ export const defaultState = {
|
|||||||
usernameSuggestions: [],
|
usernameSuggestions: [],
|
||||||
validationApiRateLimited: false,
|
validationApiRateLimited: false,
|
||||||
shouldBackupState: false,
|
shouldBackupState: false,
|
||||||
|
autoGeneratedUsernameExperimentVariation: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
const reducer = (state = defaultState, action = {}) => {
|
const reducer = (state = defaultState, action = {}) => {
|
||||||
@@ -55,6 +57,12 @@ const reducer = (state = defaultState, action = {}) => {
|
|||||||
registrationFormData: { ...action.payload },
|
registrationFormData: { ...action.payload },
|
||||||
userPipelineDataLoaded: state.userPipelineDataLoaded,
|
userPipelineDataLoaded: state.userPipelineDataLoaded,
|
||||||
};
|
};
|
||||||
|
case REGISTER_SET_AUTO_GENERATED_USERNAME_REGISTRATION_EXP_DATA: {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
autoGeneratedUsernameExperimentVariation: action.payload.autoGeneratedRegExpVariation,
|
||||||
|
};
|
||||||
|
}
|
||||||
case REGISTER_NEW_USER.BEGIN:
|
case REGISTER_NEW_USER.BEGIN:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ describe('Registration Reducer Tests', () => {
|
|||||||
usernameSuggestions: [],
|
usernameSuggestions: [],
|
||||||
validationApiRateLimited: false,
|
validationApiRateLimited: false,
|
||||||
shouldBackupState: false,
|
shouldBackupState: false,
|
||||||
|
autoGeneratedUsernameExperimentVariation: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
it('should return the initial state', () => {
|
it('should return the initial state', () => {
|
||||||
|
|||||||
@@ -43,13 +43,10 @@ export const isFormValid = (
|
|||||||
Object.keys(payload).forEach(key => {
|
Object.keys(payload).forEach(key => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'name':
|
case 'name':
|
||||||
if (!fieldErrors.name) {
|
|
||||||
fieldErrors.name = validateName(payload.name, formatMessage);
|
fieldErrors.name = validateName(payload.name, formatMessage);
|
||||||
}
|
|
||||||
if (fieldErrors.name) { isValid = false; }
|
if (fieldErrors.name) { isValid = false; }
|
||||||
break;
|
break;
|
||||||
case 'email': {
|
case 'email': {
|
||||||
if (!fieldErrors.email) {
|
|
||||||
const {
|
const {
|
||||||
fieldError, confirmEmailError, suggestion,
|
fieldError, confirmEmailError, suggestion,
|
||||||
} = validateEmail(payload.email, configurableFormFields?.confirm_email, formatMessage);
|
} = validateEmail(payload.email, configurableFormFields?.confirm_email, formatMessage);
|
||||||
@@ -62,20 +59,15 @@ export const isFormValid = (
|
|||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
emailSuggestion = suggestion;
|
emailSuggestion = suggestion;
|
||||||
}
|
|
||||||
if (fieldErrors.email) { isValid = false; }
|
if (fieldErrors.email) { isValid = false; }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'username':
|
case 'username':
|
||||||
if (!fieldErrors.username) {
|
|
||||||
fieldErrors.username = validateUsername(payload.username, formatMessage);
|
fieldErrors.username = validateUsername(payload.username, formatMessage);
|
||||||
}
|
|
||||||
if (fieldErrors.username) { isValid = false; }
|
if (fieldErrors.username) { isValid = false; }
|
||||||
break;
|
break;
|
||||||
case 'password':
|
case 'password':
|
||||||
if (!fieldErrors.password) {
|
|
||||||
fieldErrors.password = validatePasswordField(payload.password, formatMessage);
|
fieldErrors.password = validatePasswordField(payload.password, formatMessage);
|
||||||
}
|
|
||||||
if (fieldErrors.password) { isValid = false; }
|
if (fieldErrors.password) { isValid = false; }
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { useNavigate, useParams } from 'react-router-dom';
|
|||||||
|
|
||||||
import { resetPassword, validateToken } from './data/actions';
|
import { resetPassword, validateToken } from './data/actions';
|
||||||
import {
|
import {
|
||||||
FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, TOKEN_STATE,
|
FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, SUCCESS, TOKEN_STATE,
|
||||||
} from './data/constants';
|
} from './data/constants';
|
||||||
import { resetPasswordResultSelector } from './data/selectors';
|
import { resetPasswordResultSelector } from './data/selectors';
|
||||||
import { validatePassword } from './data/service';
|
import { validatePassword } from './data/service';
|
||||||
@@ -30,6 +30,7 @@ import {
|
|||||||
LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE,
|
LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE,
|
||||||
} from '../data/constants';
|
} from '../data/constants';
|
||||||
import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils';
|
import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils';
|
||||||
|
import { trackPasswordResetSuccess, trackResetPasswordPageViewed } from '../tracking/trackers/reset-password';
|
||||||
|
|
||||||
const ResetPasswordPage = (props) => {
|
const ResetPasswordPage = (props) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@@ -42,6 +43,15 @@ const ResetPasswordPage = (props) => {
|
|||||||
const { token } = useParams();
|
const { token } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (props.status === TOKEN_STATE.VALID) {
|
||||||
|
trackResetPasswordPageViewed();
|
||||||
|
}
|
||||||
|
if (props.status === SUCCESS) {
|
||||||
|
trackPasswordResetSuccess();
|
||||||
|
}
|
||||||
|
}, [props.status]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.status !== TOKEN_STATE.PENDING && props.status !== PASSWORD_RESET_ERROR) {
|
if (props.status !== TOKEN_STATE.PENDING && props.status !== PASSWORD_RESET_ERROR) {
|
||||||
setErrorCode(props.status);
|
setErrorCode(props.status);
|
||||||
@@ -139,7 +149,7 @@ const ResetPasswordPage = (props) => {
|
|||||||
}
|
}
|
||||||
} else if (props.status === PASSWORD_RESET_ERROR) {
|
} else if (props.status === PASSWORD_RESET_ERROR) {
|
||||||
navigate(updatePathWithQueryParams(RESET_PAGE));
|
navigate(updatePathWithQueryParams(RESET_PAGE));
|
||||||
} else if (props.status === 'success') {
|
} else if (props.status === SUCCESS) {
|
||||||
navigate(updatePathWithQueryParams(LOGIN_PAGE));
|
navigate(updatePathWithQueryParams(LOGIN_PAGE));
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ import ResetPasswordPage from '../ResetPasswordPage';
|
|||||||
const mockedNavigator = jest.fn();
|
const mockedNavigator = jest.fn();
|
||||||
const token = '1c-bmjdkc-5e60e084cf8113048ca7';
|
const token = '1c-bmjdkc-5e60e084cf8113048ca7';
|
||||||
|
|
||||||
|
jest.mock('@edx/frontend-platform/analytics', () => ({
|
||||||
|
sendPageEvent: jest.fn(),
|
||||||
|
sendTrackEvent: jest.fn(),
|
||||||
|
}));
|
||||||
|
|
||||||
jest.mock('@edx/frontend-platform/auth');
|
jest.mock('@edx/frontend-platform/auth');
|
||||||
jest.mock('react-router-dom', () => ({
|
jest.mock('react-router-dom', () => ({
|
||||||
...(jest.requireActual('react-router-dom')),
|
...(jest.requireActual('react-router-dom')),
|
||||||
|
|||||||
22
src/tracking/trackers/forgotpassword.js
Normal file
22
src/tracking/trackers/forgotpassword.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../data/segment/utils';
|
||||||
|
|
||||||
|
export const eventNames = {
|
||||||
|
loginAndRegistration: 'login_and_registration',
|
||||||
|
forgotPasswordPageViewed: 'edx.bi.password_reset_form.viewed',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const categories = {
|
||||||
|
userEngagement: 'user-engagement',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Event tracker for forgot password page viewed
|
||||||
|
export const trackForgotPasswordPageViewed = () => createEventTracker(
|
||||||
|
eventNames.forgotPasswordPageViewed,
|
||||||
|
{
|
||||||
|
category: categories.userEngagement,
|
||||||
|
},
|
||||||
|
)();
|
||||||
|
|
||||||
|
export const trackForgotPasswordPageEvent = () => {
|
||||||
|
createPageEventTracker(eventNames.loginAndRegistration, 'forgot-password')();
|
||||||
|
};
|
||||||
29
src/tracking/trackers/login.js
Normal file
29
src/tracking/trackers/login.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../data/segment/utils';
|
||||||
|
|
||||||
|
export const eventNames = {
|
||||||
|
forgotPasswordLinkClicked: 'edx.bi.password-reset_form.toggled',
|
||||||
|
loginAndRegistration: 'login_and_registration',
|
||||||
|
registerFormToggled: 'edx.bi.register_form.toggled',
|
||||||
|
loginSuccess: 'edx.bi.user.account.authenticated.client',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const categories = {
|
||||||
|
userEngagement: 'user-engagement',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Event tracker for Forgot Password link click
|
||||||
|
export const trackForgotPasswordLinkClick = () => createEventTracker(
|
||||||
|
eventNames.forgotPasswordLinkClicked,
|
||||||
|
{ category: categories.userEngagement },
|
||||||
|
)();
|
||||||
|
|
||||||
|
// Tracks the login page event.
|
||||||
|
export const trackLoginPageViewed = () => {
|
||||||
|
createPageEventTracker(eventNames.loginAndRegistration, 'login')();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tracks the login sucess event.
|
||||||
|
export const trackLoginSuccess = () => createEventTracker(
|
||||||
|
eventNames.loginSuccess,
|
||||||
|
{},
|
||||||
|
)();
|
||||||
37
src/tracking/trackers/progressive-profiling.js
Normal file
37
src/tracking/trackers/progressive-profiling.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../data/segment/utils';
|
||||||
|
|
||||||
|
export const eventNames = {
|
||||||
|
progressiveProfilingSubmitClick: 'edx.bi.welcome.page.submit.clicked',
|
||||||
|
progressiveProfilingSkipLinkClick: 'edx.bi.welcome.page.skip.link.clicked',
|
||||||
|
disablePostRegistrationRecommendations: 'edx.bi.user.recommendations.not.enabled',
|
||||||
|
progressiveProfilingSupportLinkCLick: 'edx.bi.welcome.page.support.link.clicked',
|
||||||
|
loginAndRegistration: 'login_and_registration',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Event link tracker for Progressive profiling skip button click
|
||||||
|
export const trackProgressiveProfilingSkipLinkClick = evenProperties => createEventTracker(
|
||||||
|
eventNames.progressiveProfilingSkipLinkClick, { ...evenProperties },
|
||||||
|
)();
|
||||||
|
|
||||||
|
// Event tracker for progressive profiling submit button click
|
||||||
|
export const trackProgressiveProfilingSubmitClick = (evenProperties) => createEventTracker(
|
||||||
|
eventNames.progressiveProfilingSubmitClick,
|
||||||
|
{ ...evenProperties },
|
||||||
|
)();
|
||||||
|
|
||||||
|
// Event tracker for progressive profiling submit button click
|
||||||
|
export const trackDisablePostRegistrationRecommendations = (evenProperties) => createEventTracker(
|
||||||
|
eventNames.disablePostRegistrationRecommendations,
|
||||||
|
{ ...evenProperties },
|
||||||
|
)();
|
||||||
|
|
||||||
|
// Tracks the progressive profiling page event.
|
||||||
|
export const trackProgressiveProfilingPageViewed = () => {
|
||||||
|
createPageEventTracker(eventNames.loginAndRegistration, 'welcome')();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tracks the progressive profiling spport link click.
|
||||||
|
export const trackProgressiveProfilingSupportLinkCLick = () => createEventTracker(
|
||||||
|
eventNames.progressiveProfilingSupportLinkCLick,
|
||||||
|
{},
|
||||||
|
)();
|
||||||
22
src/tracking/trackers/register.js
Normal file
22
src/tracking/trackers/register.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../data/segment/utils';
|
||||||
|
|
||||||
|
export const eventNames = {
|
||||||
|
loginAndRegistration: 'login_and_registration',
|
||||||
|
registrationSuccess: 'edx.bi.user.account.registered.client',
|
||||||
|
loginFormToggled: 'edx.bi.login_form.toggled',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const categories = {
|
||||||
|
userEngagement: 'user-engagement',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Event tracker for successful registration
|
||||||
|
export const trackRegistrationSuccess = () => createEventTracker(
|
||||||
|
eventNames.registrationSuccess,
|
||||||
|
{},
|
||||||
|
)();
|
||||||
|
|
||||||
|
// Tracks the progressive profiling page event.
|
||||||
|
export const trackRegistrationPageViewed = () => {
|
||||||
|
createPageEventTracker(eventNames.loginAndRegistration, 'register')();
|
||||||
|
};
|
||||||
14
src/tracking/trackers/reset-password.js
Normal file
14
src/tracking/trackers/reset-password.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../data/segment/utils';
|
||||||
|
|
||||||
|
export const eventNames = {
|
||||||
|
loginAndRegistration: 'login_and_registration',
|
||||||
|
resetPasswordSuccess: 'edx.bi.user.password.reset.success',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const trackResetPasswordPageViewed = () => {
|
||||||
|
createPageEventTracker(eventNames.loginAndRegistration, 'reset-password')();
|
||||||
|
};
|
||||||
|
|
||||||
|
export const trackPasswordResetSuccess = () => {
|
||||||
|
createEventTracker(eventNames.resetPasswordSuccess, {})();
|
||||||
|
};
|
||||||
37
src/tracking/trackers/tests/forgot-password.test.jsx
Normal file
37
src/tracking/trackers/tests/forgot-password.test.jsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../../data/segment/utils';
|
||||||
|
import {
|
||||||
|
categories,
|
||||||
|
eventNames,
|
||||||
|
trackForgotPasswordPageEvent,
|
||||||
|
trackForgotPasswordPageViewed,
|
||||||
|
} from '../forgotpassword';
|
||||||
|
|
||||||
|
// Mock createEventTracker function
|
||||||
|
jest.mock('../../../data/segment/utils', () => ({
|
||||||
|
createEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createPageEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Tracking Functions', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire trackForgotPasswordPageEvent', () => {
|
||||||
|
trackForgotPasswordPageEvent();
|
||||||
|
|
||||||
|
expect(createPageEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.loginAndRegistration,
|
||||||
|
'forgot-password',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire forgotPasswordPageViewedEvent', () => {
|
||||||
|
trackForgotPasswordPageViewed();
|
||||||
|
|
||||||
|
expect(createEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.forgotPasswordPageViewed,
|
||||||
|
{ category: categories.userEngagement },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
37
src/tracking/trackers/tests/login.test.jsx
Normal file
37
src/tracking/trackers/tests/login.test.jsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../../data/segment/utils';
|
||||||
|
import {
|
||||||
|
categories,
|
||||||
|
eventNames,
|
||||||
|
trackForgotPasswordLinkClick,
|
||||||
|
trackLoginPageViewed,
|
||||||
|
} from '../login';
|
||||||
|
|
||||||
|
// Mock createEventTracker function
|
||||||
|
jest.mock('../../../data/segment/utils', () => ({
|
||||||
|
createEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createPageEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Tracking Functions', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('trackForgotPasswordLinkClick function', () => {
|
||||||
|
trackForgotPasswordLinkClick();
|
||||||
|
|
||||||
|
expect(createEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.forgotPasswordLinkClicked,
|
||||||
|
{ category: categories.userEngagement },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('trackLoginPageEvent function', () => {
|
||||||
|
trackLoginPageViewed();
|
||||||
|
|
||||||
|
expect(createPageEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.loginAndRegistration,
|
||||||
|
'login',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
37
src/tracking/trackers/tests/progressive-profiling.test.jsx
Normal file
37
src/tracking/trackers/tests/progressive-profiling.test.jsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../../data/segment/utils';
|
||||||
|
import {
|
||||||
|
eventNames,
|
||||||
|
trackProgressiveProfilingPageViewed,
|
||||||
|
trackProgressiveProfilingSkipLinkClick,
|
||||||
|
} from '../progressive-profiling';
|
||||||
|
|
||||||
|
// Mock createEventTracker function
|
||||||
|
jest.mock('../../../data/segment/utils', () => ({
|
||||||
|
createEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createPageEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createLinkTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Tracking Functions', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire trackProgressiveProfilingSkipLinkClickEvent', () => {
|
||||||
|
trackProgressiveProfilingSkipLinkClick();
|
||||||
|
|
||||||
|
expect(createEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.progressiveProfilingSkipLinkClick,
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire trackProgressiveProfilingPageEvent', () => {
|
||||||
|
trackProgressiveProfilingPageViewed();
|
||||||
|
|
||||||
|
expect(createPageEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.loginAndRegistration,
|
||||||
|
'welcome',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
36
src/tracking/trackers/tests/register.test.jsx
Normal file
36
src/tracking/trackers/tests/register.test.jsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { createEventTracker, createPageEventTracker } from '../../../data/segment/utils';
|
||||||
|
import {
|
||||||
|
eventNames,
|
||||||
|
trackRegistrationPageViewed,
|
||||||
|
trackRegistrationSuccess,
|
||||||
|
} from '../register';
|
||||||
|
|
||||||
|
// Mock createEventTracker function
|
||||||
|
jest.mock('../../../data/segment/utils', () => ({
|
||||||
|
createEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createPageEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Tracking Functions', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire registrationSuccessEvent', () => {
|
||||||
|
trackRegistrationSuccess();
|
||||||
|
|
||||||
|
expect(createEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.registrationSuccess,
|
||||||
|
{},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire trackRegistrationPageEvent', () => {
|
||||||
|
trackRegistrationPageViewed();
|
||||||
|
|
||||||
|
expect(createPageEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.loginAndRegistration,
|
||||||
|
'register',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
26
src/tracking/trackers/tests/reset-password.test.jsx
Normal file
26
src/tracking/trackers/tests/reset-password.test.jsx
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { createPageEventTracker } from '../../../data/segment/utils';
|
||||||
|
import {
|
||||||
|
eventNames,
|
||||||
|
trackResetPasswordPageViewed,
|
||||||
|
} from '../reset-password';
|
||||||
|
|
||||||
|
// Mock createEventTracker function
|
||||||
|
jest.mock('../../../data/segment/utils', () => ({
|
||||||
|
createEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
createPageEventTracker: jest.fn().mockImplementation(() => jest.fn()),
|
||||||
|
}));
|
||||||
|
|
||||||
|
describe('Tracking Functions', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should fire trackResettPasswordPageEvent', () => {
|
||||||
|
trackResetPasswordPageViewed();
|
||||||
|
|
||||||
|
expect(createPageEventTracker).toHaveBeenCalledWith(
|
||||||
|
eventNames.loginAndRegistration,
|
||||||
|
'reset-password',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user