diff options
author | Anton Tananaev <anton@traccar.org> | 2023-02-23 11:48:06 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-02-23 11:48:06 -0800 |
commit | 5f65762c67aacc9a621983fcb06107b982792c3f (patch) | |
tree | b4c29451fbfb2fc0e090671efc76188725ac4d59 /modern/src/settings/GroupsPage.js | |
parent | d64115f88d84c85b149063cf8929d1f57c66935f (diff) | |
download | trackermap-web-5f65762c67aacc9a621983fcb06107b982792c3f.tar.gz trackermap-web-5f65762c67aacc9a621983fcb06107b982792c3f.tar.bz2 trackermap-web-5f65762c67aacc9a621983fcb06107b982792c3f.zip |
Separate connections from edit
Diffstat (limited to 'modern/src/settings/GroupsPage.js')
-rw-r--r-- | modern/src/settings/GroupsPage.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/modern/src/settings/GroupsPage.js b/modern/src/settings/GroupsPage.js index 64ae1a1d..0624f7d1 100644 --- a/modern/src/settings/GroupsPage.js +++ b/modern/src/settings/GroupsPage.js @@ -1,7 +1,9 @@ import React, { useState } from 'react'; +import { useNavigate } from 'react-router-dom'; import { Table, TableRow, TableCell, TableHead, TableBody, } from '@mui/material'; +import LinkIcon from '@mui/icons-material/Link'; import makeStyles from '@mui/styles/makeStyles'; import { useEffectAsync } from '../reactHelper'; import { useTranslation } from '../common/components/LocalizationProvider'; @@ -21,6 +23,7 @@ const useStyles = makeStyles((theme) => ({ const GroupsPage = () => { const classes = useStyles(); + const navigate = useNavigate(); const t = useTranslation(); const [timestamp, setTimestamp] = useState(Date.now()); @@ -42,6 +45,13 @@ const GroupsPage = () => { } }, [timestamp]); + const actionConnections = { + key: 'connections', + title: t('sharedConnections'), + icon: <LinkIcon fontSize="small" />, + handler: (groupId) => navigate(`/settings/group/${groupId}/connections`), + }; + return ( <PageLayout menu={<SettingsMenu />} breadcrumbs={['settingsTitle', 'settingsGroups']}> <SearchHeader keyword={searchKeyword} setKeyword={setSearchKeyword} /> @@ -57,7 +67,13 @@ const GroupsPage = () => { <TableRow key={item.id}> <TableCell>{item.name}</TableCell> <TableCell className={classes.columnAction} padding="none"> - <CollectionActions itemId={item.id} editPath="/settings/group" endpoint="groups" setTimestamp={setTimestamp} /> + <CollectionActions + itemId={item.id} + editPath="/settings/group" + endpoint="groups" + setTimestamp={setTimestamp} + customActions={[actionConnections]} + /> </TableCell> </TableRow> )) : (<TableShimmer columns={2} endAction />)} |