From 9105b4be3a9187f73c32faaa882a86720cfa2849 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 23 Apr 2025 16:29:41 -0600 Subject: [PATCH] added back the task viewer on the bin page, fixed up some more styling --- src/maps/mapDrawers/FieldDrawer.tsx | 10 +++++----- src/pages/Bin.tsx | 9 +++++---- src/pages/Gate.tsx | 6 +++++- src/tasks/TaskSettings.tsx | 5 +++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/maps/mapDrawers/FieldDrawer.tsx b/src/maps/mapDrawers/FieldDrawer.tsx index a782b02..c4029aa 100644 --- a/src/maps/mapDrawers/FieldDrawer.tsx +++ b/src/maps/mapDrawers/FieldDrawer.tsx @@ -230,12 +230,12 @@ export default function FieldDrawer(props: Props) { {field.fieldName()} Details - - + + Approximate Area: {field.acres()}ac - + Grain: {field.grain() === pond.Grain.GRAIN_CUSTOM @@ -243,11 +243,11 @@ export default function FieldDrawer(props: Props) { : GrainDescriber(field.crop()).name} - + Grain Variant: {field.settings.grainSubtype} - + Land Location: {field.landLoc()} diff --git a/src/pages/Bin.tsx b/src/pages/Bin.tsx index 15ce8db..c6c84a8 100644 --- a/src/pages/Bin.tsx +++ b/src/pages/Bin.tsx @@ -43,7 +43,6 @@ import BindaptIcon from "products/Bindapt/BindaptIcon"; import Close from "@mui/icons-material/Close"; import Chat from "chat/Chat"; import TasksIcon from "products/Construction/TasksIcon"; -// import TaskViewer from "tasks/TaskViewer"; import FieldsIcon from "products/AgIcons/FieldsIcon"; import BinComponentTypes from "bin/BinComponentTypes"; import { Plenum } from "models/Plenum"; @@ -66,6 +65,7 @@ import BinConditioningCard from "bin/BinConditioningCard"; import { makeStyles, styled } from "@mui/styles"; import { useNavigate, useParams } from "react-router-dom"; import { Controller } from "models/Controller"; +import TaskViewer from "tasks/TaskViewer"; interface TabPanelProps { children?: React.ReactNode; @@ -547,10 +547,11 @@ export default function Bin(props: Props) { }; const tasks = () => { + console.log(showTasks()) if (showTasks()) { return ( - {/* */} + ); } @@ -1144,11 +1145,11 @@ export default function Bin(props: Props) { anchor="right" classes={{ paper: classes.drawerPaper }} onClose={() => setTaskDrawer(false)}> - + setTaskDrawer(false)}> - {/* */} + )} diff --git a/src/pages/Gate.tsx b/src/pages/Gate.tsx index e45ffae..c873a76 100644 --- a/src/pages/Gate.tsx +++ b/src/pages/Gate.tsx @@ -87,7 +87,7 @@ export default function Gate(props: Props) { //const match = useRouteMatch(); //const gateID = props.gateID ?? match.params.gateID; const { gateKey } = props - const gateID = gateKey ?? useParams<{ gateID: string }>()?.gateID ?? ""; + const gateID = gateKey ?? useParams<{ gateKey: string }>()?.gateKey ?? ""; const classes = useStyles(); const gateAPI = useGateAPI(); const userAPI = useUserAPI(); @@ -115,13 +115,17 @@ export default function Gate(props: Props) { }; useEffect(() => { + console.log(gateID) let key = gateID; let kind = "gate"; if (as) { key = as; kind = "team"; } + console.log(key) + console.log(kind) userAPI.getUser(user.id(), { key: key, kind: kind } as Scope).then(resp => { + console.log(resp) setPermissions(resp.permissions); }); }, [as, gateID, userAPI, user]); diff --git a/src/tasks/TaskSettings.tsx b/src/tasks/TaskSettings.tsx index 63e800a..9f92548 100644 --- a/src/tasks/TaskSettings.tsx +++ b/src/tasks/TaskSettings.tsx @@ -19,6 +19,7 @@ import { useSnackbar, useUserAPI } from "hooks"; import { useEffect } from "react"; import { Task, teamScope, User } from "models"; import ColourPicker from "common/ColourPicker"; +import ResponsiveDialog from "common/ResponsiveDialog"; interface Props { open: boolean; @@ -159,7 +160,7 @@ export default function TaskSettings(props: Props) { }; return ( - + New Task )} - + ); }