From ce0b2d61708581687a54a62e0f7175a749905ec2 Mon Sep 17 00:00:00 2001 From: Christophe Gerard Date: Fri, 6 Dec 2024 15:32:49 +0100 Subject: [PATCH] small fixes --- .../Iaso/domains/orgUnits/groupSets/config.tsx | 11 ++++++----- .../Iaso/domains/orgUnits/groupSets/index.tsx | 15 +++++---------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx index 6127d6f3a7..6021451b8e 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/config.tsx @@ -1,14 +1,14 @@ -import React, { useMemo } from 'react'; -import { Column, IconButton, useSafeIntl } from 'bluesquare-components'; import { Chip } from '@mui/material'; import { makeStyles } from '@mui/styles'; +import { Column, IconButton, useSafeIntl } from 'bluesquare-components'; +import React, { useMemo } from 'react'; import { DateTimeCell } from '../../../components/Cells/DateTimeCell'; -import MESSAGES from './messages'; -import { baseUrls } from '../../../constants/urls'; import { DisplayIfUserHasPerm } from '../../../components/DisplayIfUserHasPerm'; +import { baseUrls } from '../../../constants/urls'; +import MESSAGES from './messages'; -import * as Permission from '../../../utils/permissions'; import DeleteDialog from '../../../components/dialogs/DeleteDialogComponent'; +import * as Permission from '../../../utils/permissions'; export const baseUrl = baseUrls.groupSets; @@ -51,6 +51,7 @@ export const useGroupSetsTableColumns = (deleteGroupSet): Column[] => { className={classes.groupChip} label={g.name} color="primary" + key={g.id} /> ))} diff --git a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/index.tsx b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/index.tsx index 57a2b85b9f..41ef97efda 100644 --- a/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/index.tsx +++ b/hat/assets/js/apps/Iaso/domains/orgUnits/groupSets/index.tsx @@ -3,13 +3,12 @@ import { makeStyles } from '@mui/styles'; import { AddButton as AddButtonComponent, commonStyles, - Table, - useRedirectTo, - useSafeIntl, + useSafeIntl } from 'bluesquare-components'; import React from 'react'; import { useNavigate } from 'react-router-dom'; import TopBar from '../../../components/nav/TopBarComponent'; +import { TableWithDeepLink } from '../../../components/tables/TableWithDeepLink'; import { baseUrls } from '../../../constants/urls'; import { useParamsObject } from '../../../routing/hooks/useParamsObject'; import { Filters } from './components/Filters'; @@ -23,7 +22,6 @@ const useStyles = makeStyles(theme => ({ const baseUrl = baseUrls.groupSets; const GroupSets = () => { const params = useParamsObject(baseUrl); - const redirectTo = useRedirectTo(); const classes = useStyles(); const { mutate: deleteGroupSet } = useDeleteGroupSet(); const tableColumns = useGroupSetsTableColumns(deleteGroupSet); @@ -33,8 +31,7 @@ const GroupSets = () => { const navigate = useNavigate(); const isLoading = isFetching; const createGroupSet = () => { - // how to use the paths ? - navigate('/orgunits/configuration/groupSet/groupSetId/new'); + navigate(`/${baseUrls.groupSetDetail}/groupSetId/new`); }; return ( <> @@ -56,20 +53,18 @@ const GroupSets = () => { {tableColumns && ( - - redirectTo(baseUrl, newParams) - } marginTop={false} extraProps={{ loading: isLoading, }} + params={params} /> )}