From d67eed3e4f2d234bb97583569ef792282b18c43f Mon Sep 17 00:00:00 2001 From: Anette Uttisrud Date: Sun, 5 Nov 2023 08:43:37 +0100 Subject: [PATCH 1/3] Use capital letter only in first word in norwegian --- frontend/src/language/no.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/language/no.json b/frontend/src/language/no.json index ced56af03..a71248450 100644 --- a/frontend/src/language/no.json +++ b/frontend/src/language/no.json @@ -183,8 +183,8 @@ "transport": "transport", "Queue the missions": "Legg oppdragene i kø", "Deck Overview": "Dekkoversikt", - "Predefined Missions": "Forhåndsdefinerte Oppdrag", - "Create a new mission in the Mission Planner": "Lag nytt oppdrag i Oppdragsplanlegger", + "Predefined Missions": "Forhåndsdefinerte oppdrag", + "Create a new mission in the Mission Planner": "Lag nytt oppdrag i oppdragsplanlegger", "Must be inspected this week": "Må inspiseres denne uken", "Must be inspected within two weeks": "Må inspiseres innen to uker", "Mission": "Oppdrag", @@ -200,6 +200,6 @@ "Dismiss robots from safe zone long text": "Vanlig drift kan fortsette ved å starte oppdragene i køen eller ved å slette dem.", "Dismiss robots from safe zone": "Slipp robotene ut av trygg sone", "Continue missions": "Fortsett oppdragene", - "Safe Zone": "Trygg Sone", + "Safe Zone": "Trygg sone", "Edit mission definition": "Rediger oppdragsdefinisjon" } From a45df24325ec41bf69e6a3c57f0d009647428371 Mon Sep 17 00:00:00 2001 From: Anette Uttisrud Date: Sat, 4 Nov 2023 17:41:36 +0100 Subject: [PATCH 2/3] Refactor status display on ongoing mission card --- .../MissionProgressDisplay.tsx | 9 ++- .../MissionOverview/MissionRobotDisplay.tsx | 27 ++++++++ .../MissionOverview/MissionStatusDisplay.tsx | 16 ++++- .../MissionOverview/OngoingMissionCard.tsx | 68 +++++-------------- .../RobotCards/BatteryStatusView.tsx | 2 +- frontend/src/language/en.json | 3 +- frontend/src/language/no.json | 3 +- 7 files changed, 68 insertions(+), 60 deletions(-) create mode 100644 frontend/src/components/Pages/FrontPage/MissionOverview/MissionRobotDisplay.tsx diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/MissionProgressDisplay.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionProgressDisplay.tsx index 6167817b1..909c3f65b 100644 --- a/frontend/src/components/Pages/FrontPage/MissionOverview/MissionProgressDisplay.tsx +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionProgressDisplay.tsx @@ -8,6 +8,8 @@ import { tokens } from '@equinor/eds-tokens' const StyledTagCount = styled.div` display: flex; + flex-direction: column; + justify-content: space-between; ` interface MissionProps { mission: Mission @@ -29,8 +31,11 @@ export function MissionProgressDisplay({ mission }: MissionProps) { return ( - - {TranslateText('Task')} {completedTasks}/{tasks.length} + + {TranslateText('Completed Tasks')} + + + {completedTasks}/{tasks.length} ) diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/MissionRobotDisplay.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionRobotDisplay.tsx new file mode 100644 index 000000000..4733b8982 --- /dev/null +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionRobotDisplay.tsx @@ -0,0 +1,27 @@ +import { Typography } from '@equinor/eds-core-react' +import styled from 'styled-components' +import { useLanguageContext } from 'components/Contexts/LanguageContext' +import { Mission } from 'models/Mission' +import { tokens } from '@equinor/eds-tokens' + +const StyledRobotDisplay = styled.div` + display: flex; + flex-direction: column; + justify-content: space-between; +` + +interface MissionProps { + mission: Mission +} + +export function MissionRobotDisplay({ mission }: MissionProps) { + const { TranslateText } = useLanguageContext() + return ( + + + {TranslateText('Robot')} + + {mission.robot.name} + + ) +} diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/MissionStatusDisplay.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionStatusDisplay.tsx index e9ae51884..3d3291d07 100644 --- a/frontend/src/components/Pages/FrontPage/MissionOverview/MissionStatusDisplay.tsx +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/MissionStatusDisplay.tsx @@ -11,7 +11,12 @@ interface StatusProps { const StyledStatusDisplay = styled.div` display: flex; - gap: 0.3em; + flex-direction: column; + justify-content: space-between; +` +const StyledStatusIcon = styled.div` + display: flex; + gap: 4px; align-items: flex-end; ` @@ -40,8 +45,13 @@ export function MissionStatusDisplay({ status }: StatusProps) { const { TranslateText } = useLanguageContext() return ( - {displayIcon(status)} - {TranslateText(status)} + + {TranslateText('Status')} + + + {displayIcon(status)} + {TranslateText(status)} + ) } diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx index eee7ed633..a58166949 100644 --- a/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx @@ -9,6 +9,7 @@ import { useNavigate } from 'react-router-dom' import { MissionControlButtons } from './MissionControlButtons' import BatteryStatusView from '../RobotCards/BatteryStatusView' import { BatteryStatus } from 'models/Battery' +import { MissionRobotDisplay } from './MissionRobotDisplay' interface MissionProps { mission: Mission @@ -18,44 +19,24 @@ const StyledMissionCard = styled(Card)` width: 432px; padding: 10px; ` - const StyledTitle = styled(Card)` width: 70%; height: 80%; + justify-content: center; + padding-left: 12px; :hover { background-color: #deedee; } box-shadow: none; ` -const HorizontalContent = styled.div` - display: grid; - grid-template-columns: auto auto auto; - align-items: end; - gap: 1rem; -` const TopContent = styled.div` display: flex; - flex-direction: row; justify-content: space-between; ` const BottomContent = styled.div` display: flex; - flex-direction: row; - justify-content: space-between; - align-items: end; - padding-right: 25px; -` -const VerticalContent = styled.div` - display: grid; - grid-template-rows: auto auto; justify-content: space-between; ` - -const StyledPadding = styled.div` - padding: 10px; - border-radius: 3px; -` - export function OngoingMissionCard({ mission }: MissionProps) { let navigate = useNavigate() const routeChange = () => { @@ -63,41 +44,24 @@ export function OngoingMissionCard({ mission }: MissionProps) { navigate(path) } return ( - + - - - - {mission.name} - - + + + {mission.name} + - - - {'Status'} - - - - - - - -
- - {'Robot'} - - - {' '} - {mission.robot.name} - -
+ + + +
) diff --git a/frontend/src/components/Pages/FrontPage/RobotCards/BatteryStatusView.tsx b/frontend/src/components/Pages/FrontPage/RobotCards/BatteryStatusView.tsx index c0f18c8bf..33c20f128 100644 --- a/frontend/src/components/Pages/FrontPage/RobotCards/BatteryStatusView.tsx +++ b/frontend/src/components/Pages/FrontPage/RobotCards/BatteryStatusView.tsx @@ -7,7 +7,7 @@ import { RobotStatus } from 'models/Robot' const BatteryAlignment = styled.div` display: flex; - align-items: center; + align-items: end; ` const StyledTopography = styled(Typography)<{ $fontSize?: 24 | 16 | 18 | 32 | 40 | 48 }>` diff --git a/frontend/src/language/en.json b/frontend/src/language/en.json index af1918217..2d03fbdab 100644 --- a/frontend/src/language/en.json +++ b/frontend/src/language/en.json @@ -201,5 +201,6 @@ "Dismiss robots from safe zone": "Dismiss robots from safe zone", "Continue missions": "Continue missions", "Safe Zone": "Safe Zone", - "Edit mission definition": "Edit mission definition" + "Edit mission definition": "Edit mission definition", + "Completed Tasks": "Completed Tasks" } diff --git a/frontend/src/language/no.json b/frontend/src/language/no.json index a71248450..7b0d7a634 100644 --- a/frontend/src/language/no.json +++ b/frontend/src/language/no.json @@ -201,5 +201,6 @@ "Dismiss robots from safe zone": "Slipp robotene ut av trygg sone", "Continue missions": "Fortsett oppdragene", "Safe Zone": "Trygg sone", - "Edit mission definition": "Rediger oppdragsdefinisjon" + "Edit mission definition": "Rediger oppdragsdefinisjon", + "Completed Tasks": "Fullførte oppgaver" } From 3bc53881598da00d026ade01992c05a93c022005 Mon Sep 17 00:00:00 2001 From: Anette Uttisrud Date: Wed, 8 Nov 2023 15:50:22 +0100 Subject: [PATCH 3/3] Edit width and padding of ongoing mission card --- .../Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx b/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx index a58166949..8ad76dfd1 100644 --- a/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx +++ b/frontend/src/components/Pages/FrontPage/MissionOverview/OngoingMissionCard.tsx @@ -16,8 +16,8 @@ interface MissionProps { } const StyledMissionCard = styled(Card)` - width: 432px; - padding: 10px; + width: 372px; + padding: 12px; ` const StyledTitle = styled(Card)` width: 70%;