aboutsummaryrefslogtreecommitdiff
path: root/modern/src/UserPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-25 20:30:04 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-25 20:30:04 -0700
commitdac214c3ac6066a6f23cf92807da89cc1a86c105 (patch)
tree9456d629943dcb8187c0c6c21f0c55afca1cf5e8 /modern/src/UserPage.js
parent43ff7c49ba1c8cfeca148055765b16b10a4f0c44 (diff)
downloadtrackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.tar.gz
trackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.tar.bz2
trackermap-web-dac214c3ac6066a6f23cf92807da89cc1a86c105.zip
Implement linking field
Diffstat (limited to 'modern/src/UserPage.js')
-rw-r--r--modern/src/UserPage.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/modern/src/UserPage.js b/modern/src/UserPage.js
index 98b9b414..0fa0918b 100644
--- a/modern/src/UserPage.js
+++ b/modern/src/UserPage.js
@@ -7,6 +7,7 @@ import EditItemView from './EditItemView';
import { Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography } from '@material-ui/core';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
import EditAttributesView from './attributes/EditAttributesView';
+import LinkField from './form/LinkField';
const useStyles = makeStyles(() => ({
details: {
@@ -64,6 +65,35 @@ const UserPage = () => {
/>
</AccordionDetails>
</Accordion>
+ {item.id &&
+ <Accordion>
+ <AccordionSummary expandIcon={<ExpandMoreIcon />}>
+ <Typography variant="subtitle1">
+ {t('sharedConnections')}
+ </Typography>
+ </AccordionSummary>
+ <AccordionDetails className={classes.details}>
+ <LinkField
+ margin="normal"
+ endpointAll="/api/devices?all=true"
+ endpointLinked={"/api/devices?userId=" + item.id}
+ baseId={item.id}
+ keyBase="userId"
+ keyLink="deviceId"
+ label={t('deviceTitle')}
+ variant="filled" />
+ <LinkField
+ margin="normal"
+ endpointAll="/api/groups?all=true"
+ endpointLinked={"/api/groups?userId=" + item.id}
+ baseId={item.id}
+ keyBase="userId"
+ keyLink="groupId"
+ label={t('settingsGroups')}
+ variant="filled" />
+ </AccordionDetails>
+ </Accordion>
+ }
</>
}
</EditItemView>