Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"singleQuote": true
}
18,021 changes: 10,801 additions & 7,220 deletions package-lock.json

Large diffs are not rendered by default.

77 changes: 40 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,50 @@
"npm": "^10.2.0"
},
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@gridsuite/commons-ui": "0.51.0",
"@hookform/resolvers": "^3.3.1",
"@mui/icons-material": "^5.5.1",
"@mui/lab": "^5.0.0-alpha.75",
"@mui/material": "^5.5.3",
"@reduxjs/toolkit": "^1.2.3",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@gridsuite/commons-ui": "^0.52.1",
"@hookform/resolvers": "^3.3.4",
"@mui/icons-material": "^5.15.14",
"@mui/lab": "5.0.0-alpha.169",
"@mui/x-tree-view": "^6.17.0",
"@mui/material": "^5.15.14",
"@reduxjs/toolkit": "^2.2.3",
"@types/core-js": "^2.5.8",
"@types/node": "^18.19.3",
"@types/prop-types": "^15.7.11",
"@types/react": "^18.2.9",
"@types/react-dom": "^18.2.4",
"@types/node": "^20.12.2",
"@types/prop-types": "^15.7.12",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@types/react-window": "^1.8.8",
"ag-grid-community": "^31.1.1",
"ag-grid-react": "^31.1.1",
"core-js": "^3.6.4",
"notistack": "^3.0.0",
"oidc-client": "^1.10.1",
"prop-types": "^15.7.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-hook-form": "^7.46.1",
"react-intl": "^6.0.0",
"react-redux": "^8.0.0",
"react-router-dom": "^6.0.0",
"react-scripts": "^5.0.0",
"react-window": "^1.8.5",
"ag-grid-react": "^31.2.0",
"core-js": "^3.36.1",
"notistack": "^3.0.1",
"oidc-client": "^1.11.5",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.2",
"react-intl": "^6.6.4",
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.3",
"react-scripts": "^5.0.1",
"react-window": "^1.8.10",
"reconnecting-websocket": "^4.4.0",
"redux": "^4.0.5",
"type-fest": "^4.11.1",
"typeface-roboto": "^1.0.0",
"typescript": "^5.1.3",
"yup": "^1.2.0"
"redux": "^5.0.1",
"type-fest": "^4.14.0",
"typeface-roboto": "^1.1.13",
"typescript": "5.1.6",
"yup": "^1.4.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll=false",
"test:watch": "react-scripts test",
"test:coverage": "react-scripts test --coverage",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0"
},
"jest": {
"moduleNameMapper": {
Expand Down Expand Up @@ -88,13 +90,14 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint-plugin-prettier": "^3.1.3",
"@types/jest": "^27.5.1",
"@types/prettier": "^2.0.2",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^4.0.0",
"http-proxy-middleware": "^2.0.0",
"prettier": "^2.0.0"
"@types/jest": "^29.5.12",
"@types/prettier": "^3.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^4.2.1",
"http-proxy-middleware": "^2.0.6",
"prettier": "^2.8.8"
}
}
1 change: 1 addition & 0 deletions src/components/Grid/AgGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type AgGridRef<TData, TContext extends {}> = {
*/
type ForwardRef<Props, Ref> = typeof forwardRef<Props, Ref>;
type ForwardRefComponent<Props, Ref> = ReturnType<ForwardRef<Props, Ref>>;

interface AgGridWithRef extends FunctionComponent<GridOptions<unknown>> {
<TData, TContext extends {}>(
props: PropsWithoutRef<GridOptions<TData>> &
Expand Down
1 change: 1 addition & 0 deletions src/components/Grid/GridTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface GridTableProps<TData>
*/
type ForwardRef<Props, Ref> = typeof forwardRef<Props, Ref>;
type ForwardRefComponent<Props, Ref> = ReturnType<ForwardRef<Props, Ref>>;

interface GridTableWithRef
extends FunctionComponent<PropsWithChildren<GridTableProps<unknown>>> {
<TData, TContext extends {}>(
Expand Down
11 changes: 7 additions & 4 deletions src/pages/users/UsersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ import {
import { UserAdminSrv, UserInfos } from '../../services';
import { useSnackMessage } from '@gridsuite/commons-ui';
import { Controller, SubmitHandler, useForm } from 'react-hook-form';
import { GetRowIdParams } from 'ag-grid-community/dist/lib/interfaces/iCallbackParams';
import { TextFilterParams } from 'ag-grid-community/dist/lib/filter/provided/text/textFilter';
import { ColDef, ICheckboxCellRendererParams } from 'ag-grid-community';
import { SelectionChangedEvent } from 'ag-grid-community/dist/lib/events';
import {
ColDef,
GetRowIdParams,
ICheckboxCellRendererParams,
SelectionChangedEvent,
TextFilterParams,
} from 'ag-grid-community';

const defaultColDef: ColDef<UserInfos> = {
editable: false,
Expand Down
156 changes: 85 additions & 71 deletions src/redux/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,77 +85,91 @@ export type AppStateKey = keyof AppState;

export const reducer: ReducerWithInitialState<AppState> = createReducer(
initialState,
{
[SELECT_THEME]: (state: Draft<AppState>, action: ThemeAction) => {
state.theme = action.theme;
saveLocalStorageTheme(state.theme);
},

[UPDATE_USER_MANAGER_STATE]: (
state: Draft<AppState>,
action: UserManagerAction
) => {
state.userManager = action.userManager;
},
[UPDATE_USER_MANAGER_INSTANCE]: (
state: Draft<AppState>,
action: UserManagerInstanceAction
) => {
state.userManager.instance = action.instance;
},
[UPDATE_USER_MANAGER_ERROR]: (
state: Draft<AppState>,
action: UserManagerErrorAction
) => {
state.userManager.error = action.error;
},

[USER]: (state: Draft<AppState>, action: AnyAction) => {
(builder) => {
builder.addCase(
SELECT_THEME,
(state: Draft<AppState>, action: ThemeAction) => {
state.theme = action.theme;
saveLocalStorageTheme(state.theme);
}
);

builder.addCase(
UPDATE_USER_MANAGER_STATE,
(state: Draft<AppState>, action: UserManagerAction) => {
state.userManager = action.userManager;
}
);

builder.addCase(
UPDATE_USER_MANAGER_INSTANCE,
(state: Draft<AppState>, action: UserManagerInstanceAction) => {
state.userManager.instance = action.instance;
}
);

builder.addCase(
UPDATE_USER_MANAGER_ERROR,
(state: Draft<AppState>, action: UserManagerErrorAction) => {
state.userManager.error = action.error;
}
);

builder.addCase(USER, (state: Draft<AppState>, action: AnyAction) => {
state.user = action.user;
},

[SIGNIN_CALLBACK_ERROR]: (
state: Draft<AppState>,
action: AnyAction
) => {
state.signInCallbackError = action.signInCallbackError;
},

[UNAUTHORIZED_USER_INFO]: (
state: Draft<AppState>,
action: AnyAction
) => {
state.authenticationRouterError = action.authenticationRouterError;
},

[LOGOUT_ERROR]: (state: Draft<AppState>, action: AnyAction) => {
state.authenticationRouterError = action.authenticationRouterError;
},

[USER_VALIDATION_ERROR]: (
state: Draft<AppState>,
action: AnyAction
) => {
state.authenticationRouterError = action.authenticationRouterError;
},

[RESET_AUTHENTICATION_ROUTER_ERROR]: (
state: Draft<AppState>,
action: AnyAction
) => {
state.authenticationRouterError = null;
},

[SHOW_AUTH_INFO_LOGIN]: (state: Draft<AppState>, action: AnyAction) => {
state.showAuthenticationRouterLogin =
action.showAuthenticationRouterLogin;
},

[SELECT_COMPUTED_LANGUAGE]: (
state: Draft<AppState>,
action: ComputedLanguageAction
) => {
state.computedLanguage = action.computedLanguage;
},
});

builder.addCase(
SIGNIN_CALLBACK_ERROR,
(state: Draft<AppState>, action: AnyAction) => {
state.signInCallbackError = action.signInCallbackError;
}
);

builder.addCase(
UNAUTHORIZED_USER_INFO,
(state: Draft<AppState>, action: AnyAction) => {
state.authenticationRouterError =
action.authenticationRouterError;
}
);

builder.addCase(
LOGOUT_ERROR,
(state: Draft<AppState>, action: AnyAction) => {
state.authenticationRouterError =
action.authenticationRouterError;
}
);

builder.addCase(
USER_VALIDATION_ERROR,
(state: Draft<AppState>, action: AnyAction) => {
state.authenticationRouterError =
action.authenticationRouterError;
}
);

builder.addCase(
RESET_AUTHENTICATION_ROUTER_ERROR,
(state: Draft<AppState>, action: AnyAction) => {
state.authenticationRouterError = null;
}
);

builder.addCase(
SHOW_AUTH_INFO_LOGIN,
(state: Draft<AppState>, action: AnyAction) => {
state.showAuthenticationRouterLogin =
action.showAuthenticationRouterLogin;
}
);

builder.addCase(
SELECT_COMPUTED_LANGUAGE,
(state: Draft<AppState>, action: ComputedLanguageAction) => {
state.computedLanguage = action.computedLanguage;
}
);
}
);
6 changes: 3 additions & 3 deletions src/routes/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function ErrorPage(): ReactElement {
{error.message || error?.data?.message || error.statusText}
</i>
</p>
{isRouteErrorResponse(error) && error.error && (
{isRouteErrorResponse(error) && error.data.error && (
<pre
style={{
wordWrap: 'normal',
Expand All @@ -46,14 +46,14 @@ export default function ErrorPage(): ReactElement {
{(function () {
try {
return JSON.stringify(
error.error,
error.data.error,
undefined,
2
);
} catch (e) {
return null;
}
})() ?? `${error.error}`}
})() ?? `${error.data.error}`}
</code>
</pre>
)}
Expand Down