Skip to content

Commit 8334509

Browse files
committed
Merge branch 'react-18-#1205' into increase-toast-functionailty-#355
2 parents 425e2f4 + 4df6e62 commit 8334509

Some content is hidden

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

43 files changed

+6291
-6191
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
'react-app',
1111
'plugin:react/recommended',
1212
'plugin:@typescript-eslint/recommended',
13+
'plugin:@typescript-eslint/stylistic',
1314
'prettier',
1415
'plugin:cypress/recommended',
1516
],

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 0 additions & 28 deletions
This file was deleted.

.yarn/releases/yarn-3.8.0.cjs

Lines changed: 0 additions & 875 deletions
This file was deleted.

.yarn/releases/yarn-4.1.0.cjs

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
nodeLinker: node-modules
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
24

3-
plugins:
4-
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
5-
spec: "@yarnpkg/plugin-workspace-tools"
5+
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-3.8.0.cjs
7+
yarnPath: .yarn/releases/yarn-4.1.0.cjs

package.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
"private": true,
55
"resolutions": {
66
"@types/react": "18.0.33",
7-
"@types/react-dom": "18.0.11"
7+
"@types/react-dom": "18.0.11",
8+
"@typescript-eslint/eslint-plugin": "7.0.2",
9+
"@typescript-eslint/parser": "7.0.2"
810
},
911
"dependencies": {
1012
"@emotion/react": "11.11.1",
1113
"@emotion/styled": "11.11.0",
12-
"@mui/icons-material": "5.10.3",
13-
"@mui/material": "5.10.0",
14-
"@types/history": "4.7.3",
14+
"@mui/icons-material": "5.15.10",
15+
"@mui/material": "5.15.10",
16+
"@types/history": "4.7.11",
1517
"@types/jest": "29.5.2",
1618
"@types/js-cookie": "3.0.1",
1719
"@types/react-dom": "18.0.11",
@@ -23,9 +25,9 @@
2325
"cookie-parser": "1.4.5",
2426
"custom-event-polyfill": "1.0.7",
2527
"cypress-failed-log": "2.10.0",
26-
"eslint-config-prettier": "8.10.0",
28+
"eslint-config-prettier": "9.1.0",
2729
"eslint-plugin-cypress": "2.15.1",
28-
"eslint-plugin-prettier": "4.2.1",
30+
"eslint-plugin-prettier": "5.1.3",
2931
"express": "4.18.1",
3032
"husky": "9.0.6",
3133
"i18next": "23.8.2",
@@ -34,7 +36,7 @@
3436
"js-cookie": "3.0.1",
3537
"jsonwebtoken": "9.0.0",
3638
"loglevel": "1.9.1",
37-
"prettier": "2.8.0",
39+
"prettier": "3.2.5",
3840
"prop-types": "15.8.1",
3941
"query-string": "7.1.1",
4042
"react": "18.2.0",
@@ -48,7 +50,7 @@
4850
"react-scripts": "5.0.0",
4951
"redux": "4.2.1",
5052
"redux-logger": "3.0.6",
51-
"redux-thunk": "2.4.1",
53+
"redux-thunk": "3.1.0",
5254
"single-spa": "5.9.4",
5355
"typeface-roboto": "1.1.13",
5456
"typescript": "5.3.3"
@@ -111,13 +113,13 @@
111113
"@types/react-redux": "7.1.20",
112114
"@types/react-router": "5.1.20",
113115
"@types/redux-mock-store": "1.0.2",
114-
"@typescript-eslint/eslint-plugin": "5.62.0",
115-
"@typescript-eslint/parser": "5.62.0",
116+
"@typescript-eslint/eslint-plugin": "7.0.2",
117+
"@typescript-eslint/parser": "7.0.2",
116118
"axios-mock-adapter": "1.22.0",
117119
"concurrently": "8.2.0",
118120
"cors": "2.8.5",
119121
"cross-env": "7.0.3",
120-
"cypress": "12.17.1",
122+
"cypress": "13.6.4",
121123
"eslint": "8.56.0",
122124
"eslint-config-react-app": "7.0.0",
123125
"lint-staged": "15.2.0",
@@ -126,5 +128,5 @@
126128
"start-server-and-test": "2.0.0",
127129
"wait-on": "7.2.0"
128130
},
129-
"packageManager": "yarn@3.8.0"
131+
"packageManager": "yarn@4.1.0"
130132
}

