added back the task viewer on the bin page, fixed up some more styling
This commit is contained in:
parent
5c6be7c850
commit
9105b4be3a
4 changed files with 18 additions and 12 deletions
|
|
@ -230,12 +230,12 @@ export default function FieldDrawer(props: Props) {
|
||||||
{field.fieldName()} Details
|
{field.fieldName()} Details
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Grid container direction="column" alignItems="center">
|
<Grid container direction="column" alignItems="center" width="100%">
|
||||||
<Grid container direction="row" className={classes.dark}>
|
<Grid container direction="row" justifyContent="space-between" width="100%" className={classes.dark}>
|
||||||
<Grid>Approximate Area:</Grid>
|
<Grid>Approximate Area:</Grid>
|
||||||
<Grid>{field.acres()}ac</Grid>
|
<Grid>{field.acres()}ac</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container direction="row" className={classes.light}>
|
<Grid container direction="row" justifyContent="space-between" width="100%" className={classes.light}>
|
||||||
<Grid>Grain:</Grid>
|
<Grid>Grain:</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
{field.grain() === pond.Grain.GRAIN_CUSTOM
|
{field.grain() === pond.Grain.GRAIN_CUSTOM
|
||||||
|
|
@ -243,11 +243,11 @@ export default function FieldDrawer(props: Props) {
|
||||||
: GrainDescriber(field.crop()).name}
|
: GrainDescriber(field.crop()).name}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container direction="row" className={classes.dark}>
|
<Grid container direction="row" justifyContent="space-between" width="100%" className={classes.dark}>
|
||||||
<Grid>Grain Variant:</Grid>
|
<Grid>Grain Variant:</Grid>
|
||||||
<Grid>{field.settings.grainSubtype}</Grid>
|
<Grid>{field.settings.grainSubtype}</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container direction="row" className={classes.light}>
|
<Grid container direction="row" justifyContent="space-between" width="100%" className={classes.light}>
|
||||||
<Grid>Land Location:</Grid>
|
<Grid>Land Location:</Grid>
|
||||||
<Grid>{field.landLoc()}</Grid>
|
<Grid>{field.landLoc()}</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ import BindaptIcon from "products/Bindapt/BindaptIcon";
|
||||||
import Close from "@mui/icons-material/Close";
|
import Close from "@mui/icons-material/Close";
|
||||||
import Chat from "chat/Chat";
|
import Chat from "chat/Chat";
|
||||||
import TasksIcon from "products/Construction/TasksIcon";
|
import TasksIcon from "products/Construction/TasksIcon";
|
||||||
// import TaskViewer from "tasks/TaskViewer";
|
|
||||||
import FieldsIcon from "products/AgIcons/FieldsIcon";
|
import FieldsIcon from "products/AgIcons/FieldsIcon";
|
||||||
import BinComponentTypes from "bin/BinComponentTypes";
|
import BinComponentTypes from "bin/BinComponentTypes";
|
||||||
import { Plenum } from "models/Plenum";
|
import { Plenum } from "models/Plenum";
|
||||||
|
|
@ -66,6 +65,7 @@ import BinConditioningCard from "bin/BinConditioningCard";
|
||||||
import { makeStyles, styled } from "@mui/styles";
|
import { makeStyles, styled } from "@mui/styles";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
import { Controller } from "models/Controller";
|
import { Controller } from "models/Controller";
|
||||||
|
import TaskViewer from "tasks/TaskViewer";
|
||||||
|
|
||||||
interface TabPanelProps {
|
interface TabPanelProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|
@ -547,10 +547,11 @@ export default function Bin(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const tasks = () => {
|
const tasks = () => {
|
||||||
|
console.log(showTasks())
|
||||||
if (showTasks()) {
|
if (showTasks()) {
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{/* <TaskViewer drawerView objectKey={binID} loadKeys={[binID]} /> */}
|
<TaskViewer drawerView objectKey={binID} loadKeys={[binID]} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -1144,11 +1145,11 @@ export default function Bin(props: Props) {
|
||||||
anchor="right"
|
anchor="right"
|
||||||
classes={{ paper: classes.drawerPaper }}
|
classes={{ paper: classes.drawerPaper }}
|
||||||
onClose={() => setTaskDrawer(false)}>
|
onClose={() => setTaskDrawer(false)}>
|
||||||
<Box paddingTop={10}>
|
<Box>
|
||||||
<IconButton style={{ width: 50 }} onClick={() => setTaskDrawer(false)}>
|
<IconButton style={{ width: 50 }} onClick={() => setTaskDrawer(false)}>
|
||||||
<Close />
|
<Close />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
{/* <TaskViewer drawerView objectKey={binID} loadKeys={[binID]} /> */}
|
<TaskViewer drawerView objectKey={binID} loadKeys={[binID]} />
|
||||||
</Box>
|
</Box>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ export default function Gate(props: Props) {
|
||||||
//const match = useRouteMatch<MatchParams>();
|
//const match = useRouteMatch<MatchParams>();
|
||||||
//const gateID = props.gateID ?? match.params.gateID;
|
//const gateID = props.gateID ?? match.params.gateID;
|
||||||
const { gateKey } = props
|
const { gateKey } = props
|
||||||
const gateID = gateKey ?? useParams<{ gateID: string }>()?.gateID ?? "";
|
const gateID = gateKey ?? useParams<{ gateKey: string }>()?.gateKey ?? "";
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const gateAPI = useGateAPI();
|
const gateAPI = useGateAPI();
|
||||||
const userAPI = useUserAPI();
|
const userAPI = useUserAPI();
|
||||||
|
|
@ -115,13 +115,17 @@ export default function Gate(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
console.log(gateID)
|
||||||
let key = gateID;
|
let key = gateID;
|
||||||
let kind = "gate";
|
let kind = "gate";
|
||||||
if (as) {
|
if (as) {
|
||||||
key = as;
|
key = as;
|
||||||
kind = "team";
|
kind = "team";
|
||||||
}
|
}
|
||||||
|
console.log(key)
|
||||||
|
console.log(kind)
|
||||||
userAPI.getUser(user.id(), { key: key, kind: kind } as Scope).then(resp => {
|
userAPI.getUser(user.id(), { key: key, kind: kind } as Scope).then(resp => {
|
||||||
|
console.log(resp)
|
||||||
setPermissions(resp.permissions);
|
setPermissions(resp.permissions);
|
||||||
});
|
});
|
||||||
}, [as, gateID, userAPI, user]);
|
}, [as, gateID, userAPI, user]);
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import { useSnackbar, useUserAPI } from "hooks";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Task, teamScope, User } from "models";
|
import { Task, teamScope, User } from "models";
|
||||||
import ColourPicker from "common/ColourPicker";
|
import ColourPicker from "common/ColourPicker";
|
||||||
|
import ResponsiveDialog from "common/ResponsiveDialog";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|
@ -159,7 +160,7 @@ export default function TaskSettings(props: Props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={props.open} onClose={closeDialog}>
|
<ResponsiveDialog open={props.open} onClose={closeDialog}>
|
||||||
<DialogTitle id="form-dialog-title">New Task</DialogTitle>
|
<DialogTitle id="form-dialog-title">New Task</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextField
|
<TextField
|
||||||
|
|
@ -346,6 +347,6 @@ export default function TaskSettings(props: Props) {
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</ResponsiveDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue