diff --git a/package-lock.json b/package-lock.json index a7c26fed..e1a3cb2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,8 +19,8 @@ "@mui/x-tree-view": "^6.17.0", "@reduxjs/toolkit": "^2.2.3", "ace-builds": "^1.32.9", - "ag-grid-community": "^31.0.0", - "ag-grid-react": "^31.2.0", + "ag-grid-community": "^33.0.3", + "ag-grid-react": "^33.0.3", "clsx": "^2.1.1", "core-js": "^3.36.1", "oidc-client": "^1.11.5", @@ -5765,22 +5765,30 @@ "node": ">=0.4.0" } }, + "node_modules/ag-charts-types": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/ag-charts-types/-/ag-charts-types-11.0.3.tgz", + "integrity": "sha512-q7O2viQXPyO014QVH7KjFCUmQ/NvMBx9ReZtramQ44u+/aAa0ttLi/coK+V0Hse4/MG1eB/2XhgymdooQ0Kalg==" + }, "node_modules/ag-grid-community": { - "version": "31.2.1", - "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.2.1.tgz", - "integrity": "sha512-D+gnUQ4dHZ/EQJmupQnDqcEKiCEeuK5ZxlsIpdPKgHg/23dmW+aEdivtB9nLpSc2IEK0RUpchcSxeUT37Boo5A==" + "version": "33.0.3", + "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-33.0.3.tgz", + "integrity": "sha512-HZeVmVieZ5Gm9j09Itecqm+OIX8X6cU4TJToUbsXv3DxdO9SK5/s8aAJAwBHtNRXOhHrhqQYwrY2yc3OtzWwcQ==", + "dependencies": { + "ag-charts-types": "11.0.3" + } }, "node_modules/ag-grid-react": { - "version": "31.2.1", - "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.2.1.tgz", - "integrity": "sha512-9UH3xxXRwZfW97oz58KboyCJl4t+zdetopieeHVcttsXX1DvGFDUIEz7A1sQaG8e1DAXLMf3IxoIPrfWheH4XA==", + "version": "33.0.3", + "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-33.0.3.tgz", + "integrity": "sha512-6IcraSVqsUG/hzTeZ0D0dtddAcZKcWdN75ek/O+lCA6r22abJPe33nHBYVezkTV8k6D3JhA24mlTwduzn0GZLQ==", "dependencies": { - "ag-grid-community": "31.2.1", + "ag-grid-community": "33.0.3", "prop-types": "^15.8.1" }, "peerDependencies": { - "react": "^16.3.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/agent-base": { diff --git a/package.json b/package.json index 067959de..704e9ff6 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "@mui/x-tree-view": "^6.17.0", "@reduxjs/toolkit": "^2.2.3", "ace-builds": "^1.32.9", - "ag-grid-community": "^31.0.0", - "ag-grid-react": "^31.2.0", + "ag-grid-community": "^33.0.3", + "ag-grid-react": "^33.0.3", "clsx": "^2.1.1", "core-js": "^3.36.1", "oidc-client": "^1.11.5", diff --git a/src/components/app-wrapper.tsx b/src/components/app-wrapper.tsx index 03e63a1a..ee1798dc 100644 --- a/src/components/app-wrapper.tsx +++ b/src/components/app-wrapper.tsx @@ -63,6 +63,7 @@ import { import { IntlConfig, IntlProvider } from 'react-intl'; import { BrowserRouter } from 'react-router-dom'; import { Provider, useSelector } from 'react-redux'; +import { AllCommunityModule, ModuleRegistry, provideGlobalGridOptions } from 'ag-grid-community'; import App from './app'; import messages_en from '../translations/en.json'; import messages_fr from '../translations/fr.json'; @@ -74,6 +75,12 @@ import { store } from '../redux/store'; import { PARAM_THEME } from '../utils/config-params'; import { AppState } from '../redux/types'; +// Register all community features (migration to V33) +ModuleRegistry.registerModules([AllCommunityModule]); + +// Mark all grids as using legacy themes (migration to V33) +provideGlobalGridOptions({ theme: 'legacy' }); + const lightTheme = createTheme({ palette: { mode: 'light', diff --git a/src/components/dialogs/contingency-list/explicit-naming/explicit-naming-form.tsx b/src/components/dialogs/contingency-list/explicit-naming/explicit-naming-form.tsx index 94ddfa1d..9125e4b8 100644 --- a/src/components/dialogs/contingency-list/explicit-naming/explicit-naming-form.tsx +++ b/src/components/dialogs/contingency-list/explicit-naming/explicit-naming-form.tsx @@ -8,12 +8,7 @@ import { useIntl } from 'react-intl'; import { useCallback, useMemo } from 'react'; import { v4 as uuid4 } from 'uuid'; -import { - CustomAgGridTable, - FieldConstants, - ROW_DRAGGING_SELECTION_COLUMN_DEF, - yupConfig as yup, -} from '@gridsuite/commons-ui'; +import { CustomAgGridTable, FieldConstants, yupConfig as yup } from '@gridsuite/commons-ui'; import { ColDef, SuppressKeyboardEventParams } from 'ag-grid-community'; import { ContingencyListType } from '../../../../utils/elementType'; import ChipsArrayEditor from '../../../utils/rhf-inputs/ag-grid-table-rhf/cell-editors/chips-array-editor'; @@ -66,11 +61,11 @@ export default function ExplicitNamingForm() { const intl = useIntl(); const columnDefs = useMemo( () => [ - ...ROW_DRAGGING_SELECTION_COLUMN_DEF, { headerName: intl.formatMessage({ id: 'elementName' }), field: FieldConstants.CONTINGENCY_NAME, editable: true, + rowDrag: true, singleClickEdit: true, }, { @@ -137,7 +132,12 @@ export default function ExplicitNamingForm() { makeDefaultRowData={makeDefaultRowData} pagination paginationPageSize={100} - suppressRowClickSelection + rowSelection={{ + mode: 'multiRow', + enableClickSelection: false, + checkboxes: true, + headerCheckbox: true, + }} defaultColDef={defaultColDef} alwaysShowVerticalScroll stopEditingWhenCellsLoseFocus diff --git a/src/components/directory-content-table.tsx b/src/components/directory-content-table.tsx index 5513b71a..5e75b3fc 100644 --- a/src/components/directory-content-table.tsx +++ b/src/components/directory-content-table.tsx @@ -119,8 +119,15 @@ export function DirectoryContentTable({ rowData={rows} getRowId={getRowId} defaultColDef={defaultColumnDefinition} - rowSelection="multiple" - suppressRowClickSelection + rowSelection={{ + mode: 'multiRow', + enableClickSelection: false, + checkboxes: true, + headerCheckbox: true, + }} + selectionColumnDef={{ + pinned: 'left', + }} onGridReady={onGridReady} onCellContextMenu={handleCellContextualMenu} onCellClicked={handleCellClick} diff --git a/src/components/utils/directory-content-utils.ts b/src/components/utils/directory-content-utils.ts index 3d63c2f7..0ce1a317 100644 --- a/src/components/utils/directory-content-utils.ts +++ b/src/components/utils/directory-content-utils.ts @@ -67,8 +67,9 @@ export const getColumnsDefinition = (childrenMetadata: Record