src/App.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as React from 'react';
55
import { Provider } from 'react-redux';
66
import { AnyAction, applyMiddleware, compose, createStore } from 'redux';
77
import { createLogger } from 'redux-logger';
8-
import thunk, { ThunkDispatch } from 'redux-thunk';
8+
import { thunk, ThunkDispatch } from 'redux-thunk';
99
import {
1010
configureSite,
1111
loadMaintenanceState,
@@ -71,24 +71,27 @@ class App extends React.Component<WithTranslation> {
7171
public componentDidMount(): void {
7272
// Check for changes in maintenance state. Ensures that state changes are
7373
// loaded when a user does not reload the site for longer than 5 minutes.
74-
setInterval(() => {
75-
const provider = getState().scigateway.authorisation.provider;
76-
if (provider.fetchMaintenanceState) {
77-
const storedMaintenanceState = getState().scigateway.maintenance;
78-
provider.fetchMaintenanceState().then((fetchedMaintenanceState) => {
79-
if (
80-
storedMaintenanceState.show !== fetchedMaintenanceState.show ||
81-
storedMaintenanceState.message !== fetchedMaintenanceState.message
82-
) {
83-
dispatch(loadMaintenanceState(fetchedMaintenanceState));
74+
setInterval(
75+
() => {
76+
const provider = getState().scigateway.authorisation.provider;
77+
if (provider.fetchMaintenanceState) {
78+
const storedMaintenanceState = getState().scigateway.maintenance;
79+
provider.fetchMaintenanceState().then((fetchedMaintenanceState) => {
80+
if (
81+
storedMaintenanceState.show !== fetchedMaintenanceState.show ||
82+
storedMaintenanceState.message !== fetchedMaintenanceState.message
83+
) {
84+
dispatch(loadMaintenanceState(fetchedMaintenanceState));
8485

85-
// Reload the page if maintenance state changes from true to false
86-
if (storedMaintenanceState.show && !fetchedMaintenanceState.show)
87-
window.location.reload();
88-
}
89-
});
90-
}
91-
}, 1000 * 60 * 5);
86+
// Reload the page if maintenance state changes from true to false
87+
if (storedMaintenanceState.show && !fetchedMaintenanceState.show)
88+
window.location.reload();
89+
}
90+
});
91+
}
92+
},
93+
1000 * 60 * 5
94+
);
9295
}
9396

9497
public render(): React.ReactElement {

src/__snapshots__/pageContainer.test.tsx.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
6262
viewBox="0 0 24 24"
6363
>
6464
<path
65-
d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"
65+
d="M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
6666
/>
6767
</svg>
6868
<span
@@ -71,7 +71,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
7171
</button>
7272
<button
7373
aria-label="home-page"
74-
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium tour-title css-bj8lf8-MuiButtonBase-root-MuiButton-root"
74+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium tour-title css-bj8lf8-MuiButtonBase-root-MuiButton-root"
7575
tabindex="0"
7676
type="button"
7777
>
@@ -91,7 +91,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
9191
class="tour-user-profile"
9292
>
9393
<button
94-
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-1yxmrfv-MuiButtonBase-root-MuiButton-root"
94+
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-1yxmrfv-MuiButtonBase-root-MuiButton-root"
9595
tabindex="0"
9696
type="button"
9797
>
@@ -120,7 +120,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
120120
viewBox="0 0 24 24"
121121
>
122122
<path
123-
d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
123+
d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
124124
/>
125125
</svg>
126126
<span
@@ -209,7 +209,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
209209
class="MuiBox-root css-1yuhvjn"
210210
>
211211
<a
212-
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
212+
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
213213
data-testid="browse-button"
214214
href="/home-page.browse.link"
215215
tabindex="0"
@@ -237,7 +237,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
237237
class="MuiBox-root css-1onku40"
238238
>
239239
<div
240-
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1ukwqwi-MuiAvatar-root"
240+
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-jftqyy-MuiAvatar-root"
241241
>
242242
<svg
243243
aria-hidden="true"
@@ -247,7 +247,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
247247
viewBox="0 0 24 24"
248248
>
249249
<path
250-
d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"
250+
d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"
251251
/>
252252
</svg>
253253
</div>
@@ -265,7 +265,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
265265
class="MuiBox-root css-8xl60i"
266266
>
267267
<a
268-
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
268+
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
269269
data-testid="search-button"
270270
href="/home-page.search.link"
271271
tabindex="0"
@@ -289,7 +289,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
289289
class="MuiBox-root css-1onku40"
290290
>
291291
<div
292-
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-1ukwqwi-MuiAvatar-root"
292+
class="MuiAvatar-root MuiAvatar-circular MuiAvatar-colorDefault css-jftqyy-MuiAvatar-root"
293293
>
294294
<svg
295295
aria-hidden="true"
@@ -299,7 +299,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
299299
viewBox="0 0 24 24"
300300
>
301301
<path
302-
d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"
302+
d="M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"
303303
/>
304304
</svg>
305305
</div>
@@ -317,7 +317,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
317317
class="MuiBox-root css-8xl60i"
318318
>
319319
<a
320-
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
320+
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-2ttl85-MuiButtonBase-root-MuiButton-root"
321321
data-testid="download-button"
322322
href="/home-page.download.link"
323323
tabindex="0"
@@ -357,7 +357,7 @@ exports[`PageContainer - Tests renders correctly 1`] = `
357357
class="MuiBox-root css-8xl60i"
358358
>
359359
<a
360-
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-1h8ppsl-MuiButtonBase-root-MuiButton-root"
360+
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium css-1h8ppsl-MuiButtonBase-root-MuiButton-root"
361361
data-testid="facility-button"
362362
href="home-page.facility.link"
363363
tabindex="0"

src/accessibilityPage/__snapshots__/accessibilityPage.component.test.tsx.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ exports[`Accessibility page component should render correctly and display contac
2424
>
2525
<li>
2626
<a
27-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
27+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
2828
href="accessibility-page.domains-list0"
2929
>
3030
accessibility-page.domains-list0
3131
</a>
3232
</li>
3333
<li>
3434
<a
35-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
35+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
3636
href="accessibility-page.domains-list1"
3737
>
3838
accessibility-page.domains-list1
@@ -73,7 +73,7 @@ exports[`Accessibility page component should render correctly and display contac
7373
class="MuiTypography-root MuiTypography-body1 css-158lj4w-MuiTypography-root"
7474
>
7575
<a
76-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
76+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
7777
href="accessibility-page.advice-on-how-to-make-device-more-accessible-link"
7878
>
7979
AbilityNet
@@ -123,7 +123,7 @@ exports[`Accessibility page component should render correctly and display contac
123123
class="MuiTypography-root MuiTypography-body1 css-158lj4w-MuiTypography-root"
124124
>
125125
<a
126-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
126+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
127127
href="mailto:accessibility-page.contact-info"
128128
>
129129
accessibility-page.contact-info
@@ -145,7 +145,7 @@ exports[`Accessibility page component should render correctly and display contac
145145
>
146146
The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint,
147147
<a
148-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
148+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
149149
href="accessibility-page.enforcement-procedure-link"
150150
>
151151
contact the Equality Advisory and Support Service (EASS)
@@ -175,7 +175,7 @@ exports[`Accessibility page component should render correctly and display contac
175175
>
176176
This website is partially compliant with the
177177
<a
178-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
178+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
179179
href="accessibility-page.compliance-status-link"
180180
>
181181
Web Content Accessibility Guidelines version 2.1
@@ -270,7 +270,7 @@ exports[`Accessibility page component should render correctly and display contac
270270
>
271271
We have assessed the time it would take to resolve these issues with table view, and card view. We believe that doing so now would be a
272272
<a
273-
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17t6e9i-MuiTypography-root-MuiLink-root"
273+
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-qwtsl2-MuiTypography-root-MuiLink-root"
274274
href="accessibility-page.disproportionate-burden.link"
275275
>
276276
disproportionate burden

src/accessibilityPage/accessibilityPage.component.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { StateType } from '../state/state.types';
66
import { authState, initialState } from '../state/reducers/scigateway.reducer';
77
import { createLocation } from 'history';
88
import configureStore from 'redux-mock-store';
9-
import thunk from 'redux-thunk';
9+
import { thunk } from 'redux-thunk';
1010
import { Provider } from 'react-redux';
1111
import { render } from '@testing-library/react';
1212

0 commit comments

Comments
 (0)