Skip to content

Commit 2bf60a5

Browse files
Update all packages and remove unused (#524)
* chore(deps): bump the yarn-minor-patch group with 28 updates Bumps the yarn-minor-patch group with 28 updates: | Package | From | To | | --- | --- | --- | | [@apollo/client](https://github.com/apollographql/apollo-client) | `4.0.11` | `4.1.2` | | [@mui/icons-material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-icons-material) | `7.3.6` | `7.3.7` | | [@mui/material](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material) | `7.3.6` | `7.3.7` | | [@mui/material-nextjs](https://github.com/mui/material-ui/tree/HEAD/packages/mui-material-nextjs) | `7.3.6` | `7.3.7` | | [@mui/styled-engine](https://github.com/mui/material-ui/tree/HEAD/packages/mui-styled-engine) | `7.3.6` | `7.3.7` | | [@mui/system](https://github.com/mui/material-ui/tree/HEAD/packages/mui-system) | `7.3.6` | `7.3.7` | | [@mui/x-date-pickers](https://github.com/mui/mui-x/tree/HEAD/packages/x-date-pickers) | `8.22.0` | `8.26.0` | | [@prisma/adapter-better-sqlite3](https://github.com/prisma/prisma/tree/HEAD/packages/adapter-better-sqlite3) | `7.2.0` | `7.3.0` | | [@prisma/client](https://github.com/prisma/prisma/tree/HEAD/packages/client) | `7.2.0` | `7.3.0` | | [lodash](https://github.com/lodash/lodash) | `4.17.21` | `4.17.23` | | [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) | `4.17.21` | `4.17.23` | | [next](https://github.com/vercel/next.js) | `16.1.1` | `16.1.4` | | [next-intl](https://github.com/amannn/next-intl) | `4.6.0` | `4.7.0` | | [pino](https://github.com/pinojs/pino) | `10.1.0` | `10.3.0` | | [react-hook-form](https://github.com/react-hook-form/react-hook-form) | `7.68.0` | `7.71.1` | | [recharts](https://github.com/recharts/recharts) | `3.4.0` | `3.7.0` | | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-plugin-next) | `16.1.1` | `16.1.4` | | [@swc/core](https://github.com/swc-project/swc) | `1.15.5` | `1.15.10` | | [@testing-library/react](https://github.com/testing-library/react-testing-library) | `16.3.1` | `16.3.2` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `25.0.9` | `25.0.10` | | [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.2.7` | `19.2.9` | | [cypress](https://github.com/cypress-io/cypress) | `15.8.1` | `15.9.0` | | [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) | `16.1.1` | `16.1.4` | | [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress) | `5.2.0` | `5.2.1` | | [eslint-plugin-formatjs](https://github.com/formatjs/formatjs) | `6.0.9` | `6.1.1` | | [prettier](https://github.com/prettier/prettier) | `3.7.4` | `3.8.1` | | [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli) | `7.2.0` | `7.3.0` | | [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.51.0` | `8.53.1` | Updates `@apollo/client` from 4.0.11 to 4.1.2 - [Release notes](https://github.com/apollographql/apollo-client/releases) - [Changelog](https://github.com/apollographql/apollo-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/apollographql/apollo-client/compare/@apollo/client@4.0.11...@apollo/client@4.1.2) Updates `@mui/icons-material` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/mui/material-ui/releases) - [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui/material-ui/commits/v7.3.7/packages/mui-icons-material) Updates `@mui/material` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/mui/material-ui/releases) - [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui/material-ui/commits/v7.3.7/packages/mui-material) Updates `@mui/material-nextjs` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/mui/material-ui/releases) - [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui/material-ui/commits/v7.3.7/packages/mui-material-nextjs) Updates `@mui/styled-engine` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/mui/material-ui/releases) - [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui/material-ui/commits/v7.3.7/packages/mui-styled-engine) Updates `@mui/system` from 7.3.6 to 7.3.7 - [Release notes](https://github.com/mui/material-ui/releases) - [Changelog](https://github.com/mui/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui/material-ui/commits/v7.3.7/packages/mui-system) Updates `@mui/x-date-pickers` from 8.22.0 to 8.26.0 - [Release notes](https://github.com/mui/mui-x/releases) - [Changelog](https://github.com/mui/mui-x/blob/v8.26.0/CHANGELOG.md) - [Commits](https://github.com/mui/mui-x/commits/v8.26.0/packages/x-date-pickers) Updates `@prisma/adapter-better-sqlite3` from 7.2.0 to 7.3.0 - [Release notes](https://github.com/prisma/prisma/releases) - [Commits](https://github.com/prisma/prisma/commits/7.3.0/packages/adapter-better-sqlite3) Updates `@prisma/client` from 7.2.0 to 7.3.0 - [Release notes](https://github.com/prisma/prisma/releases) - [Commits](https://github.com/prisma/prisma/commits/7.3.0/packages/client) Updates `lodash` from 4.17.21 to 4.17.23 - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.21...4.17.23) Updates `@types/lodash` from 4.17.21 to 4.17.23 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) Updates `next` from 16.1.1 to 16.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v16.1.1...v16.1.4) Updates `next-intl` from 4.6.0 to 4.7.0 - [Release notes](https://github.com/amannn/next-intl/releases) - [Changelog](https://github.com/amannn/next-intl/blob/main/CHANGELOG.md) - [Commits](amannn/next-intl@v4.6.0...v4.7.0) Updates `pino` from 10.1.0 to 10.3.0 - [Release notes](https://github.com/pinojs/pino/releases) - [Commits](pinojs/pino@v10.1.0...v10.3.0) Updates `react-hook-form` from 7.68.0 to 7.71.1 - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](react-hook-form/react-hook-form@v7.68.0...v7.71.1) Updates `recharts` from 3.4.0 to 3.7.0 - [Release notes](https://github.com/recharts/recharts/releases) - [Changelog](https://github.com/recharts/recharts/blob/main/CHANGELOG.md) - [Commits](recharts/recharts@v3.4.0...v3.7.0) Updates `@next/eslint-plugin-next` from 16.1.1 to 16.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v16.1.4/packages/eslint-plugin-next) Updates `@swc/core` from 1.15.5 to 1.15.10 - [Release notes](https://github.com/swc-project/swc/releases) - [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md) - [Commits](swc-project/swc@v1.15.5...v1.15.10) Updates `@testing-library/react` from 16.3.1 to 16.3.2 - [Release notes](https://github.com/testing-library/react-testing-library/releases) - [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md) - [Commits](testing-library/react-testing-library@v16.3.1...v16.3.2) Updates `@types/lodash` from 4.17.21 to 4.17.23 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) Updates `@types/node` from 25.0.9 to 25.0.10 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@types/react` from 19.2.7 to 19.2.9 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Updates `cypress` from 15.8.1 to 15.9.0 - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](cypress-io/cypress@v15.8.1...v15.9.0) Updates `eslint-config-next` from 16.1.1 to 16.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v16.1.4/packages/eslint-config-next) Updates `eslint-plugin-cypress` from 5.2.0 to 5.2.1 - [Release notes](https://github.com/cypress-io/eslint-plugin-cypress/releases) - [Commits](cypress-io/eslint-plugin-cypress@v5.2.0...v5.2.1) Updates `eslint-plugin-formatjs` from 6.0.9 to 6.1.1 - [Release notes](https://github.com/formatjs/formatjs/releases) - [Commits](https://github.com/formatjs/formatjs/compare/eslint-plugin-formatjs@6.0.9...eslint-plugin-formatjs@6.1.1) Updates `prettier` from 3.7.4 to 3.8.1 - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](prettier/prettier@3.7.4...3.8.1) Updates `prisma` from 7.2.0 to 7.3.0 - [Release notes](https://github.com/prisma/prisma/releases) - [Commits](https://github.com/prisma/prisma/commits/7.3.0/packages/cli) Updates `typescript-eslint` from 8.51.0 to 8.53.1 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.53.1/packages/typescript-eslint) --- updated-dependencies: - dependency-name: "@apollo/client" dependency-version: 4.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: "@mui/icons-material" dependency-version: 7.3.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@mui/material" dependency-version: 7.3.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@mui/material-nextjs" dependency-version: 7.3.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@mui/styled-engine" dependency-version: 7.3.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@mui/system" dependency-version: 7.3.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@mui/x-date-pickers" dependency-version: 8.26.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: "@prisma/adapter-better-sqlite3" dependency-version: 7.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: "@prisma/client" dependency-version: 7.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: lodash dependency-version: 4.17.23 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@types/lodash" dependency-version: 4.17.23 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: next dependency-version: 16.1.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: next-intl dependency-version: 4.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: pino dependency-version: 10.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: react-hook-form dependency-version: 7.71.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: recharts dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: "@next/eslint-plugin-next" dependency-version: 16.1.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@swc/core" dependency-version: 1.15.10 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@testing-library/react" dependency-version: 16.3.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@types/lodash" dependency-version: 4.17.23 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@types/node" dependency-version: 25.0.10 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: "@types/react" dependency-version: 19.2.9 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: cypress dependency-version: 15.9.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: eslint-config-next dependency-version: 16.1.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: eslint-plugin-cypress dependency-version: 5.2.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: yarn-minor-patch - dependency-name: eslint-plugin-formatjs dependency-version: 6.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: prettier dependency-version: 3.8.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: prisma dependency-version: 7.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: yarn-minor-patch - dependency-name: typescript-eslint dependency-version: 8.53.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: yarn-minor-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix build * fixed several lint issues due to new rules * more new linter issues fixed * fixed remaining lint issues * cr comments applied * cr comments * unused packages removed * revert some changes * one more fix * added buffer back * added buffer back * reverted buffer replacement * adapted codeowners --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: melanie.gail <melanie.gail@xitaso.com>
1 parent 4548952 commit 2bf60a5

File tree

38 files changed

+3181
-3705
lines changed

38 files changed

+3181
-3705
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @GailMelanie @hofermo @pawel-baran-se @XAlinaGS @NilsXitaso
1+
* @GailMelanie @hofermo @pawel-baran-se @XAlinaGS @LuisSchweinberger

next.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ const nextConfig: NextConfig = {
2626
},
2727
},
2828
},
29-
eslint: {
30-
ignoreDuringBuilds: !!process.env.NO_LINT,
31-
},
3229
typescript: {
3330
ignoreBuildErrors: !!process.env.NO_TYPECHECK,
3431
},

