Compare commits
17 Commits
v8.0.0
...
renovate/a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85881f5857 | ||
|
|
af6fe9fcdb | ||
|
|
1118dca6c8 | ||
|
|
59ac43b1cc | ||
|
|
aaa849a697 | ||
|
|
840b042606 | ||
|
|
93d62e35e8 | ||
|
|
0c305651b0 | ||
|
|
dfad1edcb9 | ||
|
|
af46ef756e | ||
|
|
c86165180f | ||
|
|
97063850c6 | ||
|
|
af252d2d3f | ||
|
|
9e850c3229 | ||
|
|
413454b6e6 | ||
|
|
ed7cc8a36e | ||
|
|
a8a4ad59ed |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v5
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
- name: Install dependencies
|
||||
|
||||
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -4,10 +4,17 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- alpha
|
||||
permissions:
|
||||
contents: read # for checkout
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # to be able to publish a GitHub release
|
||||
issues: write # to be able to comment on released issues
|
||||
pull-requests: write # to be able to comment on released pull requests
|
||||
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
@@ -16,7 +23,7 @@ jobs:
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
- name: Install dependencies
|
||||
@@ -39,9 +46,6 @@ jobs:
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Release
|
||||
uses: cycjimmy/semantic-release-action@v3
|
||||
with:
|
||||
semantic_version: 16
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
||||
run: npx semantic-release@25
|
||||
|
||||
176
package-lock.json
generated
176
package-lock.json
generated
@@ -34,10 +34,10 @@
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-redux": "^8.1.1",
|
||||
"react-router-dom": "6.30.1",
|
||||
"react-router-dom": "6.30.2",
|
||||
"react-test-renderer": "^18.3.1",
|
||||
"redux": "4.2.1",
|
||||
"redux-saga": "1.3.0",
|
||||
"redux-saga": "1.4.2",
|
||||
"ts-jest": "^29.4.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -2432,9 +2432,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@edx/frontend-platform": {
|
||||
"version": "8.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@edx/frontend-platform/-/frontend-platform-8.5.1.tgz",
|
||||
"integrity": "sha512-8u3EdO0o7xX4vqorjOx3k2wbs2bu3DXlIA3bnD+Y56vSB5QYw6k5GzYqo9pPaTMGeq9TuLRvPLE/QFFlc3xvPg==",
|
||||
"version": "8.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@edx/frontend-platform/-/frontend-platform-8.5.2.tgz",
|
||||
"integrity": "sha512-YlxNWs8NW/I7F03k/jH6grWIuY/GJrspq7fqWm5K0ocvNEf+B8XKcaLUof+jVUuCItK93SoVRDZewwejnjty5w==",
|
||||
"license": "AGPL-3.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
@@ -7267,9 +7267,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon": {
|
||||
"version": "23.14.4",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-23.14.4.tgz",
|
||||
"integrity": "sha512-iY0CX4THmtvmsrVwGYbxgo86PnJirgfYIS4LzqH2umxhBB5oGN41lOxs8EspUglraGb6LPs017hZBVlZFb0z8g==",
|
||||
"version": "23.18.2",
|
||||
"resolved": "https://registry.npmjs.org/@openedx/paragon/-/paragon-23.18.2.tgz",
|
||||
"integrity": "sha512-/mQq0Wf2JL4m7kMpECluXYQVanqmJUwPyjL7e7OBK0vPne/4a5fbQ2cq0wqrZ0ROLk/5f2jvc9V6wrKPd1Xo1A==",
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"workspaces": [
|
||||
@@ -7282,7 +7282,7 @@
|
||||
"dependencies": {
|
||||
"@popperjs/core": "^2.11.4",
|
||||
"@tokens-studio/sd-transforms": "^1.2.4",
|
||||
"axios": "^0.27.2",
|
||||
"axios": "^0.30.2",
|
||||
"bootstrap": "^4.6.2",
|
||||
"chalk": "^4.1.2",
|
||||
"child_process": "^1.0.2",
|
||||
@@ -7291,7 +7291,7 @@
|
||||
"cli-progress": "^3.12.0",
|
||||
"commander": "^9.4.1",
|
||||
"email-prop-type": "^3.0.0",
|
||||
"file-selector": "^0.6.0",
|
||||
"file-selector": "^0.10.0",
|
||||
"glob": "^8.0.3",
|
||||
"inquirer": "^8.2.5",
|
||||
"js-toml": "^1.0.0",
|
||||
@@ -7316,11 +7316,11 @@
|
||||
"react-loading-skeleton": "^3.1.0",
|
||||
"react-popper": "^2.2.5",
|
||||
"react-proptype-conditional-require": "^1.0.4",
|
||||
"react-responsive": "^8.2.0",
|
||||
"react-responsive": "^10.0.0",
|
||||
"react-table": "^7.7.0",
|
||||
"react-transition-group": "^4.4.2",
|
||||
"sass": "^1.58.3",
|
||||
"style-dictionary": "^4.3.2",
|
||||
"style-dictionary": "^4.4.0",
|
||||
"tabbable": "^5.3.3",
|
||||
"uncontrollable": "^7.2.1",
|
||||
"uuid": "^9.0.0"
|
||||
@@ -7424,13 +7424,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/axios": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz",
|
||||
"integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==",
|
||||
"version": "0.30.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.30.2.tgz",
|
||||
"integrity": "sha512-0pE4RQ4UQi1jKY6p7u6i1Tkzqmu+d+/tHS7Q7rKunWLB9WyilBTpHHpXzPNMDj5hTbK0B0PTLSz07yqMBiF6xg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.14.9",
|
||||
"form-data": "^4.0.0"
|
||||
"follow-redirects": "^1.15.4",
|
||||
"form-data": "^4.0.4",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/brace-expansion": {
|
||||
@@ -7471,6 +7472,15 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/matchmediaquery": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/matchmediaquery/-/matchmediaquery-0.4.2.tgz",
|
||||
"integrity": "sha512-wrZpoT50ehYOudhDjt/YvUJc6eUzcdFPdmbizfgvswCKNHD1/OBOHYJpHie+HXpu6bSkEGieFMYk6VuutaiRfA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"css-mediaquery": "^0.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/minimatch": {
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
@@ -7511,6 +7521,30 @@
|
||||
"postcss": "^8.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/react-responsive": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-responsive/-/react-responsive-10.0.1.tgz",
|
||||
"integrity": "sha512-OM5/cRvbtUWEX8le8RCT8scA8y2OPtb0Q/IViEyCEM5FBN8lRrkUOZnu87I88A6njxDldvxG+rLBxWiA7/UM9g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"hyphenate-style-name": "^1.0.0",
|
||||
"matchmediaquery": "^0.4.2",
|
||||
"prop-types": "^15.6.1",
|
||||
"shallow-equal": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@openedx/paragon/node_modules/shallow-equal": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/shallow-equal/-/shallow-equal-3.1.0.tgz",
|
||||
"integrity": "sha512-pfVOw8QZIXpMbhBWvzBISicvToTiM5WBF1EeAUZDDSb5Dt29yl4AYbyywbJFSEsRUMr7gJaxqCdr4L3tQf9wVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@paralleldrive/cuid2": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz",
|
||||
@@ -7908,18 +7942,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@redux-saga/core": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/core/-/core-1.3.0.tgz",
|
||||
"integrity": "sha512-L+i+qIGuyWn7CIg7k1MteHGfttKPmxwZR5E7OsGikCL2LzYA0RERlaUY00Y3P3ZV2EYgrsYlBrGs6cJP5OKKqA==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/core/-/core-1.4.2.tgz",
|
||||
"integrity": "sha512-nIMLGKo6jV6Wc1sqtVQs1iqbB3Kq20udB/u9XEaZQisT6YZ0NRB8+4L6WqD/E+YziYutd27NJbG8EWUPkb7c6Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.3",
|
||||
"@redux-saga/deferred": "^1.2.1",
|
||||
"@redux-saga/delay-p": "^1.2.1",
|
||||
"@redux-saga/is": "^1.1.3",
|
||||
"@redux-saga/symbols": "^1.1.3",
|
||||
"@redux-saga/types": "^1.2.1",
|
||||
"@babel/runtime": "^7.28.4",
|
||||
"@redux-saga/deferred": "^1.3.1",
|
||||
"@redux-saga/delay-p": "^1.3.1",
|
||||
"@redux-saga/is": "^1.2.1",
|
||||
"@redux-saga/symbols": "^1.2.1",
|
||||
"@redux-saga/types": "^1.3.1",
|
||||
"typescript-tuple": "^2.2.1"
|
||||
},
|
||||
"funding": {
|
||||
@@ -7928,51 +7962,51 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@redux-saga/deferred": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/deferred/-/deferred-1.2.1.tgz",
|
||||
"integrity": "sha512-cmin3IuuzMdfQjA0lG4B+jX+9HdTgHZZ+6u3jRAOwGUxy77GSlTi4Qp2d6PM1PUoTmQUR5aijlA39scWWPF31g==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/deferred/-/deferred-1.3.1.tgz",
|
||||
"integrity": "sha512-0YZ4DUivWojXBqLB/TmuRRpDDz7tyq1I0AuDV7qi01XlLhM5m51W7+xYtIckH5U2cMlv9eAuicsfRAi1XHpXIg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@redux-saga/delay-p": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/delay-p/-/delay-p-1.2.1.tgz",
|
||||
"integrity": "sha512-MdiDxZdvb1m+Y0s4/hgdcAXntpUytr9g0hpcOO1XFVyyzkrDu3SKPgBFOtHn7lhu7n24ZKIAT1qtKyQjHqRd+w==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/delay-p/-/delay-p-1.3.1.tgz",
|
||||
"integrity": "sha512-597I7L5MXbD/1i3EmcaOOjL/5suxJD7p5tnbV1PiWnE28c2cYiIHqmSMK2s7us2/UrhOL2KTNBiD0qBg6KnImg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@redux-saga/symbols": "^1.1.3"
|
||||
"@redux-saga/symbols": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@redux-saga/is": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/is/-/is-1.1.3.tgz",
|
||||
"integrity": "sha512-naXrkETG1jLRfVfhOx/ZdLj0EyAzHYbgJWkXbB3qFliPcHKiWbv/ULQryOAEKyjrhiclmr6AMdgsXFyx7/yE6Q==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/is/-/is-1.2.1.tgz",
|
||||
"integrity": "sha512-x3aWtX3GmQfEvn8dh0ovPbsXgK9JjpiR24wKztpGbZP8JZUWWvUgKrvnWZ/T/4iphOBftyVc9VrIwhAnsM+OFA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@redux-saga/symbols": "^1.1.3",
|
||||
"@redux-saga/types": "^1.2.1"
|
||||
"@redux-saga/symbols": "^1.2.1",
|
||||
"@redux-saga/types": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@redux-saga/symbols": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/symbols/-/symbols-1.1.3.tgz",
|
||||
"integrity": "sha512-hCx6ZvU4QAEUojETnX8EVg4ubNLBFl1Lps4j2tX7o45x/2qg37m3c6v+kSp8xjDJY+2tJw4QB3j8o8dsl1FDXg==",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/symbols/-/symbols-1.2.1.tgz",
|
||||
"integrity": "sha512-3dh+uDvpBXi7EUp/eO+N7eFM4xKaU4yuGBXc50KnZGzIrR/vlvkTFQsX13zsY8PB6sCFYAgROfPSRUj8331QSA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@redux-saga/types": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/types/-/types-1.2.1.tgz",
|
||||
"integrity": "sha512-1dgmkh+3so0+LlBWRhGA33ua4MYr7tUOj+a9Si28vUi0IUFNbff1T3sgpeDJI/LaC75bBYnQ0A3wXjn0OrRNBA==",
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@redux-saga/types/-/types-1.3.1.tgz",
|
||||
"integrity": "sha512-YRCrJdhQLobGIQ8Cj1sta3nn6DrZDTSUnrIYhS2e5V590BmfVDleKoAquclAiKSBKWJwmuXTb+b4BL6rSHnahw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz",
|
||||
"integrity": "sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==",
|
||||
"version": "1.23.1",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.1.tgz",
|
||||
"integrity": "sha512-vDbaOzF7yT2Qs4vO6XV1MHcJv+3dgR1sT+l3B8xxOVhUC336prMvqrvsLL/9Dnw2xr6Qhz4J0dmS0llNAbnUmQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -14930,12 +14964,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/file-selector": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.6.0.tgz",
|
||||
"integrity": "sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw==",
|
||||
"version": "0.10.0",
|
||||
"resolved": "https://registry.npmjs.org/file-selector/-/file-selector-0.10.0.tgz",
|
||||
"integrity": "sha512-iXLQxZTDe9qtBDkpaU4msOWNbh/4JxYSux7BsVxgt+0HBCpj9qPUFjD3SDBPLCJDoU3MsJh1i+CseQ/9488F/A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
"tslib": "^2.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
@@ -24384,12 +24418,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "6.30.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.1.tgz",
|
||||
"integrity": "sha512-X1m21aEmxGXqENEPG3T6u0Th7g0aS4ZmoNynhbs+Cn+q+QGTLt+d5IQ2bHAXKzKcxGJjxACpVbnYQSCRcfxHlQ==",
|
||||
"version": "6.30.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.2.tgz",
|
||||
"integrity": "sha512-H2Bm38Zu1bm8KUE5NVWRMzuIyAV8p/JrOaBJAwVmp37AXG72+CZJlEBw6pdn9i5TBgLMhNDgijS4ZlblpHyWTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.23.0"
|
||||
"@remix-run/router": "1.23.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -24399,14 +24433,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "6.30.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.1.tgz",
|
||||
"integrity": "sha512-llKsgOkZdbPU1Eg3zK8lCn+sjD9wMRZZPuzmdWWX5SUs8OFkN5HnFVC0u5KMeMaC9aoancFI/KoLuKPqN+hxHw==",
|
||||
"version": "6.30.2",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.2.tgz",
|
||||
"integrity": "sha512-l2OwHn3UUnEVUqc6/1VMmR1cvZryZ3j3NzapC2eUXO1dB0sYp5mvwdjiXhpUbRb21eFow3qSxpP8Yv6oAU824Q==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.23.0",
|
||||
"react-router": "6.30.1"
|
||||
"@remix-run/router": "1.23.1",
|
||||
"react-router": "6.30.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -24608,13 +24642,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/redux-saga": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/redux-saga/-/redux-saga-1.3.0.tgz",
|
||||
"integrity": "sha512-J9RvCeAZXSTAibFY0kGw6Iy4EdyDNW7k6Q+liwX+bsck7QVsU78zz8vpBRweEfANxnnlG/xGGeOvf6r8UXzNJQ==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/redux-saga/-/redux-saga-1.4.2.tgz",
|
||||
"integrity": "sha512-QLIn/q+7MX/B+MkGJ/K6R3//60eJ4QNy65eqPsJrfGezbxdh1Jx+37VRKE2K4PsJnNET5JufJtgWdT30WBa+6w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@redux-saga/core": "^1.3.0"
|
||||
"@redux-saga/core": "^1.4.2"
|
||||
}
|
||||
},
|
||||
"node_modules/reflect.getprototypeof": {
|
||||
@@ -26885,9 +26919,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ts-jest": {
|
||||
"version": "29.4.4",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.4.tgz",
|
||||
"integrity": "sha512-ccVcRABct5ZELCT5U0+DZwkXMCcOCLi2doHRrKy1nK/s7J7bch6TzJMsrY09WxgUUIP/ITfmcDS8D2yl63rnXw==",
|
||||
"version": "29.4.6",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz",
|
||||
"integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -26898,7 +26932,7 @@
|
||||
"json5": "^2.2.3",
|
||||
"lodash.memoize": "^4.1.2",
|
||||
"make-error": "^1.3.6",
|
||||
"semver": "^7.7.2",
|
||||
"semver": "^7.7.3",
|
||||
"type-fest": "^4.41.0",
|
||||
"yargs-parser": "^21.1.1"
|
||||
},
|
||||
@@ -26939,9 +26973,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ts-jest/node_modules/semver": {
|
||||
"version": "7.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
|
||||
"integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
|
||||
"version": "7.7.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
||||
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-redux": "^8.1.1",
|
||||
"react-router-dom": "6.30.1",
|
||||
"react-router-dom": "6.30.2",
|
||||
"react-test-renderer": "^18.3.1",
|
||||
"redux": "4.2.1",
|
||||
"redux-saga": "1.3.0",
|
||||
"redux-saga": "1.4.2",
|
||||
"ts-jest": "^29.4.4"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -24,3 +24,6 @@
|
||||
* [`org.openedx.frontend.layout.header_mobile_main_menu.v1`](./MobileMainMenuSlot/)
|
||||
* [`org.openedx.frontend.layout.header_mobile_user_menu.v1`](./MobileUserMenuSlot/)
|
||||
* [`org.openedx.frontend.layout.header_mobile_user_menu_trigger.v1`](./MobileUserMenuToggleSlot/)
|
||||
|
||||
### Studio Header
|
||||
* [`org.openedx.frontend.layout.studio_header_search_button_slot.v1`](./StudioHeaderSearchButtonSlot/)
|
||||
|
||||
89
src/plugin-slots/StudioHeaderSearchButtonSlot/README.md
Normal file
89
src/plugin-slots/StudioHeaderSearchButtonSlot/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Studio Header Search Button Slot
|
||||
|
||||
### Slot ID: `org.openedx.frontend.layout.studio_header_search_button_slot.v1`
|
||||
|
||||
## Description
|
||||
|
||||
This slot is used to replace/modify/hide the search button in the studio header.
|
||||
|
||||
## Examples
|
||||
|
||||
### Replace search with custom component
|
||||
|
||||
The following `env.config.jsx` will replace the search button entirely (in this case with a custom emoji icon):
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import {
|
||||
DIRECT_PLUGIN,
|
||||
PLUGIN_OPERATIONS,
|
||||
} from "@openedx/frontend-plugin-framework";
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
"org.openedx.frontend.layout.studio_header_search_button_slot.v1": {
|
||||
keepDefault: false,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
id: "custom_notification_tray",
|
||||
type: DIRECT_PLUGIN,
|
||||
RenderWidget: () => <span>🔔</span>,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
||||
### Add custom component before and after search button
|
||||
|
||||
The following `env.config.jsx` will insert emoji after and before the search button
|
||||
|
||||

|
||||
|
||||
```jsx
|
||||
import {
|
||||
DIRECT_PLUGIN,
|
||||
PLUGIN_OPERATIONS,
|
||||
} from "@openedx/frontend-plugin-framework";
|
||||
|
||||
const config = {
|
||||
pluginSlots: {
|
||||
"org.openedx.frontend.layout.studio_header_search_button_slot.v1": {
|
||||
keepDefault: true,
|
||||
plugins: [
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
priority: 10,
|
||||
id: 'custom_notification_tray_before',
|
||||
type: DIRECT_PLUGIN,
|
||||
RenderWidget: () => <span>🔔</span>,
|
||||
},
|
||||
},
|
||||
{
|
||||
op: PLUGIN_OPERATIONS.Insert,
|
||||
widget: {
|
||||
priority: 90,
|
||||
id: 'custom_notification_tray_after',
|
||||
type: DIRECT_PLUGIN,
|
||||
RenderWidget: () => <span>🔕</span>,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- **Slot ID:** `org.openedx.frontend.layout.studio_header_search_button_slot.v1`
|
||||
- **Component:** Uses the [PluginSlot](https://github.com/openedx/frontend-plugin-framework#pluginslot) from the Open edX Frontend Plugin Framework for plugin injection.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
34
src/plugin-slots/StudioHeaderSearchButtonSlot/index.jsx
Normal file
34
src/plugin-slots/StudioHeaderSearchButtonSlot/index.jsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
||||
import { Nav, IconButton, Icon } from '@openedx/paragon';
|
||||
import { Search } from '@openedx/paragon/icons';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import messages from '../../studio-header/messages';
|
||||
|
||||
const StudioHeaderSearchButtonSlot = ({ searchButtonAction }) => {
|
||||
const intl = useIntl();
|
||||
return (
|
||||
<PluginSlot
|
||||
id="org.openedx.frontend.layout.studio_header_search_button_slot.v1"
|
||||
>
|
||||
{searchButtonAction && (
|
||||
<Nav>
|
||||
<IconButton
|
||||
src={Search}
|
||||
iconAs={Icon}
|
||||
onClick={searchButtonAction}
|
||||
aria-label={intl.formatMessage(messages['header.label.search.nav'])}
|
||||
alt={intl.formatMessage(messages['header.label.search.nav'])}
|
||||
/>
|
||||
</Nav>
|
||||
)}
|
||||
</PluginSlot>
|
||||
);
|
||||
};
|
||||
|
||||
StudioHeaderSearchButtonSlot.propTypes = {
|
||||
searchButtonAction: PropTypes.func,
|
||||
};
|
||||
|
||||
export default StudioHeaderSearchButtonSlot;
|
||||
@@ -1,8 +1,13 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { type FunctionComponent } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
const BrandNav = ({
|
||||
interface Props {
|
||||
studioBaseUrl: string;
|
||||
logo: string;
|
||||
logoAltText: string;
|
||||
}
|
||||
|
||||
const BrandNav: FunctionComponent<Props> = ({
|
||||
studioBaseUrl,
|
||||
logo,
|
||||
logoAltText,
|
||||
@@ -16,10 +21,4 @@ const BrandNav = ({
|
||||
</Link>
|
||||
);
|
||||
|
||||
BrandNav.propTypes = {
|
||||
studioBaseUrl: PropTypes.string.isRequired,
|
||||
logo: PropTypes.string.isRequired,
|
||||
logoAltText: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default BrandNav;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { type FunctionComponent } from 'react';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import {
|
||||
OverlayTrigger,
|
||||
@@ -9,14 +8,19 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import messages from './messages';
|
||||
|
||||
const CourseLockUp = (
|
||||
{
|
||||
outlineLink,
|
||||
org,
|
||||
number,
|
||||
title,
|
||||
},
|
||||
) => {
|
||||
interface Props {
|
||||
outlineLink?: string;
|
||||
org?: string;
|
||||
number?: string;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
const CourseLockUp: FunctionComponent<Props> = ({
|
||||
outlineLink = '',
|
||||
org = '',
|
||||
number = '',
|
||||
title = '',
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
@@ -41,18 +45,4 @@ const CourseLockUp = (
|
||||
);
|
||||
};
|
||||
|
||||
CourseLockUp.propTypes = {
|
||||
number: PropTypes.string,
|
||||
org: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
outlineLink: PropTypes.string,
|
||||
};
|
||||
|
||||
CourseLockUp.defaultProps = {
|
||||
number: null,
|
||||
org: null,
|
||||
title: null,
|
||||
outlineLink: null,
|
||||
};
|
||||
|
||||
export default CourseLockUp;
|
||||
|
||||
@@ -1,23 +1,45 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIntl } from '@edx/frontend-platform/i18n';
|
||||
import React, { type ReactNode, type ComponentProps } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
ActionRow,
|
||||
Button,
|
||||
Container,
|
||||
Icon,
|
||||
IconButton,
|
||||
Nav,
|
||||
Row,
|
||||
} from '@openedx/paragon';
|
||||
import { Close, MenuIcon, Search } from '@openedx/paragon/icons';
|
||||
import { Close, MenuIcon } from '@openedx/paragon/icons';
|
||||
|
||||
import CourseLockUp from './CourseLockUp';
|
||||
import UserMenu from './UserMenu';
|
||||
import BrandNav from './BrandNav';
|
||||
import NavDropdownMenu from './NavDropdownMenu';
|
||||
import messages from './messages';
|
||||
import StudioHeaderSearchButtonSlot from '../plugin-slots/StudioHeaderSearchButtonSlot';
|
||||
|
||||
export interface HeaderBodyProps {
|
||||
studioBaseUrl: string;
|
||||
logoutUrl: string;
|
||||
setModalPopupTarget?: ((instance: HTMLButtonElement | null) => void) | null;
|
||||
toggleModalPopup?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
isModalPopupOpen?: boolean;
|
||||
number?: string;
|
||||
org?: string;
|
||||
title: string;
|
||||
logo: string;
|
||||
logoAltText: string;
|
||||
authenticatedUserAvatar?: string;
|
||||
username?: string;
|
||||
isAdmin?: boolean;
|
||||
isMobile?: boolean;
|
||||
isHiddenMainMenu?: boolean;
|
||||
mainMenuDropdowns?: {
|
||||
id: string;
|
||||
buttonTitle: ReactNode;
|
||||
items: { title: ReactNode; href: string; }[];
|
||||
}[];
|
||||
outlineLink?: string;
|
||||
searchButtonAction?: React.MouseEventHandler<HTMLButtonElement>;
|
||||
containerProps?: Omit<ComponentProps<typeof Container>, 'children'>;
|
||||
}
|
||||
|
||||
const HeaderBody = ({
|
||||
logo,
|
||||
@@ -31,16 +53,15 @@ const HeaderBody = ({
|
||||
logoutUrl,
|
||||
authenticatedUserAvatar,
|
||||
isMobile,
|
||||
setModalPopupTarget,
|
||||
setModalPopupTarget = null,
|
||||
toggleModalPopup,
|
||||
isModalPopupOpen,
|
||||
isHiddenMainMenu,
|
||||
mainMenuDropdowns,
|
||||
isModalPopupOpen = false,
|
||||
isHiddenMainMenu = false,
|
||||
mainMenuDropdowns = [],
|
||||
outlineLink,
|
||||
searchButtonAction,
|
||||
containerProps,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
containerProps = {},
|
||||
}: HeaderBodyProps) => {
|
||||
|
||||
const renderBrandNav = (
|
||||
<BrandNav
|
||||
@@ -52,7 +73,7 @@ const HeaderBody = ({
|
||||
/>
|
||||
);
|
||||
|
||||
const { className: containerClassName, ...restContainerProps } = containerProps || {};
|
||||
const { className: containerClassName, ...restContainerProps } = containerProps;
|
||||
|
||||
return (
|
||||
<Container
|
||||
@@ -116,17 +137,9 @@ const HeaderBody = ({
|
||||
</>
|
||||
)}
|
||||
<ActionRow.Spacer />
|
||||
{searchButtonAction && (
|
||||
<Nav>
|
||||
<IconButton
|
||||
src={Search}
|
||||
iconAs={Icon}
|
||||
onClick={searchButtonAction}
|
||||
aria-label={intl.formatMessage(messages['header.label.search.nav'])}
|
||||
alt={intl.formatMessage(messages['header.label.search.nav'])}
|
||||
/>
|
||||
</Nav>
|
||||
)}
|
||||
<StudioHeaderSearchButtonSlot
|
||||
searchButtonAction={searchButtonAction}
|
||||
/>
|
||||
<Nav>
|
||||
<UserMenu
|
||||
{...{
|
||||
@@ -144,53 +157,4 @@ const HeaderBody = ({
|
||||
);
|
||||
};
|
||||
|
||||
HeaderBody.propTypes = {
|
||||
studioBaseUrl: PropTypes.string.isRequired,
|
||||
logoutUrl: PropTypes.string.isRequired,
|
||||
setModalPopupTarget: PropTypes.func,
|
||||
toggleModalPopup: PropTypes.func,
|
||||
isModalPopupOpen: PropTypes.bool,
|
||||
number: PropTypes.string,
|
||||
org: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
logo: PropTypes.string,
|
||||
logoAltText: PropTypes.string,
|
||||
authenticatedUserAvatar: PropTypes.string,
|
||||
username: PropTypes.string,
|
||||
isAdmin: PropTypes.bool,
|
||||
isMobile: PropTypes.bool,
|
||||
isHiddenMainMenu: PropTypes.bool,
|
||||
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
buttonTitle: PropTypes.node,
|
||||
items: PropTypes.arrayOf(PropTypes.shape({
|
||||
href: PropTypes.string,
|
||||
title: PropTypes.node,
|
||||
})),
|
||||
})),
|
||||
outlineLink: PropTypes.string,
|
||||
searchButtonAction: PropTypes.func,
|
||||
containerProps: PropTypes.shape(Container.propTypes),
|
||||
};
|
||||
|
||||
HeaderBody.defaultProps = {
|
||||
setModalPopupTarget: null,
|
||||
toggleModalPopup: null,
|
||||
isModalPopupOpen: false,
|
||||
logo: null,
|
||||
logoAltText: null,
|
||||
number: '',
|
||||
org: '',
|
||||
title: '',
|
||||
authenticatedUserAvatar: null,
|
||||
username: null,
|
||||
isAdmin: false,
|
||||
isMobile: false,
|
||||
isHiddenMainMenu: false,
|
||||
mainMenuDropdowns: [],
|
||||
outlineLink: null,
|
||||
searchButtonAction: null,
|
||||
containerProps: {},
|
||||
};
|
||||
|
||||
export default HeaderBody;
|
||||
|
||||
@@ -1,19 +1,32 @@
|
||||
import React, { useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { type FunctionComponent, useState } from 'react';
|
||||
import { useToggle, ModalPopup } from '@openedx/paragon';
|
||||
import HeaderBody from './HeaderBody';
|
||||
import HeaderBody, { type HeaderBodyProps } from './HeaderBody';
|
||||
import MobileMenu from './MobileMenu';
|
||||
|
||||
const MobileHeader = ({
|
||||
type Props = Pick<HeaderBodyProps,
|
||||
| 'studioBaseUrl'
|
||||
| 'logoutUrl'
|
||||
| 'number'
|
||||
| 'org'
|
||||
| 'title'
|
||||
| 'logo'
|
||||
| 'logoAltText'
|
||||
| 'authenticatedUserAvatar'
|
||||
| 'username'
|
||||
| 'isAdmin'
|
||||
| 'mainMenuDropdowns'
|
||||
| 'outlineLink'
|
||||
>;
|
||||
|
||||
const MobileHeader: FunctionComponent<Props> = ({
|
||||
mainMenuDropdowns,
|
||||
...props
|
||||
}) => {
|
||||
const [isOpen, , close, toggle] = useToggle(false);
|
||||
const [target, setTarget] = useState(null);
|
||||
const [target, setTarget] = useState<HTMLButtonElement | null>(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* @ts-expect-error The type of 'props' is any until we convert from propTypes to TypeScript interface/types */}
|
||||
<HeaderBody
|
||||
{...props}
|
||||
isMobile
|
||||
@@ -36,39 +49,4 @@ const MobileHeader = ({
|
||||
);
|
||||
};
|
||||
|
||||
MobileHeader.propTypes = {
|
||||
studioBaseUrl: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
|
||||
logoutUrl: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
|
||||
number: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
org: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
title: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
logo: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
logoAltText: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
authenticatedUserAvatar: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
username: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
isAdmin: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
|
||||
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
buttonTitle: PropTypes.node,
|
||||
items: PropTypes.arrayOf(PropTypes.shape({
|
||||
href: PropTypes.string,
|
||||
title: PropTypes.node,
|
||||
})),
|
||||
})),
|
||||
outlineLink: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
|
||||
};
|
||||
|
||||
MobileHeader.defaultProps = {
|
||||
logo: null,
|
||||
logoAltText: null,
|
||||
number: null,
|
||||
org: null,
|
||||
title: null,
|
||||
authenticatedUserAvatar: null,
|
||||
username: null,
|
||||
isAdmin: false,
|
||||
mainMenuDropdowns: [],
|
||||
outlineLink: null,
|
||||
};
|
||||
|
||||
export default MobileHeader;
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { type ReactNode } from 'react';
|
||||
import {
|
||||
Dropdown,
|
||||
DropdownButton,
|
||||
} from '@openedx/paragon';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
interface Props {
|
||||
id: string;
|
||||
buttonTitle: ReactNode;
|
||||
items: { title: ReactNode; href: string; }[];
|
||||
}
|
||||
|
||||
const NavDropdownMenu = ({
|
||||
id,
|
||||
buttonTitle,
|
||||
items,
|
||||
}) => (
|
||||
}: Props) => (
|
||||
<DropdownButton
|
||||
id={id}
|
||||
title={buttonTitle}
|
||||
@@ -30,13 +35,4 @@ const NavDropdownMenu = ({
|
||||
</DropdownButton>
|
||||
);
|
||||
|
||||
NavDropdownMenu.propTypes = {
|
||||
id: PropTypes.string.isRequired,
|
||||
buttonTitle: PropTypes.node.isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.shape({
|
||||
href: PropTypes.string.isRequired,
|
||||
title: PropTypes.node.isRequired,
|
||||
})).isRequired,
|
||||
};
|
||||
|
||||
export default NavDropdownMenu;
|
||||
|
||||
@@ -71,12 +71,8 @@ const props: React.ComponentProps<typeof StudioHeader> = {
|
||||
},
|
||||
],
|
||||
outlineLink: 'tEsTLInK',
|
||||
searchButtonAction: null,
|
||||
searchButtonAction: undefined,
|
||||
isNewHomePage: true,
|
||||
// These default values shouldn't be needed but typescript is confused by propTypes; can remove after converting
|
||||
// from propTypes to TypeScript:
|
||||
containerProps: {},
|
||||
isHiddenMainMenu: false,
|
||||
};
|
||||
|
||||
describe('Header', () => {
|
||||
@@ -146,7 +142,7 @@ describe('Header', () => {
|
||||
});
|
||||
|
||||
it('should not show search button', async () => {
|
||||
const testProps = { ...props, searchButtonAction: null };
|
||||
const testProps = { ...props, searchButtonAction: undefined };
|
||||
const { queryByRole } = render(<RootWrapper {...testProps} />);
|
||||
expect(queryByRole('button', { name: 'Search content' })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React, { useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { type FunctionComponent, useContext } from 'react';
|
||||
import Responsive from 'react-responsive';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
import { ensureConfig } from '@edx/frontend-platform';
|
||||
|
||||
import MobileHeader from './MobileHeader';
|
||||
import HeaderBody from './HeaderBody';
|
||||
import HeaderBody, { HeaderBodyProps } from './HeaderBody';
|
||||
|
||||
ensureConfig([
|
||||
'STUDIO_BASE_URL',
|
||||
@@ -15,9 +14,29 @@ ensureConfig([
|
||||
'LOGO_URL',
|
||||
], 'Studio Header component');
|
||||
|
||||
const StudioHeader = ({
|
||||
number, org, title, containerProps, isHiddenMainMenu, mainMenuDropdowns,
|
||||
outlineLink, searchButtonAction, isNewHomePage,
|
||||
type Props = Pick<HeaderBodyProps,
|
||||
| 'number'
|
||||
| 'org'
|
||||
| 'title'
|
||||
| 'containerProps'
|
||||
| 'isHiddenMainMenu'
|
||||
| 'mainMenuDropdowns'
|
||||
| 'outlineLink'
|
||||
| 'searchButtonAction'
|
||||
> & {
|
||||
isNewHomePage: boolean;
|
||||
};
|
||||
|
||||
const StudioHeader: FunctionComponent<Props> = ({
|
||||
number,
|
||||
org,
|
||||
title,
|
||||
containerProps,
|
||||
isHiddenMainMenu,
|
||||
mainMenuDropdowns,
|
||||
outlineLink,
|
||||
searchButtonAction,
|
||||
isNewHomePage,
|
||||
}) => {
|
||||
// @ts-expect-error - frontend-platform doesn't yet have type information :/
|
||||
const { authenticatedUser, config } = useContext(AppContext);
|
||||
@@ -52,33 +71,4 @@ const StudioHeader = ({
|
||||
);
|
||||
};
|
||||
|
||||
StudioHeader.propTypes = {
|
||||
number: PropTypes.string,
|
||||
org: PropTypes.string,
|
||||
title: PropTypes.string.isRequired,
|
||||
containerProps: HeaderBody.propTypes.containerProps,
|
||||
isHiddenMainMenu: PropTypes.bool,
|
||||
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
buttonTitle: PropTypes.node,
|
||||
items: PropTypes.arrayOf(PropTypes.shape({
|
||||
href: PropTypes.string,
|
||||
title: PropTypes.node,
|
||||
})),
|
||||
})),
|
||||
outlineLink: PropTypes.string,
|
||||
searchButtonAction: PropTypes.func,
|
||||
isNewHomePage: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
StudioHeader.defaultProps = {
|
||||
number: '',
|
||||
org: '',
|
||||
containerProps: {},
|
||||
isHiddenMainMenu: false,
|
||||
mainMenuDropdowns: [],
|
||||
outlineLink: null,
|
||||
searchButtonAction: null,
|
||||
};
|
||||
|
||||
export default StudioHeader;
|
||||
|
||||
Reference in New Issue
Block a user