Skip to content

Commit b2c5bec

Browse files
authored
Merge pull request #149 from ModusCreateOrg/upgrade-frontend-packages
Upgrade frontend packages
2 parents 50a4143 + 946c1f6 commit b2c5bec

18 files changed

+6054
-13463
lines changed

frontend/package-lock.json

Lines changed: 5442 additions & 12746 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939
]
4040
},
4141
"dependencies": {
42-
"@aws-amplify/auth": "^6.12.3",
43-
"@aws-amplify/core": "^6.11.3",
44-
"@aws-amplify/ui-react": "^6.11.1",
45-
"@aws-sdk/client-bedrock-runtime": "^3.797.0",
46-
"@aws-sdk/client-s3": "^3.797.0",
47-
"@aws-sdk/s3-request-presigner": "^3.797.0",
42+
"@aws-sdk/client-bedrock-runtime": "^3.799.0",
43+
"@aws-sdk/client-cognito-identity-provider": "^3.799.0",
44+
"@aws-sdk/client-s3": "^3.802.0",
45+
"@aws-sdk/s3-request-presigner": "^3.802.0",
4846
"@capacitor/android": "^7.2.0",
4947
"@capacitor/app": "^7.0.1",
5048
"@capacitor/assets": "^3.0.5",
@@ -59,63 +57,64 @@
5957
"@fortawesome/free-regular-svg-icons": "^6.7.2",
6058
"@fortawesome/free-solid-svg-icons": "^6.7.2",
6159
"@fortawesome/react-fontawesome": "^0.2.2",
62-
"@ionic/react": "^8.5.5",
63-
"@ionic/react-router": "^8.5.5",
64-
"@tanstack/react-query": "^5.74.4",
65-
"@tanstack/react-query-devtools": "^5.74.6",
60+
"@ionic/react": "^8.5.6",
61+
"@ionic/react-router": "^8.5.6",
62+
"@tanstack/react-query": "^5.75.2",
63+
"@tanstack/react-query-devtools": "^5.75.2",
6664
"axios": "1.9.0",
6765
"classnames": "2.5.1",
6866
"date-fns": "^4.1.0",
6967
"dayjs": "^1.11.13",
7068
"formik": "^2.4.6",
71-
"i18next": "24.2.1",
72-
"i18next-browser-languagedetector": "8.0.2",
69+
"i18next": "25.0.2",
70+
"i18next-browser-languagedetector": "8.1.0",
7371
"lodash": "4.17.21",
74-
"react": "18.3.1",
75-
"react-dom": "18.3.1",
76-
"react-error-boundary": "5.0.0",
77-
"react-i18next": "15.4.0",
72+
"react": "19.1.0",
73+
"react-dom": "19.1.0",
74+
"react-error-boundary": "6.0.0",
75+
"react-i18next": "15.5.1",
7876
"react-router": "5.3.4",
7977
"react-router-dom": "5.3.4",
8078
"uuid": "^11.1.0",
8179
"yup": "^1.6.1"
8280
},
8381
"devDependencies": {
8482
"@capacitor/cli": "^7.2.0",
85-
"@eslint/js": "^9.25.1",
83+
"@eslint/js": "^9.26.0",
8684
"@testing-library/dom": "^10.4.0",
8785
"@testing-library/jest-dom": "^6.6.3",
8886
"@testing-library/react": "^16.3.0",
8987
"@testing-library/user-event": "^14.6.1",
90-
"@types/eslint__js": "8.42.3",
91-
"@types/lodash": "4.17.14",
92-
"@types/react": "18.3.11",
93-
"@types/react-dom": "18.3.1",
88+
"@types/eslint": "^9.6.1",
89+
"@types/eslint__js": "9.14.0",
90+
"@types/lodash": "4.17.16",
91+
"@types/react": "19.1.2",
92+
"@types/react-dom": "19.1.3",
9493
"@types/react-router": "5.1.20",
9594
"@types/react-router-dom": "5.3.3",
9695
"@types/uuid": "^10.0.0",
97-
"@typescript-eslint/eslint-plugin": "^8.31.0",
98-
"@typescript-eslint/parser": "^8.31.0",
99-
"@vitejs/plugin-legacy": "6.1.0",
96+
"@typescript-eslint/eslint-plugin": "^8.31.1",
97+
"@typescript-eslint/parser": "^8.31.1",
98+
"@vitejs/plugin-legacy": "6.1.1",
10099
"@vitejs/plugin-react": "4.4.1",
101100
"@vitest/coverage-v8": "^3.1.2",
102-
"eslint": "^9.25.1",
101+
"eslint": "^9.26.0",
103102
"eslint-plugin-react": "^7.37.5",
104103
"eslint-plugin-react-hooks": "^5.2.0",
105104
"eslint-plugin-react-refresh": "^0.4.20",
106-
"globals": "15.14.0",
105+
"globals": "16.0.0",
107106
"husky": "^9.1.7",
108107
"jsdom": "^26.1.0",
109108
"lint-staged": "^15.5.1",
110109
"msw": "^2.7.5",
111110
"prettier": "^3.5.3",
112-
"sass": "1.83.1",
111+
"sass": "1.87.0",
113112
"stylelint": "^16.19.1",
114113
"stylelint-config-standard-scss": "^14.0.0",
115114
"stylelint-scss": "^6.11.1",
116-
"terser": "5.37.0",
117-
"typescript": "5.7.2",
118-
"typescript-eslint": "^8.31.0",
115+
"terser": "5.39.0",
116+
"typescript": "5.8.3",
117+
"typescript-eslint": "^8.31.1",
119118
"vite": "6.3.4",
120119
"vitest": "^3.1.2"
121120
}