package.json

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,79 +10,74 @@
1010
"devDependencies": {
1111
"@eslint/js": "^9.39.1",
1212
"@jest/globals": "^30.2.0",
13-
"@next/eslint-plugin-next": "^16.1.1",
14-
"@swc/core": "^1.13.5",
13+
"@next/eslint-plugin-next": "^16.1.4",
14+
"@swc/core": "^1.15.10",
1515
"@swc/jest": "^0.2.39",
1616
"@testing-library/dom": "^10.4.1",
1717
"@testing-library/jest-dom": "^6.9.1",
18-
"@testing-library/react": "^16.3.0",
18+
"@testing-library/react": "^16.3.2",
1919
"@testing-library/user-event": "^14.5.2",
2020
"@types/jest": "^30.0.0",
2121
"@types/jsonwebtoken": "^9.0.10",
22-
"@types/lodash": "^4.17.20",
23-
"@types/node": "^25.0.3",
22+
"@types/lodash": "^4.17.23",
23+
"@types/node": "^25.0.10",
2424
"@types/react": "^19",
2525
"@types/react-dom": "^19",
26-
"cypress": "^15.8.1",
26+
"cypress": "^15.9.0",
2727
"cypress-junit-reporter": "^1.3.1",
2828
"cypress-split": "^1.24.25",
2929
"dotenv": "^17.2.3",
3030
"eslint": "^9.39",
31-
"eslint-config-next": "16.1.1",
32-
"eslint-plugin-cypress": "^5.2.0",
33-
"eslint-plugin-formatjs": "^6.0.9",
31+
"eslint-config-next": "16.1.6",
32+
"eslint-plugin-cypress": "^5.2.1",
33+
"eslint-plugin-formatjs": "^6.1.1",
3434
"eslint-plugin-react": "^7.37.5",
35-
"eslint-plugin-react-hooks": "^5.2.0",
35+
"eslint-plugin-react-hooks": "^7.0.1",
3636
"jest": "^30.2.0",
3737
"jest-environment-jsdom": "^30.2.0",
38-
"prettier": "^3.6.2",
39-
"prisma": "^7.2.0",
38+
"prettier": "^3.8.1",
39+
"prisma": "^7.3.0",
4040
"ts-node": "^10.9.2",
4141
"typescript": "~5.9",
42-
"typescript-eslint": "^8.46.3"
42+
"typescript-eslint": "^8.53.1"
4343
},
4444
"dependencies": {
45-
"@apollo/client": "^4.0.11",
4645
"@emotion/cache": "^11.14.0",
4746
"@emotion/react": "^11.14.0",
4847
"@emotion/styled": "^11.14.1",
4948
"@fontsource/noto-sans": "^5.2.10",
5049
"@fontsource/saira": "^5.2.10",
5150
"@influxdata/influxdb-client-browser": "^1.33.2",
52-
"@mui/icons-material": "^7.3.5",
53-
"@mui/lab": "^7.0.0-beta.17",
54-
"@mui/material": "^7.3.5",
55-
"@mui/material-nextjs": "^7.3.5",
56-
"@mui/styled-engine": "^7.3.5",
51+
"@mui/icons-material": "^7.3.7",
52+
"@mui/material": "^7.3.7",
53+
"@mui/material-nextjs": "^7.3.7",
54+
"@mui/styled-engine": "^7.3.7",
5755
"@mui/system": "^7.1.0",
58-
"@mui/x-date-pickers": "^8.17.0",
56+
"@mui/x-date-pickers": "^8.26.0",
5957
"@mui/x-tree-view": "^8.10.2",
60-
"@prisma/adapter-better-sqlite3": "^7.2.0",
61-
"@prisma/client": "^7.2.0",
58+
"@prisma/adapter-better-sqlite3": "^7.3.0",
59+
"@prisma/client": "^7.3.0",
6260
"@svgr/webpack": "^8.1.0",
6361
"buffer": "^6.0.3",
6462
"date-fns": "^4.1.0",
65-
"graphql": "^16.12.0",
6663
"jsonwebtoken": "^9.0.2",
67-
"lodash": "^4.17.21",
68-
"next": "16.1.1",
64+
"lodash": "^4.17.23",
65+
"next": "16.1.6",
6966
"next-auth": "^4.24.13",
70-
"next-intl": "^4.5.0",
67+
"next-intl": "^4.7.0",
7168
"ol": "^10.7.0",
72-
"pino": "^10.1.0",
69+
"pino": "^10.3.0",
7370
"pino-pretty": "^13.1.2",
7471
"qr-scanner": "^1.4.2",
75-
"react": "^19",
76-
"react-dom": "^19",
77-
"react-hook-form": "^7.66.0",
78-
"recharts": "3.4.0",
79-
"sqlite3": "^5.1.7",
72+
"react": "^19.2.4",
73+
"react-dom": "^19.2.4",
74+
"react-hook-form": "^7.71.1",
75+
"recharts": "3.7.0",
8076
"swr": "^2.3.6",
8177
"url": "^0.11.3"
8278
},
8379
"scripts": {
84-
"dev": "yarn prisma:migrate && yarn prisma:generate && next dev --turbo",
85-
"debug": "yarn prisma:migrate && yarn prisma:generate && next dev",
80+
"dev": "yarn prisma:migrate && yarn prisma:generate && next dev",
8681
"build": "next build",
8782
"start": "yarn prisma:migrate && yarn prisma:generate && next start",
8883
"format": "prettier --write ./",
@@ -122,5 +117,8 @@
122117
"last 1 safari version"
123118
]
124119
},
120+
"resolutions": {
121+
"undici": "7.20.0"
122+
},
125123
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
126-
}
124+
}

