From c738938cc0d8140ce91011db8420df7a6768c893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Beye?= Date: Mon, 11 Oct 2021 20:49:35 +0200 Subject: [PATCH] fix(ui): Allow more states for zone/segment cleanup and goto --- frontend/src/map/actions/GoToActions.tsx | 4 ++-- frontend/src/map/actions/SegmentActions.tsx | 4 ++-- frontend/src/map/actions/ZoneActions.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/map/actions/GoToActions.tsx b/frontend/src/map/actions/GoToActions.tsx index 33a746cea4d..41cbe07d246 100644 --- a/frontend/src/map/actions/GoToActions.tsx +++ b/frontend/src/map/actions/GoToActions.tsx @@ -30,7 +30,7 @@ const GoToActions = ( onSuccess: onClear, }); - const canGo = status === "idle" || status === "docked"; + const canGo = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error"; const handleClick = React.useCallback(() => { if (!canGo) { @@ -76,7 +76,7 @@ const GoToActions = ( !canGo && - Can only go to point when idle + Cannot go to point while the robot is busy } diff --git a/frontend/src/map/actions/SegmentActions.tsx b/frontend/src/map/actions/SegmentActions.tsx index 772f6560f6d..c31f2112c78 100644 --- a/frontend/src/map/actions/SegmentActions.tsx +++ b/frontend/src/map/actions/SegmentActions.tsx @@ -31,7 +31,7 @@ const SegmentActions = ( onSuccess: onClear, }); - const canClean = status === "idle" || status === "docked" || status === "error"; + const canClean = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error"; const handleClick = React.useCallback(() => { if (!canClean) { @@ -137,7 +137,7 @@ const SegmentActions = ( !canClean && - Can only start segment cleaning when idle + Cannot start segment cleaning while the robot is busy } diff --git a/frontend/src/map/actions/ZoneActions.tsx b/frontend/src/map/actions/ZoneActions.tsx index 38887f66e7b..428393c31b9 100644 --- a/frontend/src/map/actions/ZoneActions.tsx +++ b/frontend/src/map/actions/ZoneActions.tsx @@ -40,7 +40,7 @@ const ZoneActions = ( refetch: refetchZoneProperties, } = useZonePropertiesQuery(); - const canClean = status === "idle" || status === "docked"; + const canClean = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error"; const didSelectZones = zones.length > 0; const handleClick = React.useCallback(() => { @@ -181,7 +181,7 @@ const ZoneActions = ( { (didSelectZones && !canClean) && - Can only start zone cleaning when idle + Cannot start zone cleaning while the robot is busy }