frontend/src/common/api/__tests__/reportService.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ vi.mock('axios', () => ({
2222
},
2323
}));
2424

25-
// Mock auth
26-
vi.mock('@aws-amplify/auth', () => ({
27-
fetchAuthSession: vi.fn().mockResolvedValue({
28-
tokens: {
29-
idToken: {
30-
toString: () => 'mock-id-token',
31-
},
32-
},
33-
}),
34-
}));
35-
3625
// Mock dynamic imports to handle the service functions
3726
vi.mock('../reportService', async (importOriginal) => {
3827
const actual = (await importOriginal()) as typeof ReportServiceModule;

frontend/src/common/api/reportService.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import axios, { AxiosProgressEvent } from 'axios';
22
import { MedicalReport } from '../models/medicalReport';
3-
import { fetchAuthSession } from '@aws-amplify/auth';
3+
import { DirectCognitoAuthService } from '../services/auth/direct-cognito-auth-service';
4+
45
// Get the API URL from environment variables
56
const API_URL = import.meta.env.VITE_BASE_URL_API || '';
67

@@ -21,8 +22,10 @@ export const getAuthConfig = async (
2122
signal?: AbortSignal;
2223
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void;
2324
}> => {
24-
const session = await fetchAuthSession();
25-
const idToken = session.tokens?.idToken?.toString() || '';
25+
// Get tokens from DirectCognitoAuthService
26+
const tokens = DirectCognitoAuthService.getTokens();
27+
const idToken = tokens?.id_token || '';
28+
2629
return {
2730
headers: {
2831
Accept: 'application/json',

frontend/src/common/api/useGetCurrentUser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
22

33
import { CognitoUser } from 'common/models/user';
44
import { QueryKey } from 'common/utils/constants';
5-
import CognitoAuthService from 'common/services/auth/cognito-auth-service';
5+
import { DirectCognitoAuthService } from 'common/services/auth/direct-cognito-auth-service';
66
import { mapCognitoUserToAppUser } from 'common/utils/user-mapper';
77

88
/**
@@ -17,7 +17,7 @@ export const useGetCurrentUser = () => {
1717
const getCurentUser = async (): Promise<CognitoUser> => {
1818
try {
1919
// Get current user from Cognito
20-
const cognitoUser = await CognitoAuthService.getCurrentUser();
20+
const cognitoUser = await DirectCognitoAuthService.getCurrentUser();
2121

2222
if (!cognitoUser) {
2323
throw new Error('User not found');

frontend/src/common/api/useGetUserTokens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useQuery } from '@tanstack/react-query';
22

33
import { UserTokens } from 'common/models/auth';
44
import { QueryKey } from 'common/utils/constants';
5-
import CognitoAuthService from 'common/services/auth/cognito-auth-service';
5+
import { DirectCognitoAuthService } from 'common/services/auth/direct-cognito-auth-service';
66

77
/**
88
* An API hook which fetches tokens from AWS Cognito.
@@ -11,8 +11,8 @@ import CognitoAuthService from 'common/services/auth/cognito-auth-service';
1111
export const useGetUserTokens = () => {
1212
const getUserTokens = async (): Promise<UserTokens> => {
1313
try {
14-
// Get tokens from Cognito
15-
const tokens = await CognitoAuthService.getUserTokens();
14+
// Get tokens directly from DirectCognitoAuthService
15+
const tokens = DirectCognitoAuthService.getTokens();
1616

1717
if (!tokens) {
1818
throw new Error('Tokens not found.');

frontend/src/common/config/aws-config.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,3 @@ export const COGNITO_CONFIG = {
4141
// Social providers
4242
SOCIAL_PROVIDERS: ['Google', 'SignInWithApple'],
4343
};
44-
45-
/**
46-
* Get redirect URLs for OAuth
47-
*/
48-
const redirectUrls = {
49-
signIn: [APP_CONFIG.hostedRedirectSignIn],
50-
signOut: [APP_CONFIG.hostedRedirectSignOut],
51-
};
52-
53-
/**
54-
* Amplify Configuration object for initializing Amplify (V6 format)
55-
*/
56-
export const amplifyConfig = {
57-
Auth: {
58-
Cognito: {
59-
userPoolId: COGNITO_CONFIG.USER_POOL_ID,
60-
userPoolClientId: COGNITO_CONFIG.USER_POOL_WEB_CLIENT_ID,
61-
identityPoolId: COGNITO_CONFIG.IDENTITY_POOL_ID,
62-
loginWith: {
63-
email: true,
64-
phone: false,
65-
username: false,
66-
oauth: {
67-
domain: COGNITO_CONFIG.OAUTH_DOMAIN,
68-
scopes: COGNITO_CONFIG.OAUTH_SCOPES,
69-
redirectSignIn: redirectUrls.signIn,
70-
redirectSignOut: redirectUrls.signOut,
71-
responseType: 'code' as const,
72-
},
73-
},
74-
},
75-
},
76-
// Configure only the region you need to use
77-
region: REGION,
78-
};

0 commit comments

Comments
 (0)