scripts/validateEnvs.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Buffer } from 'buffer';
21
const keycloakKeys = ['KEYCLOAK_ISSUER', 'KEYCLOAK_REALM', 'KEYCLOAK_CLIENT_ID', 'NEXTAUTH_SECRET'];
32
const azureAdKeys = ['AD_SECRET_VALUE', 'AD_TENANT_ID', 'AD_CLIENT_ID', 'APPLICATION_ID_URI'];
43

src/app/[locale]/_components/QrScanner.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export function QrScanner(props: {
9797

9898
// This will allow cypress to call the callback manually and circumvent a webcam mock
9999
if (typeof window !== 'undefined' && typeof window.Cypress !== 'undefined') {
100+
// eslint-disable-next-line react-hooks/immutability
100101
window.Cypress.scannerCallback = handleScan;
101102
}
102103

src/app/[locale]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactNode } from 'react';
2-
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
2+
import { AppRouterCacheProvider } from '@mui/material-nextjs/v16-appRouter';
33
import type { Metadata } from 'next';
44
import { ClientLayout } from 'app/[locale]/clientLayout';
55
import { getMessages } from 'next-intl/server';
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { Box, Typography } from '@mui/material';
2+
import AasList from './AasList';
3+
import { AuthenticationPrompt } from 'components/authentication/AuthenticationPrompt';
4+
import { useTranslations } from 'next-intl';
5+
import { RepositoryWithInfrastructure } from 'lib/services/database/InfrastructureMappedTypes';
6+
import { AasListDto } from 'lib/services/list-service/ListService';
7+
import { ReactNode } from 'react';
8+
9+
type AasListContentProps = {
10+
selectedRepository: RepositoryWithInfrastructure | null | undefined;
11+
selectedType: 'repository' | 'registry' | undefined;
12+
needAuthentication: boolean;
13+
aasList: AasListDto | undefined;
14+
selectedAasList: string[] | undefined;
15+
updateSelectedAasList: (isChecked: boolean, aasId: string | undefined) => void;
16+
comparisonFeatureFlag: boolean;
17+
pagination: ReactNode;
18+
};
19+
20+
export function AasListContent(props: AasListContentProps) {
21+
const t = useTranslations('pages.aasList');
22+
23+
if (!props.selectedRepository) {
24+
return (
25+
<Box>
26+
<Typography data-testid="select-repository-text">{t('selectListSource')}</Typography>
27+
</Box>
28+
);
29+
}
30+
31+
if (props.needAuthentication) {
32+
return <AuthenticationPrompt isDefaultRepo={props.selectedRepository?.isDefault} />;
33+
}
34+
35+
return (
36+
<>
37+
<AasList
38+
data-testid="aas-list"
39+
repositoryUrl={props.selectedRepository}
40+
connectionType={props.selectedType}
41+
shells={props.aasList}
42+
selectedAasList={props.selectedAasList}
43+
updateSelectedAasList={props.updateSelectedAasList}
44+
comparisonFeatureFlag={props.comparisonFeatureFlag}
45+
></AasList>
46+
{props.pagination}
47+
</>
48+
);
49+
}

src/app/[locale]/list/_components/AasListDataWrapper.tsx

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { getAasListEntities } from 'lib/services/list-service/aasListApiActions'
44
import { useShowError } from 'lib/hooks/UseShowError';
55
import { useState } from 'react';
66
import { CenteredLoadingSpinner } from 'components/basics/CenteredLoadingSpinner';
7-
import AasList from './AasList';
87
import { useEnv } from 'app/EnvProvider';
98
import { AasListComparisonHeader } from './AasListComparisonHeader';
109
import { Box, Card, CardContent, IconButton, Typography } from '@mui/material';
@@ -13,9 +12,9 @@ import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
1312
import { SelectListSource } from './filter/SelectListSource';
1413
import { useTranslations } from 'next-intl';
1514
import { ApiResponseWrapperError } from 'lib/util/apiResponseWrapper/apiResponseWrapper';
16-
import { AuthenticationPrompt } from 'components/authentication/AuthenticationPrompt';
1715
import { ApiResultStatus } from 'lib/util/apiResponseWrapper/apiResultStatus';
1816
import { RepositoryWithInfrastructure } from 'lib/services/database/InfrastructureMappedTypes';
17+
import { AasListContent } from './AasListContent';
1918

2019
type AasListDataWrapperProps = {
2120
repositoryUrl?: string;
@@ -47,10 +46,10 @@ export default function AasListDataWrapper({ hideRepoSelection }: AasListDataWra
4746
setNeedAuthentication(false);
4847
};
4948

50-
useAsyncEffect(async () => {
51-
resetPagination();
52-
await fetchListData();
53-
}, [selectedRepository]);
49+
const resetPagination = () => {
50+
setCursorHistory([]);
51+
setCurrentPage(0);
52+
};
5453

5554
const fetchListData = async (newCursor?: string | undefined, isNext = true) => {
5655
if (!selectedRepository) return;
@@ -82,6 +81,11 @@ export default function AasListDataWrapper({ hideRepoSelection }: AasListDataWra
8281
setCurrentPage((prevPage) => prevPage + 1);
8382
};
8483

84+
useAsyncEffect(async () => {
85+
resetPagination();
86+
await fetchListData();
87+
}, [selectedRepository]);
88+
8589
/**
8690
* Handle a click on the back button.
8791
* To load the page one step back, we need to use the cursor from two pages back.
@@ -92,11 +96,6 @@ export default function AasListDataWrapper({ hideRepoSelection }: AasListDataWra
9296
setCurrentPage((prevPage) => prevPage - 1);
9397
};
9498

95-
const resetPagination = () => {
96-
setCursorHistory([]);
97-
setCurrentPage(0);
98-
};
99-
10099
/**
101100
* Update the list of currently selected aas
102101
*/
@@ -132,36 +131,6 @@ export default function AasListDataWrapper({ hideRepoSelection }: AasListDataWra
132131
</Box>
133132
);
134133

135-
const ListContent = (props: { selectedRepository: RepositoryWithInfrastructure | null | undefined }) => {
136-
const selectedRepository = props.selectedRepository;
137-
if (!selectedRepository) {
138-
return (
139-
<Box>
140-
<Typography data-testid="select-repository-text">{t('selectListSource')}</Typography>
141-
</Box>
142-
);
143-
}
144-
145-
if (needAuthentication) {
146-
return <AuthenticationPrompt isDefaultRepo={selectedRepository?.isDefault} />;
147-
}
148-
149-
return (
150-
<>
151-
<AasList
152-
data-testid="aas-list"
153-
repositoryUrl={selectedRepository}
154-
connectionType={selectedType}
155-
shells={aasList}
156-
selectedAasList={selectedAasList}
157-
updateSelectedAasList={updateSelectedAasList}
158-
comparisonFeatureFlag={env.COMPARISON_FEATURE_FLAG}
159-
></AasList>
160-
{pagination}
161-
</>
162-
);
163-
};
164-
165134
return (
166135
<Card>
167136
<CardContent sx={{ paddingX: 0, paddingY: '1.625rem', '&:last-child': { paddingBottom: '0' } }}>
@@ -184,7 +153,16 @@ export default function AasListDataWrapper({ hideRepoSelection }: AasListDataWra
184153
{isLoadingList ? (
185154
<CenteredLoadingSpinner sx={{ my: 10 }} />
186155
) : (
187-
<ListContent selectedRepository={selectedRepository} />
156+
<AasListContent
157+
selectedRepository={selectedRepository}
158+
selectedType={selectedType}
159+
needAuthentication={needAuthentication}
160+
aasList={aasList}
161+
selectedAasList={selectedAasList}
162+
updateSelectedAasList={updateSelectedAasList}
163+
comparisonFeatureFlag={env.COMPARISON_FEATURE_FLAG}
164+
pagination={pagination}
165+
/>
188166
)}
189167
</CardContent>
190168
</Card>

src/app/[locale]/product/[base64AasId]/page.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ export default function Page() {
1515
const encodedRepoUrl = useSearchParams().get('repoUrl');
1616
const repoUrl = encodedRepoUrl ? decodeURI(encodedRepoUrl) : undefined;
1717
const infrastructureName = useSearchParams().get('infrastructure') || undefined;
18-
try {
19-
const aasIdDecoded = safeBase64Decode(base64AasId);
2018

21-
return (
22-
<CurrentAasContextProvider aasId={aasIdDecoded} repoUrl={repoUrl} infrastructureName={infrastructureName}>
23-
<ProductViewer />
24-
</CurrentAasContextProvider>
25-
);
19+
let aasIdDecoded: string | null = null;
20+
try {
21+
aasIdDecoded = safeBase64Decode(base64AasId);
2622
} catch (e) {
2723
showError(e);
24+
}
25+
26+
if (!aasIdDecoded) {
2827
return (
2928
<Box
3029
sx={{
@@ -41,4 +40,10 @@ export default function Page() {
4140
</Box>
4241
);
4342
}
43+
44+
return (
45+
<CurrentAasContextProvider aasId={aasIdDecoded} repoUrl={repoUrl} infrastructureName={infrastructureName}>
46+
<ProductViewer />
47+
</CurrentAasContextProvider>
48+
);
4449
}

0 commit comments

Comments
 (0)