@@ -12,10 +12,13 @@ import { GridButton, GridButtonDelete, GridTable, GridTableRef } from '../../com
12
12
import { GroupInfos , UserAdminSrv , UserInfos } from '../../services' ;
13
13
import { ColDef , GetRowIdParams , RowClickedEvent , TextFilterParams } from 'ag-grid-community' ;
14
14
import { useSnackMessage } from '@gridsuite/commons-ui' ;
15
+ import { useCsvExport } from '../common/use-csv-export' ;
15
16
import DeleteConfirmationDialog from '../common/delete-confirmation-dialog' ;
16
17
import { defaultColDef , defaultRowSelection } from '../common/table-config' ;
17
18
import MultiChipCellRenderer from '../common/multi-chip-cell-renderer' ;
18
19
import { useTableSelection } from '../../utils/hooks' ;
20
+ import { useSelector } from 'react-redux' ;
21
+ import { AppState } from '../../redux/reducer' ;
19
22
20
23
export interface GroupsTableProps {
21
24
gridRef : RefObject < GridTableRef < GroupInfos > > ;
@@ -29,6 +32,7 @@ const GroupsTable: FunctionComponent<GroupsTableProps> = (props) => {
29
32
30
33
const { rowsSelection, onSelectionChanged, onFilterChanged } = useTableSelection < GroupInfos > ( ) ;
31
34
const [ showDeletionDialog , setShowDeletionDialog ] = useState ( false ) ;
35
+ const language = useSelector ( ( state : AppState ) => state . computedLanguage ) ;
32
36
33
37
function getRowId ( params : GetRowIdParams < GroupInfos > ) : string {
34
38
return params . data . name ;
@@ -97,6 +101,14 @@ const GroupsTable: FunctionComponent<GroupsTableProps> = (props) => {
97
101
[ intl ]
98
102
) ;
99
103
104
+ const csvExportComponent = useCsvExport < GroupInfos > ( {
105
+ gridRef : props . gridRef ,
106
+ columns,
107
+ tableNameId : 'appBar.tabs.groups' ,
108
+ intl,
109
+ language,
110
+ } ) ;
111
+
100
112
return (
101
113
< >
102
114
< GridTable < GroupInfos , { } >
@@ -111,6 +123,7 @@ const GroupsTable: FunctionComponent<GroupsTableProps> = (props) => {
111
123
onRowClicked = { props . onRowClicked }
112
124
onSelectionChanged = { onSelectionChanged }
113
125
onFilterChanged = { onFilterChanged }
126
+ alignedRightToolbarContent = { csvExportComponent }
114
127
>
115
128
< GridButton
116
129
labelId = "groups.table.toolbar.add.label"
0 commit comments