Make edit buttons disabled for readOnly journals.

master
Tom Hacohen 4 years ago
parent f526bcb293
commit 5756bf37ba

@ -247,6 +247,10 @@ const CollectionRoutes = withStyles(styles)(withRouter(
if (this.itemUndefined(itemUid)) { if (this.itemUndefined(itemUid)) {
return PageNotFound(); return PageNotFound();
} }
const journalUid = (props.items[itemUid] as any).journalUid;
const syncJournal = this.props.syncInfo.get(journalUid)!;
const readOnly = syncJournal.journal.readOnly;
return ( return (
<Container> <Container>
<div style={{ textAlign: "right", marginBottom: 15 }}> <div style={{ textAlign: "right", marginBottom: 15 }}>
@ -266,7 +270,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
<Button <Button
color="secondary" color="secondary"
variant="contained" variant="contained"
disabled={!props.componentEdit} disabled={!props.componentEdit || readOnly}
className={classes.button} className={classes.button}
style={{ marginLeft: 15 }} style={{ marginLeft: 15 }}
onClick={() => onClick={() =>
@ -283,7 +287,7 @@ const CollectionRoutes = withStyles(styles)(withRouter(
<Button <Button
color="secondary" color="secondary"
variant="contained" variant="contained"
disabled={!props.componentEdit} disabled={!props.componentEdit || readOnly}
className={classes.button} className={classes.button}
style={{ marginLeft: 15 }} style={{ marginLeft: 15 }}
onClick={() => onClick={() =>

Loading…
Cancel
Save