From e63b51d80bc3e616f09b3876abafb46fdf28e754 Mon Sep 17 00:00:00 2001 From: fabiodmota <107047355+fabiodmota@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:29:46 +0000 Subject: [PATCH] feat(trg-7.06): add about page (#65) TRG 7.06 - Legal notice for end user content --- .github/workflows/build.yml | 11 + .github/workflows/docker-hub-build.yml | 8 + CHANGELOG.md | 5 + DEPENDENCIES | 33 +- package-lock.json | 432 ++++++++++++++++-- package.json | 25 +- public/index.html | 2 +- public/orange-background-full.svg.license | 5 + public/orange-background-head.svg.license | 5 + scripts/inject-dynamic-env.sh | 9 +- scripts/legal-notice.sh | 80 ++++ src/App.js | 25 +- .../dashboard/AboutCard/AboutPage.js | 39 ++ src/components/dashboard/AboutCard/about.scss | 74 +++ src/components/dashboard/Footer/Constants.js | 221 +++++++++ src/components/dashboard/Footer/Footer.js | 56 --- src/components/dashboard/Footer/Footer.scss | 59 +++ .../dashboard/Footer/FooterPortal.js | 85 ++++ .../Footer/orange-background-full.svg | 9 + .../Footer/orange-background-head.svg | 13 + src/components/dashboard/Footer/styles.scss | 25 - .../dashboard/NavigationBar/NavigationBar.js | 3 +- .../NavigationBar/UserInformation/UserInfo.js | 27 +- .../PageBreadCrumb/PageBreadcrumb.js | 105 +++++ .../dashboard/PageBreadCrumb/styles.scss | 19 + src/components/services/EnvironmentService.js | 4 + src/legal-notice.json | 9 + 27 files changed, 1239 insertions(+), 149 deletions(-) create mode 100644 public/orange-background-full.svg.license create mode 100644 public/orange-background-head.svg.license create mode 100644 scripts/legal-notice.sh create mode 100644 src/components/dashboard/AboutCard/AboutPage.js create mode 100644 src/components/dashboard/AboutCard/about.scss create mode 100644 src/components/dashboard/Footer/Constants.js delete mode 100644 src/components/dashboard/Footer/Footer.js create mode 100644 src/components/dashboard/Footer/Footer.scss create mode 100644 src/components/dashboard/Footer/FooterPortal.js create mode 100644 src/components/dashboard/Footer/orange-background-full.svg create mode 100644 src/components/dashboard/Footer/orange-background-head.svg delete mode 100644 src/components/dashboard/Footer/styles.scss create mode 100644 src/components/dashboard/PageBreadCrumb/PageBreadcrumb.js create mode 100644 src/components/dashboard/PageBreadCrumb/styles.scss create mode 100644 src/legal-notice.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f89ccad7..481ae114 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,19 @@ on: tags: - "v*.*.*" - "v*.*.*-*" + workflow_dispatch: + # Trigger manually + env: # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io # github.repository as / IMAGE_NAME: ${{ github.repository }} + # variables needed for scripts/legal-notice.sh + SERVER_URL: "${{ github.server_url }}" + REPOSITORY: "${{ github.repository }}" + REF_NAME: "${{ github.ref_name }}" + jobs: docker: runs-on: ubuntu-latest @@ -26,6 +34,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add content to Legal Notice + run: npm run build:legal-notice + # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf diff --git a/.github/workflows/docker-hub-build.yml b/.github/workflows/docker-hub-build.yml index 0539742b..1caa0cf2 100644 --- a/.github/workflows/docker-hub-build.yml +++ b/.github/workflows/docker-hub-build.yml @@ -17,6 +17,11 @@ on: env: IMAGE_NAMESPACE: "tractusx" IMAGE_NAME: "vas-country-risk" + # variables needed for scripts/legal-notice.sh + SERVER_URL: "${{ github.server_url }}" + REPOSITORY: "${{ github.repository }}" + REF_NAME: "${{ github.ref_name }}" + jobs: docker: @@ -28,6 +33,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add content to Legal Notice + run: npm run build:legal-notice + # Create SemVer or ref tags dependent of trigger event - name: Docker meta id: meta diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f04eed8..0fd75a11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.0] - 2023-12-06 + +### Added +- Added About Page for Legal notice for end user content + ## [1.2.1] - 2023-11-28 ### Changed diff --git a/DEPENDENCIES b/DEPENDENCIES index 2cc47127..206cade4 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -87,6 +87,7 @@ npm/npmjs/-/browserslist/4.22.1, MIT, approved, #10780 npm/npmjs/-/bser/2.1.1, Apache-2.0, approved, clearlydefined npm/npmjs/-/btoa/1.2.1, Apache-2.0 AND CC-BY-3.0 AND (Apache-2.0 OR MIT), approved, #3482 npm/npmjs/-/buffer-from/1.1.2, MIT, approved, clearlydefined +npm/npmjs/-/buffer/6.0.3, MIT, approved, clearlydefined npm/npmjs/-/builtin-modules/3.3.0, MIT, approved, clearlydefined npm/npmjs/-/bytes/3.0.0, MIT, approved, clearlydefined npm/npmjs/-/bytes/3.1.2, MIT, approved, clearlydefined @@ -199,6 +200,7 @@ npm/npmjs/-/d3-zoom/3.0.0, ISC, approved, clearlydefined npm/npmjs/-/damerau-levenshtein/1.0.8, BSD-2-Clause, approved, clearlydefined npm/npmjs/-/data-urls/2.0.0, MIT, approved, clearlydefined npm/npmjs/-/data-urls/4.0.0, MIT, approved, clearlydefined +npm/npmjs/-/date-fns/2.30.0, MIT, approved, clearlydefined npm/npmjs/-/debug/2.6.9, MIT, approved, clearlydefined npm/npmjs/-/debug/3.2.7, MIT, approved, clearlydefined npm/npmjs/-/debug/4.3.4, MIT, approved, clearlydefined @@ -395,6 +397,7 @@ npm/npmjs/-/html-encoding-sniffer/3.0.0, MIT, approved, clearlydefined npm/npmjs/-/html-entities/2.4.0, MIT, approved, clearlydefined npm/npmjs/-/html-escaper/2.0.2, MIT, approved, clearlydefined npm/npmjs/-/html-minifier-terser/6.1.0, MIT AND MPL-1.1, approved, #2968 +npm/npmjs/-/html-parse-stringify/3.0.1, MIT, approved, clearlydefined npm/npmjs/-/html-to-image/1.11.11, MIT, approved, #8396 npm/npmjs/-/html-webpack-plugin/5.5.3, MIT, approved, #9078 npm/npmjs/-/html2canvas/1.4.1, MIT AND (0BSD AND MIT) AND 0BSD, approved, #3481 @@ -410,11 +413,13 @@ npm/npmjs/-/http-proxy-middleware/2.0.6, MIT, approved, clearlydefined npm/npmjs/-/http-proxy/1.18.1, MIT, approved, clearlydefined npm/npmjs/-/https-proxy-agent/5.0.1, MIT, approved, clearlydefined npm/npmjs/-/human-signals/2.1.0, Apache-2.0, approved, clearlydefined +npm/npmjs/-/i18next/20.3.1, MIT, approved, clearlydefined npm/npmjs/-/iconv-lite/0.4.24, MIT, approved, clearlydefined npm/npmjs/-/iconv-lite/0.6.3, MIT, approved, clearlydefined npm/npmjs/-/icss-utils/5.1.0, ISC, approved, clearlydefined npm/npmjs/-/idb/7.1.1, ISC, approved, clearlydefined npm/npmjs/-/identity-obj-proxy/3.0.0, MIT, approved, clearlydefined +npm/npmjs/-/ieee754/1.2.1, BSD-3-Clause, approved, clearlydefined npm/npmjs/-/ignore/5.3.0, MIT, approved, #11665 npm/npmjs/-/immer/9.0.21, MIT, approved, #7037 npm/npmjs/-/immutable/4.3.4, MIT, approved, #7353 @@ -583,6 +588,7 @@ npm/npmjs/-/levn/0.4.1, MIT, approved, clearlydefined npm/npmjs/-/lilconfig/2.1.0, MIT, approved, #7313 npm/npmjs/-/lilconfig/3.0.0, MIT, approved, #11668 npm/npmjs/-/lines-and-columns/1.2.4, MIT, approved, clearlydefined +npm/npmjs/-/load-script/1.0.0, MIT, approved, clearlydefined npm/npmjs/-/loader-runner/4.3.0, MIT, approved, clearlydefined npm/npmjs/-/loader-utils/2.0.4, MIT, approved, #4986 npm/npmjs/-/loader-utils/3.2.1, MIT, approved, clearlydefined @@ -613,6 +619,7 @@ npm/npmjs/-/mdn-data/2.0.28, CC0-1.0, approved, clearlydefined npm/npmjs/-/mdn-data/2.0.30, CC0-1.0, approved, clearlydefined npm/npmjs/-/media-typer/0.3.0, MIT, approved, clearlydefined npm/npmjs/-/memfs/3.5.3, Unlicense, approved, #8397 +npm/npmjs/-/memoize-one/5.2.1, MIT, approved, clearlydefined npm/npmjs/-/merge-descriptors/1.0.1, MIT, approved, clearlydefined npm/npmjs/-/merge-stream/2.0.0, MIT, approved, clearlydefined npm/npmjs/-/merge2/1.4.1, MIT, approved, clearlydefined @@ -692,6 +699,7 @@ npm/npmjs/-/path-parse/1.0.7, MIT, approved, clearlydefined npm/npmjs/-/path-to-regexp/0.1.7, MIT, approved, clearlydefined npm/npmjs/-/path-type/4.0.0, MIT, approved, clearlydefined npm/npmjs/-/performance-now/2.1.0, MIT, approved, clearlydefined +npm/npmjs/-/picocolors/0.2.1, ISC, approved, clearlydefined npm/npmjs/-/picocolors/1.0.0, ISC, approved, clearlydefined npm/npmjs/-/picomatch/2.3.1, MIT, approved, clearlydefined npm/npmjs/-/pify/2.3.0, MIT, approved, clearlydefined @@ -768,6 +776,7 @@ npm/npmjs/-/postcss-selector-parser/6.0.13, MIT, approved, #5056 npm/npmjs/-/postcss-svgo/5.1.0, MIT, approved, clearlydefined npm/npmjs/-/postcss-unique-selectors/5.1.1, MIT, approved, clearlydefined npm/npmjs/-/postcss-value-parser/4.2.0, MIT, approved, clearlydefined +npm/npmjs/-/postcss/7.0.39, MIT, approved, clearlydefined npm/npmjs/-/postcss/8.4.31, MIT, approved, #3545 npm/npmjs/-/prelude-ls/1.1.2, MIT, approved, clearlydefined npm/npmjs/-/prelude-ls/1.2.1, MIT, approved, clearlydefined @@ -798,10 +807,13 @@ npm/npmjs/-/react-app-polyfill/3.0.0, MIT, approved, clearlydefined npm/npmjs/-/react-dev-utils/12.0.1, MIT, approved, clearlydefined npm/npmjs/-/react-dom/18.2.0, MIT, approved, clearlydefined npm/npmjs/-/react-error-overlay/6.0.11, MIT, approved, clearlydefined +npm/npmjs/-/react-fast-compare/3.2.2, MIT, approved, clearlydefined +npm/npmjs/-/react-i18next/12.3.1, MIT, approved, clearlydefined npm/npmjs/-/react-is/16.13.1, MIT, approved, clearlydefined npm/npmjs/-/react-is/17.0.2, MIT, approved, clearlydefined npm/npmjs/-/react-is/18.2.0, MIT, approved, clearlydefined npm/npmjs/-/react-path-tooltip/1.0.25, MIT, approved, #5384 +npm/npmjs/-/react-player/2.13.0, MIT, approved, #10673 npm/npmjs/-/react-redux/7.2.9, MIT, approved, #2978 npm/npmjs/-/react-refresh/0.11.0, MIT, approved, clearlydefined npm/npmjs/-/react-router-dom/6.14.1, MIT, approved, #9432 @@ -810,6 +822,7 @@ npm/npmjs/-/react-scripts/5.0.1, MIT, approved, clearlydefined npm/npmjs/-/react-shallow-renderer/16.15.0, MIT, approved, clearlydefined npm/npmjs/-/react-simple-maps/3.0.0, MIT, approved, clearlydefined npm/npmjs/-/react-slick/0.28.1, MIT, approved, clearlydefined +npm/npmjs/-/react-slick/0.29.0, MIT, approved, clearlydefined npm/npmjs/-/react-svg-worldmap/2.0.0-alpha.16, MIT, approved, #5382 npm/npmjs/-/react-test-renderer/18.2.0, MIT, approved, clearlydefined npm/npmjs/-/react-tooltip/4.2.21, MIT, approved, clearlydefined @@ -1022,6 +1035,7 @@ npm/npmjs/-/uuid/8.3.2, MIT AND (BSD-3-Clause AND MIT), approved, #2438 npm/npmjs/-/v8-to-istanbul/8.1.1, ISC, approved, clearlydefined npm/npmjs/-/v8-to-istanbul/9.1.3, ISC, approved, clearlydefined npm/npmjs/-/vary/1.1.2, MIT, approved, clearlydefined +npm/npmjs/-/void-elements/3.1.0, MIT, approved, clearlydefined npm/npmjs/-/w3c-hr-time/1.0.2, MIT, approved, clearlydefined npm/npmjs/-/w3c-xmlserializer/2.0.0, MIT, approved, clearlydefined npm/npmjs/-/w3c-xmlserializer/4.0.0, MIT, approved, clearlydefined @@ -1228,6 +1242,7 @@ npm/npmjs/@babel/template/7.22.15, MIT, approved, #9017 npm/npmjs/@babel/traverse/7.23.4, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #11520 npm/npmjs/@babel/types/7.23.4, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #11521 npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined +npm/npmjs/@catena-x/portal-shared-components/2.1.3, Apache-2.0 AND CC-BY-4.0, approved, #10502 npm/npmjs/@csstools/normalize.css/12.0.0, CC0-1.0, approved, clearlydefined npm/npmjs/@csstools/postcss-cascade-layers/1.1.1, CC0-1.0, approved, clearlydefined npm/npmjs/@csstools/postcss-color-function/1.1.1, CC0-1.0 AND (MIT AND W3C-20150513) AND W3C-20150513 AND MIT, approved, #3022 @@ -1260,6 +1275,10 @@ npm/npmjs/@emotion/weak-memoize/0.3.1, MIT, approved, #8402 npm/npmjs/@eslint-community/eslint-utils/4.4.0, MIT, approved, #8032 npm/npmjs/@eslint-community/regexpp/4.10.0, MIT, approved, clearlydefined npm/npmjs/@eslint/eslintrc/1.4.1, MIT, approved, #5909 +npm/npmjs/@floating-ui/core/1.5.1, MIT AND ISC AND (CC-BY-4.0 AND MIT), approved, #10887 +npm/npmjs/@floating-ui/dom/1.5.3, MIT, approved, #9893 +npm/npmjs/@floating-ui/react-dom/2.0.4, MIT, approved, clearlydefined +npm/npmjs/@floating-ui/utils/0.1.6, MIT, approved, #9887 npm/npmjs/@humanwhocodes/config-array/0.11.13, Apache-2.0, approved, #5876 npm/npmjs/@humanwhocodes/module-importer/1.0.1, Apache-2.0, approved, clearlydefined npm/npmjs/@humanwhocodes/object-schema/2.0.1, BSD-3-Clause, approved, clearlydefined @@ -1302,15 +1321,17 @@ npm/npmjs/@jridgewell/sourcemap-codec/1.4.15, MIT, approved, clearlydefined npm/npmjs/@jridgewell/trace-mapping/0.3.20, MIT, approved, #9904 npm/npmjs/@leichtgewicht/ip-codec/2.0.4, MIT, approved, clearlydefined npm/npmjs/@mui/base/5.0.0-alpha.99, MIT, approved, #2992 +npm/npmjs/@mui/base/5.0.0-beta.26, MIT, approved, #2992 npm/npmjs/@mui/core-downloads-tracker/5.14.18, MIT AND CC-BY-3.0, approved, #9895 npm/npmjs/@mui/icons-material/5.10.6, MIT, approved, #3245 npm/npmjs/@mui/material/5.10.7, MIT, approved, #3244 -npm/npmjs/@mui/private-theming/5.14.18, MIT, approved, #10973 -npm/npmjs/@mui/styled-engine/5.14.18, MIT, approved, #10971 -npm/npmjs/@mui/system/5.14.18, MIT AND CC-BY-3.0, approved, #9905 -npm/npmjs/@mui/types/7.2.9, MIT, approved, clearlydefined -npm/npmjs/@mui/utils/5.14.18, MIT AND CC-BY-3.0, approved, #9891 +npm/npmjs/@mui/private-theming/5.14.20, MIT, approved, #10973 +npm/npmjs/@mui/styled-engine/5.14.20, MIT, approved, #10971 +npm/npmjs/@mui/system/5.14.20, MIT AND CC-BY-3.0, approved, #9905 +npm/npmjs/@mui/types/7.2.5, MIT, approved, clearlydefined +npm/npmjs/@mui/utils/5.14.20, MIT AND CC-BY-3.0, approved, #9891 npm/npmjs/@mui/x-data-grid/5.17.26, MIT, approved, #3248 +npm/npmjs/@mui/x-date-pickers/6.16.1, MIT, approved, clearlydefined npm/npmjs/@nicolo-ribaudo/eslint-scope-5-internals/5.1.1-v1, MIT, approved, clearlydefined npm/npmjs/@nodelib/fs.scandir/2.1.5, MIT, approved, clearlydefined npm/npmjs/@nodelib/fs.stat/2.0.5, MIT, approved, clearlydefined @@ -1382,7 +1403,7 @@ npm/npmjs/@types/node-forge/1.3.9, MIT, approved, clearlydefined npm/npmjs/@types/node/20.9.2, MIT, approved, clearlydefined npm/npmjs/@types/parse-json/4.0.2, MIT, approved, clearlydefined npm/npmjs/@types/prettier/2.7.3, MIT, approved, #9030 -npm/npmjs/@types/prop-types/15.7.10, MIT, approved, clearlydefined +npm/npmjs/@types/prop-types/15.7.11, MIT, approved, clearlydefined npm/npmjs/@types/qs/6.9.10, MIT, approved, clearlydefined npm/npmjs/@types/raf/3.4.3, MIT, approved, clearlydefined npm/npmjs/@types/range-parser/1.2.7, MIT, approved, #10795 diff --git a/package-lock.json b/package-lock.json index 059aacd5..904c42f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,26 @@ { "name": "dashboard-app", - "version": "1.2.1", + "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dashboard-app", - "version": "1.2.1", + "version": "1.3.0", + "license": "Apache-2.0", "dependencies": { + "@catena-x/portal-shared-components": "2.1.3", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "5.10.6", - "@mui/material": "5.10.7", + "@mui/types": "7.2.5", + "@mui/x-data-grid": "5.17.26", "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "14.1.0", "@testing-library/user-event": "^14.5.1", "axios": "1.6.1", - "cx-portal-shared-components": "^0.4.5", + "buffer": "^6.0.3", + "cx-portal-shared-components": "0.4.5", "d3-fetch": "^3.0.1", "env-cmd": "^10.1.0", "enzyme": "^3.11.0", @@ -1847,6 +1851,67 @@ "version": "0.2.3", "license": "MIT" }, + "node_modules/@catena-x/portal-shared-components": { + "version": "2.1.3", + "license": "Apache-2.0", + "dependencies": { + "@mui/base": "^5.0.0-beta.3", + "@mui/system": "^5.13.2", + "@mui/x-data-grid": "^5.17.26", + "@mui/x-date-pickers": "^6.0.0", + "autosuggest-highlight": "^3.3.4", + "date-fns": "^2.30.0", + "i18next": "20.3.1", + "jquery": "^3.7.0", + "react-i18next": "^12.3.1", + "react-player": "^2.12.0", + "react-slick": "^0.29.0", + "slick-carousel": "^1.8.1" + }, + "peerDependencies": { + "@mui/icons-material": "^5.11.16", + "@mui/material": "^5.13.2", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } + }, + "node_modules/@catena-x/portal-shared-components/node_modules/@mui/base": { + "version": "5.0.0-beta.26", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@floating-ui/react-dom": "^2.0.4", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.20", + "@popperjs/core": "^2.11.8", + "clsx": "^2.0.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@catena-x/portal-shared-components/node_modules/clsx": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/@csstools/normalize.css": { "version": "12.0.0", "license": "CC0-1.0" @@ -2245,6 +2310,36 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.5.1", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.5.3", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.4.2", + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.0.4", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.5.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.1.6", + "license": "MIT" + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "license": "Apache-2.0", @@ -2949,6 +3044,7 @@ "node_modules/@mui/base": { "version": "5.0.0-alpha.99", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.19.0", "@emotion/is-prop-valid": "^1.2.0", @@ -2980,6 +3076,7 @@ "node_modules/@mui/core-downloads-tracker": { "version": "5.14.18", "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui" @@ -3012,6 +3109,7 @@ "node_modules/@mui/material": { "version": "5.10.7", "license": "MIT", + "peer": true, "dependencies": { "@babel/runtime": "^7.19.0", "@mui/base": "5.0.0-alpha.99", @@ -3053,11 +3151,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.14.18", - "license": "MIT", + "version": "5.14.20", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.14.20.tgz", + "integrity": "sha512-WV560e1vhs2IHCh0pgUaWHznrcrVoW9+cDCahU1VTkuwPokWVvb71ccWQ1f8Y3tRBPPcNkU2dChkkRJChLmQlQ==", "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/utils": "^5.14.18", + "@babel/runtime": "^7.23.4", + "@mui/utils": "^5.14.20", "prop-types": "^15.8.1" }, "engines": { @@ -3065,7 +3164,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -3078,10 +3177,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.14.18", - "license": "MIT", + "version": "5.14.20", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.14.20.tgz", + "integrity": "sha512-Vs4nGptd9wRslo9zeRkuWcZeIEp+oYbODy+fiZKqqr4CH1Gfi9fdP0Q1tGYk8OiJ2EPB/tZSAyOy62Hyp/iP7g==", "dependencies": { - "@babel/runtime": "^7.23.2", + "@babel/runtime": "^7.23.4", "@emotion/cache": "^11.11.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -3091,7 +3191,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.4.1", @@ -3108,14 +3208,15 @@ } }, "node_modules/@mui/system": { - "version": "5.14.18", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.23.2", - "@mui/private-theming": "^5.14.18", - "@mui/styled-engine": "^5.14.18", - "@mui/types": "^7.2.9", - "@mui/utils": "^5.14.18", + "version": "5.14.20", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.20.tgz", + "integrity": "sha512-jKOGtK4VfYZG5kdaryUHss4X6hzcfh0AihT8gmnkfqRtWP7xjY+vPaUhhuSeibE5sqA5wCtdY75z6ep9pxFnIg==", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@mui/private-theming": "^5.14.20", + "@mui/styled-engine": "^5.14.19", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.20", "clsx": "^2.0.0", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -3125,7 +3226,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@emotion/react": "^11.5.0", @@ -3147,13 +3248,14 @@ }, "node_modules/@mui/system/node_modules/clsx": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", "engines": { "node": ">=6" } }, "node_modules/@mui/types": { - "version": "7.2.9", + "version": "7.2.5", "license": "MIT", "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0" @@ -3165,11 +3267,11 @@ } }, "node_modules/@mui/utils": { - "version": "5.14.18", + "version": "5.14.20", "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.2", - "@types/prop-types": "^15.7.10", + "@babel/runtime": "^7.23.4", + "@types/prop-types": "^15.7.11", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -3178,7 +3280,7 @@ }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/mui" + "url": "https://opencollective.com/mui-org" }, "peerDependencies": { "@types/react": "^17.0.0 || ^18.0.0", @@ -3214,6 +3316,107 @@ "react-dom": "^17.0.2 || ^18.0.0" } }, + "node_modules/@mui/x-date-pickers": { + "version": "6.16.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.1", + "@mui/base": "^5.0.0-beta.17", + "@mui/utils": "^5.14.11", + "@types/react-transition-group": "^4.4.7", + "clsx": "^2.0.0", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@emotion/react": "^11.9.0", + "@emotion/styled": "^11.8.1", + "@mui/material": "^5.8.6", + "@mui/system": "^5.8.0", + "date-fns": "^2.25.0", + "date-fns-jalali": "^2.13.0-0", + "dayjs": "^1.10.7", + "luxon": "^3.0.2", + "moment": "^2.29.4", + "moment-hijri": "^2.1.2", + "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "date-fns": { + "optional": true + }, + "date-fns-jalali": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + }, + "moment-hijri": { + "optional": true + }, + "moment-jalaali": { + "optional": true + } + } + }, + "node_modules/@mui/x-date-pickers/node_modules/@mui/base": { + "version": "5.0.0-beta.26", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.4", + "@floating-ui/react-dom": "^2.0.4", + "@mui/types": "^7.2.10", + "@mui/utils": "^5.14.20", + "@popperjs/core": "^2.11.8", + "clsx": "^2.0.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/x-date-pickers/node_modules/clsx": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "version": "5.1.1-v1", "license": "MIT", @@ -3373,8 +3576,7 @@ }, "node_modules/@remix-run/router": { "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.7.1.tgz", - "integrity": "sha512-bgVQM4ZJ2u2CM8k1ey70o1ePFXsEzYVZoWghh6WjM8p59jQ7HxzbHW4SbnWFG7V9ig9chLawQxDTZ3xzOF8MkQ==", + "license": "MIT", "engines": { "node": ">=14" } @@ -4211,7 +4413,7 @@ "license": "MIT" }, "node_modules/@types/prop-types": { - "version": "15.7.10", + "version": "15.7.11", "license": "MIT" }, "node_modules/@types/qs": { @@ -5687,6 +5889,28 @@ "node": ">= 0.4.0" } }, + "node_modules/buffer": { + "version": "6.0.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "license": "MIT" @@ -6872,6 +7096,20 @@ "node": ">=14" } }, + "node_modules/date-fns": { + "version": "2.30.0", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/debug": { "version": "4.3.4", "license": "MIT", @@ -7152,6 +7390,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "deprecated": "Use your platform's native DOMException instead", "dev": true, "dependencies": { "webidl-conversions": "^7.0.0" @@ -9301,6 +9540,13 @@ "node": ">= 12" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/html-to-image": { "version": "1.11.11", "license": "MIT" @@ -9443,6 +9689,13 @@ "node": ">=10.17.0" } }, + "node_modules/i18next": { + "version": "20.3.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "license": "MIT", @@ -9477,6 +9730,24 @@ "node": ">=4" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore": { "version": "5.3.0", "license": "MIT", @@ -12703,8 +12974,7 @@ }, "node_modules/jquery": { "version": "3.7.1", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/js-sdsl": { "version": "4.4.2", @@ -12974,6 +13244,10 @@ "version": "1.2.4", "license": "MIT" }, + "node_modules/load-script": { + "version": "1.0.0", + "license": "MIT" + }, "node_modules/loader-runner": { "version": "4.3.0", "license": "MIT", @@ -13148,6 +13422,10 @@ "node": ">= 4.0.0" } }, + "node_modules/memoize-one": { + "version": "5.2.1", + "license": "MIT" + }, "node_modules/merge-descriptors": { "version": "1.0.1", "license": "MIT" @@ -15524,8 +15802,7 @@ }, "node_modules/react-dom": { "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "license": "MIT", "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.0" @@ -15538,6 +15815,30 @@ "version": "6.0.11", "license": "MIT" }, + "node_modules/react-fast-compare": { + "version": "3.2.2", + "license": "MIT" + }, + "node_modules/react-i18next": { + "version": "12.3.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.20.6", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 19.0.0", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "18.2.0", "license": "MIT" @@ -15553,6 +15854,20 @@ "react-dom": ">=16.0.0" } }, + "node_modules/react-player": { + "version": "2.13.0", + "license": "MIT", + "dependencies": { + "deepmerge": "^4.0.0", + "load-script": "^1.0.0", + "memoize-one": "^5.1.1", + "prop-types": "^15.7.2", + "react-fast-compare": "^3.0.1" + }, + "peerDependencies": { + "react": ">=16.6.0" + } + }, "node_modules/react-redux": { "version": "7.2.9", "license": "MIT", @@ -15589,8 +15904,7 @@ }, "node_modules/react-router": { "version": "6.14.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.14.1.tgz", - "integrity": "sha512-U4PfgvG55LdvbQjg5Y9QRWyVxIdO1LlpYT7x+tMAxd9/vmiPuJhIwdxZuIQLN/9e3O4KFDHYfR9gzGeYMasW8g==", + "license": "MIT", "dependencies": { "@remix-run/router": "1.7.1" }, @@ -15603,8 +15917,7 @@ }, "node_modules/react-router-dom": { "version": "6.14.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.14.1.tgz", - "integrity": "sha512-ssF6M5UkQjHK70fgukCJyjlda0Dgono2QGwqGvuk7D+EDGHdacEN3Yke2LTMjkrpHuFwBfDFsEjGVXBDmL+bWw==", + "license": "MIT", "dependencies": { "@remix-run/router": "1.7.1", "react-router": "6.14.1" @@ -16943,6 +17256,21 @@ "react-dom": "^16.8.0 || 17.x || 18.x" } }, + "node_modules/react-slick": { + "version": "0.29.0", + "license": "MIT", + "dependencies": { + "classnames": "^2.2.5", + "enquire.js": "^2.1.6", + "json2mq": "^0.2.0", + "lodash.debounce": "^4.0.8", + "resize-observer-polyfill": "^1.5.0" + }, + "peerDependencies": { + "react": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-svg-worldmap": { "version": "2.0.0-alpha.16", "license": "MIT", @@ -17345,6 +17673,25 @@ "version": "1.9.0", "license": "MIT" }, + "node_modules/resolve-url-loader/node_modules/picocolors": { + "version": "0.2.1", + "license": "ISC" + }, + "node_modules/resolve-url-loader/node_modules/postcss": { + "version": "7.0.39", + "license": "MIT", + "dependencies": { + "picocolors": "^0.2.1", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, "node_modules/resolve-url-loader/node_modules/source-map": { "version": "0.6.1", "license": "BSD-3-Clause", @@ -19041,6 +19388,13 @@ "node": ">= 0.8" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "license": "MIT", diff --git a/package.json b/package.json index 16785e1d..780c51d9 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,21 @@ { "name": "dashboard-app", - "version": "1.2.1", + "version": "1.3.0", + "license": "Apache-2.0", "private": true, "dependencies": { + "@catena-x/portal-shared-components": "2.1.3", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "5.10.6", - "@mui/material": "5.10.7", + "@mui/x-data-grid": "5.17.26", + "@mui/types": "7.2.5", "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "14.1.0", "@testing-library/user-event": "^14.5.1", "axios": "1.6.1", - "cx-portal-shared-components": "^0.4.5", + "buffer": "^6.0.3", + "cx-portal-shared-components": "0.4.5", "d3-fetch": "^3.0.1", "env-cmd": "^10.1.0", "enzyme": "^3.11.0", @@ -41,7 +45,8 @@ "test": "react-scripts test", "eject": "react-scripts eject", "coverage": "react-scripts test --env=jsdom --coverage --collectCoverageFrom='src/**/*.js' ", - "local-coverage": "react-scripts test --env=jsdom --watchAll --coverage --collectCoverageFrom='src/**/*.js' " + "local-coverage": "react-scripts test --env=jsdom --watchAll --coverage --collectCoverageFrom='src/**/*.js' ", + "build:legal-notice": "bash scripts/legal-notice.sh" }, "eslintConfig": { "extends": [ @@ -77,14 +82,18 @@ "react-scripts": { "@svgr/webpack": "7.0.0" }, - "resolve-url-loader": { - "postcss": "^8.4.31" - }, "eslint": "8.32.0", "react-router-dom": "6.14.1", "keycloak-js": "20.0.5", "@mui/icons-material": "5.10.6", - "@mui/material": "5.10.7" + "@mui/material": "5.10.7", + "@catena-x/portal-shared-components": { + "@mui/x-date-pickers": "6.16.1", + "@mui/types": "7.2.5", + "@mui/system": { + "@mui/types": "7.2.5" + } + } }, "jest": { "transformIgnorePatterns": [ diff --git a/public/index.html b/public/index.html index 602727b2..8e1f9510 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ window.ENV = { REACT_APP_COUNTRY_RISK_API: "http://localhost:8080", REACT_APP_AUTH_URL: "http://localhost:8080/auth", - REACT_APP_PORTAL_FRONTEND: "http://localhost:8080", + REACT_APP_PORTAL_FRONTEND: "http://localhost:3000", REACT_APP_PORTAL_BACKEND: "http://localhost:8080", REACT_APP_COUNTRY_RISK_CLIENT: "country_risk_client", }; diff --git a/public/orange-background-full.svg.license b/public/orange-background-full.svg.license new file mode 100644 index 00000000..7eb90696 --- /dev/null +++ b/public/orange-background-full.svg.license @@ -0,0 +1,5 @@ +This work is licensed under the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode). + +- SPDX-License-Identifier: CC-BY-4.0 +- SPDX-FileCopyrightText: Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/portal-assets diff --git a/public/orange-background-head.svg.license b/public/orange-background-head.svg.license new file mode 100644 index 00000000..7eb90696 --- /dev/null +++ b/public/orange-background-head.svg.license @@ -0,0 +1,5 @@ +This work is licensed under the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode). + +- SPDX-License-Identifier: CC-BY-4.0 +- SPDX-FileCopyrightText: Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +- Source URL: https://github.com/eclipse-tractusx/portal-assets diff --git a/scripts/inject-dynamic-env.sh b/scripts/inject-dynamic-env.sh index 91380f8f..e365356f 100644 --- a/scripts/inject-dynamic-env.sh +++ b/scripts/inject-dynamic-env.sh @@ -1,6 +1,7 @@ #!/bin/sh -############################################################### -# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation +################################################################################ +# Copyright (c) 2022,2023 BMW Group AG +# Copyright (c) 2022,2023 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -16,7 +17,7 @@ # under the License. # # SPDX-License-Identifier: Apache-2.0 -############################################################### +################################################################################ custom_env_vars_REACT_APP_AUTH_URL='REACT_APP_AUTH_URL:"'$REACT_APP_AUTH_URL'"' custom_env_vars_REACT_APP_COUNTRY_RISK_API='REACT_APP_COUNTRY_RISK_API:"'$REACT_APP_COUNTRY_RISK_API'"' custom_env_vars_REACT_APP_PORTAL_FRONTEND='REACT_APP_PORTAL_FRONTEND:"'$REACT_APP_PORTAL_FRONTEND'"' @@ -25,7 +26,7 @@ custom_env_vars_REACT_APP_COUNTRY_RISK_CLIENT='REACT_APP_COUNTRY_RISK_CLIENT:"'$ REACT_APP_AUTH_URL_anchor='REACT_APP_AUTH_URL:"http://localhost:8080/auth"' REACT_APP_COUNTRY_RISK_API_anchor='REACT_APP_COUNTRY_RISK_API:"http://localhost:8080"' -REACT_APP_PORTAL_FRONTEND_anchor='REACT_APP_PORTAL_FRONTEND:"http://localhost:8080"' +REACT_APP_PORTAL_FRONTEND_anchor='REACT_APP_PORTAL_FRONTEND:"http://localhost:3000"' REACT_APP_PORTAL_BACKEND_anchor='REACT_APP_PORTAL_BACKEND:"http://localhost:8080"' REACT_APP_COUNTRY_RISK_CLIENT_anchor='REACT_APP_COUNTRY_RISK_CLIENT:"country_risk_client"' diff --git a/scripts/legal-notice.sh b/scripts/legal-notice.sh new file mode 100644 index 00000000..4f4ab422 --- /dev/null +++ b/scripts/legal-notice.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2022,2023 BMW Group AG +# Copyright (c) 2022,2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################ + +# Define placeholders from legal-notice.json +name_anchor='NAME_PLACEHOLDER' +license_anchor='LICENSE_PLACEHOLDER' +commit_id_anchor='COMMIT_ID_PLACEHOLDER' +server_url_anchor='SERVER_URL_PLACEHOLDER' +repository_anchor='REPOSITORY_PLACEHOLDER' +ref_anchor='REF_PLACEHOLDER' + +# Read values from package.json using jq +name=$(jq -r '.name' package.json) +license=$(jq -r '.license' package.json) + +# Get commit id +commit_id=$(git rev-parse HEAD) + +# Get GitHub context from environment variables +server_url=$SERVER_URL +repository=$REPOSITORY +ref=$REF_NAME + +# Read legal-notice.json as reference +legal_notice_reference=$(cat src/legal-notice.json) + +# Function to check if placeholder substitution was successful +check_substitution() { + if [[ $1 = *"$2"* ]]; then + echo "Error: Failed to replace $2" + exit 1 + fi +} + +# Replace placeholders with actual values +legal_notice_name="${legal_notice_reference/$name_anchor/$name}" +check_substitution "$legal_notice_name" "$name_anchor" +echo "Replaced name" + +legal_notice_license="${legal_notice_name/$license_anchor/$license}" +check_substitution "$legal_notice_license" "$license_anchor" +echo "Replaced license" + +legal_notice_commit="${legal_notice_license/$commit_id_anchor/$commit_id}" +check_substitution "$legal_notice_commit" "$commit_id_anchor" +echo "Replaced commit ID" + +legal_notice_server_url="${legal_notice_commit//$server_url_anchor/$server_url}" +check_substitution "$legal_notice_server_url" "$server_url_anchor" +echo "Replaced server URL" + +legal_notice_repository="${legal_notice_server_url//$repository_anchor/$repository}" +check_substitution "$legal_notice_repository" "$repository_anchor" +echo "Replaced repository" + +legal_notice_ref="${legal_notice_repository//$ref_anchor/$ref}" +check_substitution "$legal_notice_ref" "$ref_anchor" +echo "Replaced ref name" + +# Write the final result to legal-notice.json +echo "$legal_notice_ref" > src/legal-notice.json \ No newline at end of file diff --git a/src/App.js b/src/App.js index dfc85a0c..1b67a3aa 100644 --- a/src/App.js +++ b/src/App.js @@ -20,7 +20,6 @@ import Dashboard from "./components/dashboard/dashboard"; import "./App.scss"; import { RatesProvider } from "./contexts/rates"; -import { Footer } from "./components/dashboard/Footer/Footer"; import { RangesProvider } from "./contexts/ranges"; import { CountryProvider } from "./contexts/country"; import { CompanyUserProvider } from "./contexts/companyuser"; @@ -28,6 +27,11 @@ import { ReportProvider } from "./contexts/reports"; import { ReloadProvider } from "./contexts/refresh"; import { GatesProvider } from "./contexts/gates"; import NavigationBar from "./components/dashboard/NavigationBar/NavigationBar"; +import React from "react"; +import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +import AboutPage from "./components/dashboard/AboutCard/AboutPage"; +import { FooterPortal } from "./components/dashboard/Footer/FooterPortal"; + function App() { return ( <> @@ -38,13 +42,18 @@ function App() { -
- -
-
- -
-
+ +
+ +
+
+ + } /> + } /> + + +
+
diff --git a/src/components/dashboard/AboutCard/AboutPage.js b/src/components/dashboard/AboutCard/AboutPage.js new file mode 100644 index 00000000..5d63b315 --- /dev/null +++ b/src/components/dashboard/AboutCard/AboutPage.js @@ -0,0 +1,39 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +import { AboutCard, PageHeader } from "@catena-x/portal-shared-components"; +import legalJson from "../../../legal-notice.json"; +import { Link } from "@mui/icons-material"; +import { Breadcrumb, Typography } from "@catena-x/portal-shared-components"; +import { PageBreadcrumb } from "../PageBreadCrumb/PageBreadcrumb"; +import "./about.scss"; + +export default function AboutPage() { + return ( +
+ + + +
+ +
+
+ ); +} diff --git a/src/components/dashboard/AboutCard/about.scss b/src/components/dashboard/AboutCard/about.scss new file mode 100644 index 00000000..f060752a --- /dev/null +++ b/src/components/dashboard/AboutCard/about.scss @@ -0,0 +1,74 @@ +/******************************************************************************** +* Copyright (c) 2022,2023 BMW Group AG +* Copyright (c) 2022,2023 Contributors to the Eclipse Foundation +* +* See the NOTICE file(s) distributed with this work for additional +* information regarding copyright ownership. +* +* This program and the accompanying materials are made available under the +* terms of the Apache License, Version 2.0 which is available at +* https://www.apache.org/licenses/LICENSE-2.0. +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +* License for the specific language governing permissions and limitations +* under the License. +* +* SPDX-License-Identifier: Apache-2.0 +********************************************************************************/ + +.AboutPage { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + font-weight: 100; + font-size: small; + + // AboutCard styling + .AboutCardContainer { + display: flex; + justify-content: center; + width: 100%; + margin-top: 2rem; + max-width: 800px; + font-size: 24px; + .css-101tu3u { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + max-width: 800px; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: 100%; + font-size: 24px; + } + .css-gtorsz { + margin: 0px; + font-family: Roboto, Helvetica, Arial, sans-serif; + font-size: 24px; + font-weight: 400; + + line-height: 1.167; + letter-spacing: 0em; + padding-right: 10px; + text-transform: uppercase; + } + + .css-i7tjim-MuiTypography-root { + margin: 0px; + font-family: LibreFranklin-SemiBold, -apple-system, BlinkMacSystemFont, + "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 24px; + } + } +} diff --git a/src/components/dashboard/Footer/Constants.js b/src/components/dashboard/Footer/Constants.js new file mode 100644 index 00000000..3dffe8f7 --- /dev/null +++ b/src/components/dashboard/Footer/Constants.js @@ -0,0 +1,221 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +export const PAGE_SIZE = 10; + +export const INTERVAL_CHECK_NOTIFICATIONS = 60000; + +export const PAGES = { + ROOT: "", + HOME: "home", + REGISTRATION: "registration", + SWAGGER: "swagger", + STORYBOOK: "storybook", + APPSUBSCRIPTION: "appsubscription", + ADMINBOARD: "adminboard", + ADMINBOARD_DETAIL: "adminboarddetail", + MARKETPLACE: "marketplace", + APP_MARKETPLACE: "appmarketplace", + SERVICE_MARKETPLACE: "servicemarketplace", + SERVICE_MARKETPLACE_DETAIL: "servicemarketplacedetail", + APP_DETAIL: "appdetail", + DATA_MANAGEMENT: "datamanagement", + SEMANTICHUB: "semantichub", + CONNECTOR: "connector", + ACCOUNT: "account", + USER_DETAILS: "userdetails", + NOTIFICATIONS: "notifications", + ORGANIZATION: "organization", + PARTNER_NETWORK: "partnernetwork", + USER_MANAGEMENT: "usermanagement", + TECHNICAL_SETUP: "technicalsetup", + TECHUSER_MANAGEMENT: "technicaluser", + TECHUSER_DETAILS: "techuserdetails", + IDP_MANAGEMENT: "idpmanagement", + IDP_DETAIL: "idpdetail", + APPLICATION_REQUESTS: "applicationrequests", + APP_USER_MANAGEMENT: "appusermanagement", + INVITE: "invite", + ADMINISTRATION: "admin", + HELP: "help", + DOCUMENTATION: "documentation", + CONTACT: "contact", + IMPRINT: "imprint", + PRIVACY: "privacy", + TERMS: "terms", + COOKIE_POLICY: "cookiepolicy", + SETTINGS: "settings", + DEVELOPER: "developer", + TEST: "test", + LOGOUT: "logout", + ERROR: "error", + APP_MANAGEMENT: "appmanagement", + APPOVERVIEW: "appoverview", + APPOVERVIEW_NEW: "appoverview-new", + DEACTIVATE: "deactivate", + CHANGE_IMAGE: "changeimage", + CHANGE_DESCRIPTION: "changedescription", + ADD_ROLES: "addroles", + CHANGE_DOCUMENTS: "changedocuments", + APPRELEASEPROCESS: "appreleaseprocess", + APP_RELEASE_PROCESS_FORM: "appreleaseprocess_form", + INTRODUCTION: "companyroles", + INTRODUCTION_PARTICIPANT: "companyrolesparticipant", + INTRODUCTION_APP_PROVIDER: "companyrolesappprovider", + INTRODUCTION_SERVICE_PROVIDER: "companyrolesserviceprovider", + INTRODUCTION_CONFIRMITY_BODY: "companyrolesconfirmitybody", + INTRODUCTION_OSP_BODY: "companyrolesonboardingserviceprovider", + USE_CASE: "usecase", + USE_CASE_TRACABILITY: "usecasetraceablity", + SERVICE_MANAGEMENT: "servicemanagement", + SERVICEOVERVIEW: "serviceoverview", + SERVICEDEACTIVATE: "servicedeactivate", + SERVICERELEASEPROCESS: "servicereleaseprocess", + SERVICEADMINBOARD: "serviceadminboard", + SERVICEADMINBOARD_DETAIL: "serviceadminboarddetail", + SERVICESUBSCRIPTION: "servicesubscription", + SERVICE_RELEASE_PROCESS_FORM: "servicereleaseprocess_form", + ROLE_DETAILS: "role-details", + SERVICE_DETAIL: "servicedetail", + COMPANY_ROLE: "company-role", + USECASE_PARTICIPATION: "usecase-participation", + ABOUTPAGE: "about", + CERTIFICATE_CREDENTIAL: "certificate-credential", + DATA_SPACE: "dataspace", + ADMIN_CREDENTIAL: "admin-credential", + ONBOARDING_SERVICEPROVIDER: "onboarding-serviceprovider", +}; + +export const OVERLAYS = { + NOT_FOUND: "notfound", + NONE: "none", + ADD_USER: "add_user", + ADD_MULTIPLE_USER: "add_multiple_user", + ADD_APP_USER_ROLES: "add_app_user_roles", + EDIT_APP_USER_ROLES: "edit_app_user_roles", + USER: "user", + TECHUSER: "techuser", + ADD_TECHUSER: "add_techuser", + DELETE_TECHUSER: "delete_techuser", + NEWS: "news", + ADD_BPN: "add_bpn", + ADD_SUBSCRIPTION: "add_subscription", + INVITE: "invite", + PARTNER: "partner", + APP: "app", + SERVICE_REQUEST: "service_request", + APPMARKETPLACE_REQUEST: "appmarketplace_request", + ADD_IDP: "add_idp", + UPDATE_IDP: "update_idp", + UPDATE_IDP_SUCCESS: "update_idp_success", + ENABLE_IDP: "enable_idp", + DISABLE_IDP: "disable_idp", + DELETE_IDP: "delete_idp", + ADDUSERS_IDP: "addusers_idp", + IDP_DETAILS: "idp_details", + IDP_CONFIRM: "idp_confirm", + IDP_STATUS: "idp_status", + IDP_TEST_RUN: "idp_test_run", + ENABLE_IDP_SUCCESS: "enable_idp_success", + REGISTER_OSP: "register_osp", + REGISTER_NEXT_OSP: "register_next_osp", + CONSENT_OSP: "consent_osp", + APP_OVERVIEW_CONFIRM: "app_overview_confirm", + APP_DETAILS_OVERLAY: "app_details_overlay", + CONFIRM_USER_ACTION: "confirm_user_action", + SAMPLE_FORM: "sample_form", + ADD_SERVICE_PROVIDER: "add_service_provider", + APP_DECLINE_ADMINBOARD: "app_decline_adminboard", + EDIT_PORTAL_ROLES: "edit_portal_roles", + SERVICE_DECLINE_ADMINBOARD: "decline_service_release", + UPDATE_COMPANY_ROLE: "update_company_role", + EDIT_USECASE: "edit_usecase", + UPDATE_CERTIFICATE: "update_certificate", +}; + +export const ACTIONS = { + LANG_DE: "Lang_de", + LANG_EN: "Lang_en", + SIGNOUT: "SignOut", +}; + +export const ROLES = { + EVERYONE: "*", + CX_ADMIN: "CX Admin", + ADMIN_CONNECTOR: "Admin - Connector Setup", + ADMIN_USER: "Admin - User Management", + INVITE_NEW_PARTNER: "invite_new_partner", + NOTIFICATION_VIEW: "view_notifications", + SETUP_IDP: "setup_idp", + SETUP_CLIENT: "setup_client", + APPSTORE_VIEW: "view_apps", + APPSTORE_VIEW_SERVICES: "view_service_marketplace", + SUBSCRIBE_SERVICE_MARKETPLACE: "subscribe_service", + APPSTORE_VIEW_DATASPACES: "view_dataspaces", + APPSTORE_ADD: "add_app", + APPSTORE_EDIT: "edit_apps", + APPSTORE_FILTER: "filter_apps", + APPSTORE_DELETE: "delete_apps", + APPMANAGEMENT_VIEW: "add_apps", + SERVICEMANAGEMENT_VIEW: "add_service_offering", + APP_MANAGEMENT: "app_management", + SERVICE_SUBSCRIPTION_MANAGEMENT: "activate_subscription", + APPOVERVIEW_VIEW: "add_apps", + SERVICEOVERVIEW_VIEW: "add_service_offering", + CONNECTOR_SETUP: "setup_connector", + SEMANTICHUB_VIEW: "view_semantic_model", + SEMANTICHUB_ADD: "add_semantic_model", + SEMANTICHUB_DELETE: "delete_semantic_model", + USERMANAGEMENT_VIEW: "view_user_management", + USERMANAGEMENT_ADD: "add_user_account", + USERMANAGEMENT_DELETE: "delete_user_account", + TECHUSER_VIEW: "view_tech_user_management", + TECHUSER_ADD: "add_tech_user_management", + TECHUSER_DELETE: "delete_tech_user_management", + IDP_VIEW: "view_idp", + IDP_ADD: "add_idp", + IDP_DELETE: "delete_idp", + IDP_SETUP: "setup_idp", + IDP_DISABLE: "disable_idp", + MODIFY_USER_ACCOUNT: "modify_user_account", + ORGANIZATION_VIEW: "view_organization", + PARTNER_NETWORK_VIEW: "view_partner_network", + DEVELOPER: "catenax_developer", + TECHNICAL_SETUP_VIEW: "view_technical_setup", + FE_DEVELOPER: "FE Developer", + VIEW_APP_RELEASE: "view_app_release", + MY_USER_ACCOUNT: "my_user_account", + VIEW_USER_ACCOUNT: "view_user_account", + ACTIVATE_SUBSCRIPTION: "activate_subscription", + APPROVE_APP_RELEASE: "approve_app_release", + DECLINE_APP_RELEASE: "decline_app_release", + APPROVE_SERVICE_RELEASE: "activate_subscription", + DECLINE_SERVICE_RELEASE: "decline_service_release", + VIEW_SERVICE_RELEASE: "add_service_offering", + UPDATE_COMPANY_ROLE: "update_company_role", + SUBMITTED_APPLICATION: "view_submitted_applications", + REQUEST_SSICREDENTIAL: "request_ssicredential", + DECISION_SSICREDENTIAL: "decision_ssicredential", +}; + +export const HINTS = { + COMING_SOON: "coming_soon", + NEW: "new", +}; diff --git a/src/components/dashboard/Footer/Footer.js b/src/components/dashboard/Footer/Footer.js deleted file mode 100644 index d01da3a2..00000000 --- a/src/components/dashboard/Footer/Footer.js +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,2023 Contributors to the Eclipse Foundation -* -* See the NOTICE file(s) distributed with this work for additional -* information regarding copyright ownership. -* -* This program and the accompanying materials are made available under the -* terms of the Apache License, Version 2.0 which is available at -* https://www.apache.org/licenses/LICENSE-2.0. -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -* License for the specific language governing permissions and limitations -* under the License. -* -* SPDX-License-Identifier: Apache-2.0 -********************************************************************************/ -import "./styles.scss"; - -export const Footer = () => { - return ( -
- - - - - - - - - - -
- ); -}; diff --git a/src/components/dashboard/Footer/Footer.scss b/src/components/dashboard/Footer/Footer.scss new file mode 100644 index 00000000..bbf8790f --- /dev/null +++ b/src/components/dashboard/Footer/Footer.scss @@ -0,0 +1,59 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +footer { + margin-top: auto; + position: relative; + overflow: hidden; + @media screen and (min-width: 1200px) { + } + .footer-head { + margin-bottom: -7px; + + @media screen and (min-width: 1400px) { + width: 100%; + } + } + .footer-content { + display: relative; + min-height: 200px; + font-size: 12px; + text-align: center; + background-image: url(./orange-background-full.svg); + background-size: cover; + background-repeat: no-repeat; + @media screen and (min-width: 1400px) { + background-size: cover; + } + nav { + margin-left: auto; + margin-right: auto; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 16px; + padding-top: 75px; + a.MuiTypography-root { + color: black; + text-decoration: underline; + } + } + } +} diff --git a/src/components/dashboard/Footer/FooterPortal.js b/src/components/dashboard/Footer/FooterPortal.js new file mode 100644 index 00000000..326703d3 --- /dev/null +++ b/src/components/dashboard/Footer/FooterPortal.js @@ -0,0 +1,85 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +import { useEffect, useState } from "react"; +import { Navigation, IconButton } from "@catena-x/portal-shared-components"; +import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward"; +import { useTranslation } from "react-i18next"; +import { NavLink } from "react-router-dom"; +import "./Footer.scss"; +import footerHeadImage from "./orange-background-head.svg"; + +export const FooterPortal = () => { + const { t } = useTranslation(); + const [showScrollToTop, setShowScrollToTop] = useState(false); + + const scrollToTop = () => { + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + }; + + const toggleVisibility = () => { + setShowScrollToTop(window.pageYOffset > 350); + }; + + useEffect(() => { + window.addEventListener("scroll", toggleVisibility); + return () => window.removeEventListener("scroll", toggleVisibility); // Clean up the event listener + }, []); + + // Define your navigation items here + const navItems = [ + { to: "/", content: t("navigation.help"), title: "Help" }, + { to: "/contact", content: t("navigation.contact"), title: "Contact" }, + { to: "/imprint", content: t("navigation.imprint"), title: "Imprint" }, + { to: "/privacy", content: t("navigation.privacy"), title: "Privacy" }, + { to: "/terms", content: t("navigation.terms"), title: "Terms of Service" }, + { to: "/cookies", content: t("navigation.cookies"), title: "Cookies" }, + { to: "/about", content: t("navigation.about"), title: "About" }, + ]; + + return ( +
+ {showScrollToTop && ( + + + + )} + orange background +
+ +
+ + Copyright © Catena-X Automotive Network + +
+
+ ); +}; diff --git a/src/components/dashboard/Footer/orange-background-full.svg b/src/components/dashboard/Footer/orange-background-full.svg new file mode 100644 index 00000000..a2642eec --- /dev/null +++ b/src/components/dashboard/Footer/orange-background-full.svg @@ -0,0 +1,9 @@ + + Subtract-svg + + + + + + \ No newline at end of file diff --git a/src/components/dashboard/Footer/orange-background-head.svg b/src/components/dashboard/Footer/orange-background-head.svg new file mode 100644 index 00000000..fbe5e47f --- /dev/null +++ b/src/components/dashboard/Footer/orange-background-head.svg @@ -0,0 +1,13 @@ + + Subtract-svg + + + + + + + + + \ No newline at end of file diff --git a/src/components/dashboard/Footer/styles.scss b/src/components/dashboard/Footer/styles.scss deleted file mode 100644 index 87259ded..00000000 --- a/src/components/dashboard/Footer/styles.scss +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************** -* Copyright (c) 2022,2023 BMW Group AG -* Copyright (c) 2022,2023 Contributors to the Eclipse Foundation -* -* See the NOTICE file(s) distributed with this work for additional -* information regarding copyright ownership. -* -* This program and the accompanying materials are made available under the -* terms of the Apache License, Version 2.0 which is available at -* https://www.apache.org/licenses/LICENSE-2.0. -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -* License for the specific language governing permissions and limitations -* under the License. -* -* SPDX-License-Identifier: Apache-2.0 -********************************************************************************/ -.footer-app { - height: 100% !important; - text-align: center !important; - display: flex !important; - flex-direction: column !important; -} diff --git a/src/components/dashboard/NavigationBar/NavigationBar.js b/src/components/dashboard/NavigationBar/NavigationBar.js index cf78646f..9272da7d 100644 --- a/src/components/dashboard/NavigationBar/NavigationBar.js +++ b/src/components/dashboard/NavigationBar/NavigationBar.js @@ -55,13 +55,14 @@ const NavigationBar = () => { open={open} onClose={openDialog} > - + diff --git a/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js index 353650f1..d8865731 100644 --- a/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js +++ b/src/components/dashboard/NavigationBar/UserInformation/UserInfo.js @@ -1,3 +1,23 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + import { useRef, useState } from "react"; import { UserAvatar, @@ -7,7 +27,10 @@ import { } from "cx-portal-shared-components"; import UserService from "../../../services/UserService"; import "./UserInfo.scss"; -import { getLogoutLink } from "../../../services/EnvironmentService"; +import { + getLogoutLink, + getAboutLink, +} from "../../../services/EnvironmentService"; export const UserInfo = () => { const [menuOpen, setMenuOpen] = useState(false); @@ -23,6 +46,8 @@ export const UserInfo = () => { const logoutHref = getLogoutLink(); + const aboutHref = getAboutLink(); + return (
diff --git a/src/components/dashboard/PageBreadCrumb/PageBreadcrumb.js b/src/components/dashboard/PageBreadCrumb/PageBreadcrumb.js new file mode 100644 index 00000000..37a870f0 --- /dev/null +++ b/src/components/dashboard/PageBreadCrumb/PageBreadcrumb.js @@ -0,0 +1,105 @@ +/******************************************************************************** + * Copyright (c) 2022,2023 BMW Group AG + * Copyright (c) 2022,2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +import { Breadcrumb, Typography } from "@catena-x/portal-shared-components"; +import { Link } from "@mui/material"; +import { useNavigate, useParams, useLocation } from "react-router-dom"; +import { useTranslation } from "react-i18next"; +import { useEffect, useState } from "react"; +import "./styles.scss"; + +function isParamsEmpty(params) { + for (const param in params) { + if (param) return false; + } + return true; +} + +export const PageBreadcrumb = () => { + const navigate = useNavigate(); + const params = useParams(); + const location = useLocation(); + const [crumbs, setCrumbs] = useState([]); + + useEffect(() => { + const pathNames = location.pathname.split("/"); + pathNames.forEach((value, index) => { + if (value === "") { + pathNames.splice(index, 1); + } + }); + + // no need to add params to breadcrumbs: + if (!isParamsEmpty(params)) { + pathNames.splice(pathNames.length - 1, 1); + } + setCrumbs(pathNames); + }, [location, params]); + + const getCrumbTitle = (crumb) => { + return "About"; + }; + + const breadcrumbs = () => { + return crumbs.map((item, index) => { + const count = crumbs.length - 1; + const navigatePage = count - index; + if (index === count) { + // last item in breadcrumb has no navigation + return ( + + {getCrumbTitle(item)} + + ); + } else { + // other items in breadcrumbs have navigation + return ( + { + navigate(-navigatePage); + }} + > +

{getCrumbTitle(item)}

+ + ); + } + }); + }; + + return ( + { + navigate(-1); + }} + breadcrumbs={breadcrumbs()} + className="CustomBreadcrumb" + /> + ); +}; diff --git a/src/components/dashboard/PageBreadCrumb/styles.scss b/src/components/dashboard/PageBreadCrumb/styles.scss new file mode 100644 index 00000000..1352e3b8 --- /dev/null +++ b/src/components/dashboard/PageBreadCrumb/styles.scss @@ -0,0 +1,19 @@ +/******************************************************************************** + * Copyright (c) 2021, 2023 BMW Group AG + * Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ diff --git a/src/components/services/EnvironmentService.js b/src/components/services/EnvironmentService.js index cc83b244..1361fd54 100644 --- a/src/components/services/EnvironmentService.js +++ b/src/components/services/EnvironmentService.js @@ -53,6 +53,10 @@ export const getLogoutLink = () => { return LOCAL_SERVICES_FRONTEND + "/logout"; }; +export const getAboutLink = () => { + return LOCAL_SERVICES_FRONTEND + "/about"; +}; + export const getCountryRiskAppId = () => { return LOCAL_COUNTRY_RISK_CLIENT_ID ? LOCAL_COUNTRY_RISK_CLIENT_ID diff --git a/src/legal-notice.json b/src/legal-notice.json new file mode 100644 index 00000000..bb0a3ead --- /dev/null +++ b/src/legal-notice.json @@ -0,0 +1,9 @@ +{ + "name": "NAME_PLACEHOLDER", + "repositoryPath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER", + "license": "LICENSE_PLACEHOLDER", + "licensePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/blob/REF_PLACEHOLDER/LICENSE", + "noticePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/blob/REF_PLACEHOLDER/NOTICE.md", + "sourcePath": "SERVER_URL_PLACEHOLDER/REPOSITORY_PLACEHOLDER/tree/REF_PLACEHOLDER", + "commitId": "COMMIT_ID_PLACEHOLDER" +}