Skip to content

Commit 697577c

Browse files
tjgoforemikkojamG
authored andcommitted
feat: react 19 and dependencies update
Refs: KK-1543
1 parent 04369f9 commit 697577c

70 files changed

Lines changed: 2181 additions & 3363 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
99
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
10+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1011

1112
- [Service architecture](#service-architecture)
1213
- [Environments](#environments)

docs/setup-keycloak.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
34

45
- [Using the Helsinki-Profile Keycloak](#using-the-helsinki-profile-keycloak)
56

docs/setup-local-kukkuu-api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
34

45
- [Use Kukkuu API locally](#use-kukkuu-api-locally)
56

docs/setup-tunnistamo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
34

45
- [Setting up Tunnistamo and Kukkuu API locally with Docker](#setting-up-tunnistamo-and-kukkuu-api-locally-with-docker)
56
- [Set Tunnistamo hostname](#set-tunnistamo-hostname)

package.json

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"@mui/material": "^5.14.11",
4848
"@mui/styles": "^5.14.11",
4949
"@nabla/vite-plugin-eslint": "^3.0.1",
50-
"@sentry/browser": "^10.25.0",
50+
"@sentry/browser": "^10.58.0",
51+
"@tanstack/react-query": "^5.101.0",
5152
"@testing-library/jest-dom": "^6.1.3",
5253
"@testing-library/react": "^14.0.0",
5354
"@testing-library/user-event": "^14.5.1",
@@ -57,8 +58,8 @@
5758
"@types/history": "^5.0.0",
5859
"@types/lodash": "^4.14.199",
5960
"@types/node": "^20.7.1",
60-
"@types/react": "^18.2.23",
61-
"@types/react-dom": "^18.2.8",
61+
"@types/react": "^19.2.3",
62+
"@types/react-dom": "^19.2.3",
6263
"@types/react-router": "^5.1.20",
6364
"@types/react-router-dom": "^5.3.3",
6465
"@typescript-eslint/eslint-plugin": "^8.57.1",
@@ -95,12 +96,12 @@
9596
"ra-language-english": "^4.14.3",
9697
"ra-language-finnish": "^4.13.0",
9798
"ra-language-swedish": "^1.0.0",
98-
"react": "^18.2.0",
99-
"react-admin": "^4.16.10",
100-
"react-dom": "^18.2.0",
99+
"react": "^19.2.7",
100+
"react-admin": "^5.14.7",
101+
"react-dom": "^19.2.7",
101102
"react-idle-timer": "^5.7.2",
102-
"typescript": "<5.4.0",
103-
"vite": "8.0.13",
103+
"typescript": "5.9.3",
104+
"vite": "8.0.16",
104105
"vitest": "^4.1.0",
105106
"vitest-localstorage-mock": "^0.1.2",
106107
"vitest-sonar-reporter": "^2.0.0",
@@ -121,12 +122,16 @@
121122
"husky": "^9.1.7",
122123
"jsdom": "^25.0.1",
123124
"lint-staged": "^15.4.3",
124-
"testcafe": "^3.7.1",
125+
"testcafe": "^15.1.3",
125126
"testcafe-reporter-html": "^1.4.6"
126127
},
127128
"resolutions": {
128129
"@types/minimatch": "^5.1.2",
129130
"lodash": "^4.18.1",
130-
"underscore": "^1.13.8"
131+
"underscore": "^1.13.8",
132+
"shell-quote": ">=1.8.4",
133+
"form-data": ">=4.0.6",
134+
"qs": ">=6.2.4",
135+
"ws": ">=8.21.0"
131136
}
132137
}

src/common/components/appBar/KukkuuAppBar.tsx

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
11
import * as React from 'react';
22
import { AppBar } from 'react-admin';
3-
import classNames from 'classnames';
43
import { Typography } from '@mui/material';
5-
import { makeStyles } from '@mui/styles';
64

75
import Config from '../../../domain/config';
86
import ProfileProjectDropdown from '../../../domain/profile/ProfileProjectDropdown';
97
import AppTitle from '../appTitle/AppTitle';
108
import IdleTimer from '../../../domain/authentication/IdleTimer';
119

12-
const useStyles = makeStyles({
13-
title: {
14-
flex: 1,
15-
textOverflow: 'ellipsis',
16-
whiteSpace: 'nowrap',
17-
overflow: 'hidden',
18-
},
19-
spacer: {
20-
flex: 1,
21-
},
22-
highlight: {
23-
backgroundColor: '#00D7A7 !important',
24-
},
25-
});
26-
2710
const KukkuuAppBar = ({ className }: { className?: string }) => {
28-
const classes = useStyles();
29-
3011
const isTestEnvironment = Config.IS_TEST_ENVIRONMENT;
3112

3213
/* note: the idle timer is placed here as its the first available shared place for components
3314
due to the react-admin architecture
3415
*/
3516
return (
3617
<AppBar
37-
className={classNames(className, {
38-
[classes.highlight]: isTestEnvironment,
39-
})}
18+
className={className}
19+
sx={
20+
isTestEnvironment
21+
? { backgroundColor: '#00D7A7 !important' }
22+
: undefined
23+
}
4024
>
4125
<IdleTimer>
42-
<Typography variant="h6" color="inherit" className={classes.title}>
26+
<Typography
27+
variant="h6"
28+
color="inherit"
29+
sx={{
30+
flex: 1,
31+
textOverflow: 'ellipsis',
32+
whiteSpace: 'nowrap',
33+
overflow: 'hidden',
34+
}}
35+
>
4336
<AppTitle />
4437
</Typography>
45-
<div className={classes.spacer} />
38+
<div style={{ flex: 1 }} />
4639
<ProfileProjectDropdown />
4740
</IdleTimer>
4841
</AppBar>

src/common/components/breadcrumbs/Breadcrumbs.tsx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
11
import React from 'react';
22
import { Link } from 'react-admin';
33
import { Typography } from '@mui/material';
4-
import { makeStyles } from '@mui/styles';
54
import Breadcrumbs from '@mui/material/Breadcrumbs';
6-
import { useLocation } from 'react-router';
5+
import { useLocation } from 'react-router-dom';
76

87
export type Crumb = {
98
label: string;
109
link: string | null;
1110
};
1211

13-
const useStyles = makeStyles((theme) => ({
14-
crumb: {
15-
fontSize: theme.typography.body2.fontSize,
16-
fontWeight: theme.typography.fontWeightBold,
17-
},
18-
wrapper: {
19-
'& .MuiBreadcrumbs-separator': {
20-
fontWeight: theme.typography.fontWeightBold,
21-
},
22-
},
23-
}));
24-
2512
type CrumbsProps = {
2613
className: string;
2714
crumbs: Crumb[];
2815
};
2916

3017
const BreadCrumbs = ({ className, crumbs }: CrumbsProps) => {
31-
const classes = useStyles();
3218
const location = useLocation();
3319

3420
return (
3521
<Breadcrumbs
3622
separator="<"
37-
className={[classes.wrapper, className].join(' ')}
23+
className={className}
24+
sx={(theme) => ({
25+
'& .MuiBreadcrumbs-separator': {
26+
fontWeight: theme.typography.fontWeightBold,
27+
},
28+
})}
3829
>
3930
{
4031
// The breadcrumbs component adds a separator between all
@@ -48,7 +39,14 @@ const BreadCrumbs = ({ className, crumbs }: CrumbsProps) => {
4839

4940
if (isActive) {
5041
return (
51-
<Typography key={key} color="textPrimary" className={classes.crumb}>
42+
<Typography
43+
key={key}
44+
color="textPrimary"
45+
sx={(theme) => ({
46+
fontSize: theme.typography.body2.fontSize,
47+
fontWeight: theme.typography.fontWeightBold,
48+
})}
49+
>
5250
{label}
5351
</Typography>
5452
);
@@ -59,7 +57,15 @@ const BreadCrumbs = ({ className, crumbs }: CrumbsProps) => {
5957
}
6058

6159
return (
62-
<Link key={key} color="inherit" to={link} className={classes.crumb}>
60+
<Link
61+
key={key}
62+
color="inherit"
63+
to={link}
64+
sx={(theme) => ({
65+
fontSize: theme.typography.body2.fontSize,
66+
fontWeight: theme.typography.fontWeightBold,
67+
})}
68+
>
6369
{label}
6470
</Link>
6571
);

src/common/components/breadcrumbs/__tests__/Breadcrumbs.test.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
33
import { AdminContext } from 'react-admin';
4+
import { MemoryRouter } from 'react-router-dom';
45

56
import Breadcrumbs from '../Breadcrumbs';
67

@@ -19,9 +20,11 @@ const defaultProps = {
1920
};
2021
const getWrapper = (props) =>
2122
render(
22-
<AdminContext>
23-
<Breadcrumbs {...defaultProps} {...props} />
24-
</AdminContext>
23+
<MemoryRouter>
24+
<AdminContext>
25+
<Breadcrumbs {...defaultProps} {...props} />
26+
</AdminContext>
27+
</MemoryRouter>
2528
);
2629

2730
describe('Breadcrumbs', () => {

src/common/components/confirmMutationButton/ConfirmMutationButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { type ReactElement, type ReactText, useState } from 'react';
1+
import React, { type ReactElement, useState } from 'react';
22
import { Button, Confirm } from 'react-admin';
3-
import type { useMutation } from 'react-query';
3+
import type { useMutation } from '@tanstack/react-query';
44

55
import type {
66
MethodHandlerResponse,
@@ -23,15 +23,15 @@ type Props = {
2323
confirmModalProps: {
2424
title: string;
2525
content: string;
26-
translateOptions?: Record<string, ReactText>;
26+
translateOptions?: Record<string, string>;
2727
};
2828
icon?: ReactElement;
2929
};
3030

3131
const ConfirmMutationButton = ({
3232
className,
3333
buttonLabel,
34-
mutation: { mutate: applyMutation, isLoading },
34+
mutation: { mutate: applyMutation, isPending: isLoading },
3535
confirmModalProps: { title, content, translateOptions },
3636
icon: Icon,
3737
}: Props) => {

src/common/components/confirmMutationButton/__tests__/ConfirmMutationButton.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@testing-library/react';
88
import { AdminContext } from 'react-admin';
99
import { ThemeProvider, StyledEngineProvider } from '@mui/material';
10-
import { createTheme } from '@mui/material/styles/';
10+
import { createTheme } from '@mui/material';
1111

1212
import ConfirmMutationButton from '../ConfirmMutationButton';
1313

0 commit comments

Comments
 (0)