diff --git a/package-lock.json b/package-lock.json index 2dae8d64..40e6134d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", - "@gridsuite/commons-ui": "0.239.0", + "@gridsuite/commons-ui": "0.240.0", "@hookform/resolvers": "^4.1.3", "@mui/icons-material": "^6.5.0", "@mui/lab": "6.0.1-beta.36", @@ -3200,9 +3200,9 @@ } }, "node_modules/@gridsuite/commons-ui": { - "version": "0.239.0", - "resolved": "https://registry.npmjs.org/@gridsuite/commons-ui/-/commons-ui-0.239.0.tgz", - "integrity": "sha512-9S6mIdp9ZKDh+aWzo9mETuiadHvBa14wc4Pd+vSGf3Yg6cfN40S1E41OJj8Nov4g+nc0dgJr7k/xdNLElDnRNA==", + "version": "0.240.0", + "resolved": "https://registry.npmjs.org/@gridsuite/commons-ui/-/commons-ui-0.240.0.tgz", + "integrity": "sha512-sGP5jDrxpPje7aCYs4SwLqVxPldqpcLIPTeQL9zArWHocHYdTQGU6Fa6JGQV3YWZa4D6tVNa3iYtJKuUpqKkFg==", "license": "MPL-2.0", "dependencies": { "@ag-grid-community/locale": "^35.3.1", diff --git a/package.json b/package.json index 47a1e34f..067d8668 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", - "@gridsuite/commons-ui": "0.239.0", + "@gridsuite/commons-ui": "0.240.0", "@hookform/resolvers": "^4.1.3", "@mui/icons-material": "^6.5.0", "@mui/lab": "6.0.1-beta.36", diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index 401fae27..151a057b 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -7,7 +7,7 @@ import { useCallback, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Grid } from '@mui/material'; +import { Box } from '@mui/material'; import { AnnouncementNotification, AuthenticationRouter, @@ -140,21 +140,10 @@ export default function App() { }, [initialMatchSilentRenewCallbackUrl, dispatch, initialMatchSigninCallbackUrl]); return ( - - - - - - - - + + + +
- - + + ); } diff --git a/src/components/App/HomePage.tsx b/src/components/App/HomePage.tsx index aad5279b..66ee3d9d 100644 --- a/src/components/App/HomePage.tsx +++ b/src/components/App/HomePage.tsx @@ -5,13 +5,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import { Grid, Typography } from '@mui/material'; +import { Grid2 as Grid, Typography } from '@mui/material'; import { ReactElement } from 'react'; import { FormattedMessage } from 'react-intl'; export default function HomePage(): ReactElement { return ( - + diff --git a/src/components/Grid/GridTable.tsx b/src/components/Grid/GridTable.tsx index 78d269c5..8eadb555 100644 --- a/src/components/Grid/GridTable.tsx +++ b/src/components/Grid/GridTable.tsx @@ -18,7 +18,7 @@ import { useMemo, useState, } from 'react'; -import { AppBar, Box, Button, ButtonProps, Grid, Toolbar } from '@mui/material'; +import { AppBar, Box, Button, ButtonProps, Stack, Toolbar } from '@mui/material'; import { Delete } from '@mui/icons-material'; import { AgGrid, AgGridRef } from './AgGrid'; import { GridOptions } from 'ag-grid-community'; @@ -73,30 +73,28 @@ export const GridTable: GridTableWithRef = forwardRef(function AgGridToolbar - - - ({ - marginLeft: 1, - '& > *': { - // mui's button set it own margin on itself... - marginRight: `${theme.spacing(1)} !important`, - '&:last-child': { - marginRight: '0 !important', - }, + + + ({ + marginLeft: 1, + '& > *': { + // mui's button set it own margin on itself... + marginRight: `${theme.spacing(1)} !important`, + '&:last-child': { + marginRight: '0 !important', }, - })} - > - {toolbarContent} - - {alignedRightToolbarContent} - - - - + }, + })} + > + {toolbarContent} + + {alignedRightToolbarContent} + + + {...agGridProps} ref={gridRef} @@ -112,8 +110,8 @@ export const GridTable: GridTableWithRef = forwardRef(function AgGridToolbar - - + + ); }); export default GridTable; diff --git a/src/pages/announcements/add-announcement-form.tsx b/src/pages/announcements/add-announcement-form.tsx index 4b1091a0..4dd876a5 100644 --- a/src/pages/announcements/add-announcement-form.tsx +++ b/src/pages/announcements/add-announcement-form.tsx @@ -6,7 +6,7 @@ */ import { useCallback, useMemo } from 'react'; -import { Grid } from '@mui/material'; +import { Box, Grid2 as Grid, Stack } from '@mui/material'; import { type DateOrTimeView } from '@mui/x-date-pickers'; import { useIntl } from 'react-intl'; import * as yup from 'yup'; @@ -135,9 +135,9 @@ export default function AddAnnouncementForm({ onAnnouncementCreated }: Readonly< FormProps={{ style: { height: '100%' } }} > - - - + + + name={START_DATE} label={intl.formatMessage({ id: 'announcements.table.startDate' })} @@ -148,7 +148,7 @@ export default function AddAnnouncementForm({ onAnnouncementCreated }: Readonly< disablePast /> - + name={END_DATE} label={intl.formatMessage({ id: 'announcements.table.endDate' })} @@ -161,22 +161,20 @@ export default function AddAnnouncementForm({ onAnnouncementCreated }: Readonly< /> - - - name={SEVERITY} - label={intl.formatMessage({ id: 'announcements.severity' })} - options={useMemo( - () => - Object.values(UserAdminSrv.AnnouncementSeverity).map((value) => ({ - id: value, - label: intl.formatMessage({ id: `announcements.severity.${value}` }), - })), - [intl] - )} - fullWidth - /> - - + + name={SEVERITY} + label={intl.formatMessage({ id: 'announcements.severity' })} + options={useMemo( + () => + Object.values(UserAdminSrv.AnnouncementSeverity).map((value) => ({ + id: value, + label: intl.formatMessage({ id: `announcements.severity.${value}` }), + })), + [intl] + )} + fullWidth + /> + name={MESSAGE} label={intl.formatMessage({ id: 'announcements.form.message' })} @@ -184,11 +182,9 @@ export default function AddAnnouncementForm({ onAnnouncementCreated }: Readonly< fullWidth //inputProps={{ maxLength: MESSAGE_MAX_LENGTH } satisfies Partial} /> - - - - - + + + ); diff --git a/src/pages/announcements/announcements-page.tsx b/src/pages/announcements/announcements-page.tsx index b18d89ff..cd2812a9 100644 --- a/src/pages/announcements/announcements-page.tsx +++ b/src/pages/announcements/announcements-page.tsx @@ -8,7 +8,7 @@ import type { UUID } from 'node:crypto'; import { useCallback, useMemo, useRef, useState } from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { Divider, Grid, Typography } from '@mui/material'; +import { Box, Divider, Grid2 as Grid, Stack, Typography } from '@mui/material'; import { snackWithFallback, useSnackMessage } from '@gridsuite/commons-ui'; import type { ColDef, GetRowIdParams, ValueFormatterFunc } from 'ag-grid-community'; import { type GridTableRef } from '../../components/Grid'; @@ -119,41 +119,38 @@ export default function AnnouncementsPage() { const gridContext = useMemo(() => ({ refresh: loadDataAndSave }), [loadDataAndSave]); - // Note: using for the columns didn't work return ( - - - + + + - - - - - - + + + + - - + + - - - - ref={gridRef} - rowData={data} - alwaysShowVerticalScroll - onGridReady={loadDataAndSave} - columnDefs={columns} - defaultColDef={defaultColDef} - gridId="table-announcements" - getRowId={getRowId} - context={gridContext} - /> - + + + ref={gridRef} + rowData={data} + alwaysShowVerticalScroll + onGridReady={loadDataAndSave} + columnDefs={columns} + defaultColDef={defaultColDef} + gridId="table-announcements" + getRowId={getRowId} + context={gridContext} + /> + + ); diff --git a/src/pages/common/multi-chip-cell-renderer.tsx b/src/pages/common/multi-chip-cell-renderer.tsx index 3da66ede..868109e1 100644 --- a/src/pages/common/multi-chip-cell-renderer.tsx +++ b/src/pages/common/multi-chip-cell-renderer.tsx @@ -6,7 +6,7 @@ */ import React, { useRef, useState, useEffect } from 'react'; -import { Chip, Grid, Tooltip } from '@mui/material'; +import { Chip, Grid2 as Grid, Tooltip } from '@mui/material'; import { mergeSx, type MuiStyles } from '@gridsuite/commons-ui'; const maxChipWidth = 100; @@ -14,7 +14,7 @@ const counterChipWidth = 25; const chipStyles = { default: { - marginTop: 2, + marginTop: 1, marginLeft: 1, maxWidth: maxChipWidth, }, @@ -85,7 +85,7 @@ const MultiChipCellRenderer = (props: MultiChipCellRendererProps) => { }; return ( - + {values.map((label: string, index: number) => customChip(label, index, values.length))} ); diff --git a/src/pages/common/table-selection.tsx b/src/pages/common/table-selection.tsx index ef7bc3f2..2847846a 100644 --- a/src/pages/common/table-selection.tsx +++ b/src/pages/common/table-selection.tsx @@ -8,7 +8,7 @@ import { useCallback, useMemo, useRef, useState } from 'react'; import { FormattedMessage } from 'react-intl'; import { CustomAGGrid } from '@gridsuite/commons-ui'; -import { Grid, Typography } from '@mui/material'; +import { Box, Stack, Typography } from '@mui/material'; import { AgGridReact } from 'ag-grid-react'; import { ColDef, GetRowIdParams, GridReadyEvent } from 'ag-grid-community'; import { defaultColDef, defaultRowSelection } from './table-config'; @@ -96,14 +96,12 @@ function TableSelection({ }, [columnDefs]); return ( - - - - - {` (${selectedCount} / ${items.length})`} - - - + + + + {` (${selectedCount} / ${items.length})`} + + ({ onGridReady={handleGridReady} accentedSort /> - - + + ); } diff --git a/src/pages/groups/groups-page.tsx b/src/pages/groups/groups-page.tsx index 99beabca..393d4fb1 100644 --- a/src/pages/groups/groups-page.tsx +++ b/src/pages/groups/groups-page.tsx @@ -6,7 +6,7 @@ */ import { FunctionComponent, useCallback, useRef, useState } from 'react'; -import { Grid } from '@mui/material'; +import { Grid2 as Grid, Stack } from '@mui/material'; import { GridTableRef } from '../../components/Grid'; import { GroupInfos } from '../../services'; import { RowClickedEvent } from 'ag-grid-community'; @@ -41,15 +41,15 @@ const GroupsPage: FunctionComponent = () => { return ( <> - - + + - + = ({ ); return ( - - + + - + titleId="groups.table.users" items={usersOptions} diff --git a/src/pages/profiles/modification/configuration-selection.tsx b/src/pages/profiles/modification/configuration-selection.tsx index 9c4d5e9d..5e2d662b 100644 --- a/src/pages/profiles/modification/configuration-selection.tsx +++ b/src/pages/profiles/modification/configuration-selection.tsx @@ -8,7 +8,7 @@ import { FunctionComponent, useEffect, useState } from 'react'; import HighlightOffIcon from '@mui/icons-material/HighlightOff'; import FolderIcon from '@mui/icons-material/Folder'; -import { Grid, IconButton, Tooltip } from '@mui/material'; +import { Grid2 as Grid, IconButton, Tooltip } from '@mui/material'; import { useIntl } from 'react-intl'; import { DirectoryItemSelector, ElementAttributes, ElementType, TreeViewFinderNodeProps } from '@gridsuite/commons-ui'; import { useController, useWatch } from 'react-hook-form'; @@ -100,7 +100,7 @@ const ConfigurationSelection: FunctionComponent = (props) return ( - + = (props) - + = (props) - + { return ( - - + + - +

{configList.map((config) => { return ( - + { ); })} - +

- - + + - + { return ( <> - - + + - + { + let icon; + + if (props.value == null) { + icon = ; + } else if (props.value === true) { + icon = ; + } else { + icon = ; + } + return ( - - {props.value == null && } - {props.value === true && } - {props.value === false && } - + + {icon} + ); }; diff --git a/src/pages/users/modification/user-modification-form.tsx b/src/pages/users/modification/user-modification-form.tsx index 08ab5dbf..67f97fa5 100644 --- a/src/pages/users/modification/user-modification-form.tsx +++ b/src/pages/users/modification/user-modification-form.tsx @@ -6,7 +6,7 @@ */ import { useMemo, type FunctionComponent } from 'react'; -import { Grid } from '@mui/material'; +import { Grid2 as Grid } from '@mui/material'; import * as yup from 'yup'; import { AutocompleteInput, TextInput } from '@gridsuite/commons-ui'; import TableSelection from '../../common/table-selection'; @@ -60,8 +60,8 @@ const UserModificationForm: FunctionComponent = ({ ); return ( - - + + = ({ formProps={{ disabled: true, style: { fontStyle: 'italic' } }} /> - + = ({ formProps={{ disabled: true, style: { fontStyle: 'italic' } }} /> - + = ({ options={profileOptions} /> - + titleId="users.table.groups" items={groupOptions} diff --git a/src/pages/users/users-page.tsx b/src/pages/users/users-page.tsx index 1fbc9d58..48721c8d 100644 --- a/src/pages/users/users-page.tsx +++ b/src/pages/users/users-page.tsx @@ -6,7 +6,7 @@ */ import { FunctionComponent, useCallback, useRef, useState } from 'react'; -import { Grid } from '@mui/material'; +import { Grid2 as Grid, Stack } from '@mui/material'; import { GridTableRef } from '../../components/Grid'; import { UserInfos } from '../../services'; import { RowClickedEvent } from 'ag-grid-community'; @@ -41,15 +41,15 @@ const UsersPage: FunctionComponent = () => { return ( <> - - + + - +