-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve mission page #1848
base: main
Are you sure you want to change the base?
Improve mission page #1848
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,8 @@ const HeaderSection = styled(Card)` | |
top: 60px; | ||
position: sticky; | ||
z-index: 1; | ||
background-color: ${tokens.colors.ui.background__light.hex}; | ||
box-shadow: none; | ||
background-color: ${tokens.colors.ui.background__light.hex}; | ||
` | ||
const TitleSection = styled.div` | ||
display: flex; | ||
|
@@ -28,17 +28,15 @@ const TitleSection = styled.div` | |
const InfoSection = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8px; | ||
max-width: 950px; | ||
` | ||
const StyledCard = styled(Card)` | ||
display: flex; | ||
flex: 1 0 0; | ||
padding: 8px 16px; | ||
flex-direction: row; | ||
background: ${tokens.colors.ui.background__default.hex}; | ||
gap: 24px; | ||
align-items: stretch; | ||
gap: 32px; | ||
width: fit-content; | ||
@media (max-width: 600px) { | ||
display: grid; | ||
grid-template-columns: repeat(3, calc(75vw / 3)); | ||
gap: 32px; | ||
width: fit-content; | ||
align-items: end; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
` | ||
const StyledTitleText = styled.div` | ||
display: grid; | ||
|
@@ -51,12 +49,25 @@ const StyledTypography = styled(Typography)` | |
font-style: normal; | ||
font-weight: 400; | ||
line-height: 40px; /* 125% */ | ||
|
||
@media (max-width: 500px) { | ||
font-size: 24px; | ||
} | ||
` | ||
|
||
const StyledMissionHeader = styled(Card)` | ||
display: flex; | ||
padding: 24px 10px 10px 10px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 24px; | ||
flex: 1 0 0; | ||
align-self: stretch; | ||
border-radius: 6px; | ||
border: 1px solid ${tokens.colors.ui.background__medium.rgba}; | ||
background: ${tokens.colors.ui.background__default.rgba}; | ||
max-width: fit-content; | ||
` | ||
|
||
const HeaderText = (title: string, text: string) => { | ||
return ( | ||
<StyledTitleText> | ||
|
@@ -186,23 +197,18 @@ export const MissionHeader = ({ mission }: { mission: Mission }) => { | |
</Typography> | ||
<StatusReason statusReason={mission.statusReason} status={mission.status}></StatusReason> | ||
</HeaderSection> | ||
<InfoSection> | ||
<StyledCard> | ||
<StyledMissionHeader> | ||
<InfoSection> | ||
<div> | ||
{HeaderText(translatedStatus, '')} | ||
<MissionStatusDisplay status={mission.status} /> | ||
</div> | ||
{HeaderText(translatedArea, `${mission.area?.areaName}`)} | ||
{HeaderText(translatedTasks, `${numberOfCompletedTasks + '/' + mission.tasks.length}`)} | ||
</StyledCard> | ||
<StyledCard> | ||
{HeaderText(translatedStartDate, `${startDate}`)} | ||
{HeaderText(translatedStartTime, `${startTime}`)} | ||
</StyledCard> | ||
<StyledCard> | ||
{HeaderText(translatedUsedTime, `${usedTime}`)} | ||
{!isMissionCompleted && HeaderText(translatedEstimatedTimeRemaining, `${remainingTime}`)} | ||
</StyledCard> | ||
<StyledCard> | ||
{HeaderText(translatedRobot, `${mission.robot.name}`)} | ||
{!isMissionCompleted && HeaderText(translatedBatteryLevel, batteryValue)} | ||
{!isMissionCompleted && | ||
|
@@ -212,8 +218,8 @@ export const MissionHeader = ({ mission }: { mission: Mission }) => { | |
translatedPressureLevel, | ||
`${Math.round(mission.robot.pressureLevel * barToMillibar)}mBar` | ||
)} | ||
</StyledCard> | ||
</InfoSection> | ||
</InfoSection> | ||
</StyledMissionHeader> | ||
</> | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,18 +19,37 @@ import { tokens } from '@equinor/eds-tokens' | |
import { StyledPage } from 'components/Styles/StyledComponents' | ||
import { InspectionDialogView, InspectionsViewSection } from '../InspectionReportPage.tsx/InspectionView' | ||
import { useInspectionsContext } from 'components/Contexts/InpectionsContext' | ||
import { Typography } from '@equinor/eds-core-react' | ||
|
||
const StyledMissionPage = styled(StyledPage)` | ||
background-color: ${tokens.colors.ui.background__light.hex}; | ||
` | ||
const TaskAndMapSection = styled.div` | ||
display: flex; | ||
min-width: 50%; | ||
max-width: fit-content; | ||
min-height: 60%; | ||
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values feel a bit arbitrary. Are they necessary? Look at ContainButton for missionHistoryButton for inspiration |
||
padding: 24px; | ||
@media (max-width: 600px) { | ||
padding: 6px 8px 8px 6px; | ||
} | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: 8px; | ||
align-self: stretch; | ||
border-radius: 6px; | ||
border: 1px solid ${tokens.colors.ui.background__medium.rgba}; | ||
background: ${tokens.colors.ui.background__default.rgba}; | ||
` | ||
|
||
const StyledTableAndMap = styled.div` | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 8rem; | ||
padding-top: 16px; | ||
padding-bottom: 16px; | ||
align-items: top; | ||
gap: 24px; | ||
` | ||
|
||
export const VideoStreamSection = styled.div` | ||
display: grid; | ||
gap: 1rem; | ||
|
@@ -104,8 +123,11 @@ export const MissionPage = () => { | |
<> | ||
<MissionHeader mission={selectedMission} /> | ||
<TaskAndMapSection> | ||
<TaskTable tasks={selectedMission?.tasks} /> | ||
<MissionMapView mission={selectedMission} /> | ||
<Typography variant="h4">{TranslateText('Tasks')}</Typography> | ||
<StyledTableAndMap> | ||
<TaskTable tasks={selectedMission?.tasks} /> | ||
<MissionMapView mission={selectedMission} /> | ||
</StyledTableAndMap> | ||
</TaskAndMapSection> | ||
<VideoStreamSection> | ||
{videoMediaStreams && videoMediaStreams.length > 0 && ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import { useLanguageContext } from 'components/Contexts/LanguageContext' | |
import { Task, TaskStatus } from 'models/Task' | ||
import { tokens } from '@equinor/eds-tokens' | ||
import { getColorsFromTaskStatus } from 'utils/MarkerStyles' | ||
import { StyledTableBody, StyledTableCaptionGray, StyledTableCell } from 'components/Styles/StyledComponents' | ||
import { InspectionType } from 'models/Inspection' | ||
import { useInspectionsContext } from 'components/Contexts/InpectionsContext' | ||
|
||
|
@@ -35,23 +34,18 @@ export const TaskTable = ({ tasks }: TaskTableProps) => { | |
const { TranslateText } = useLanguageContext() | ||
|
||
return ( | ||
<> | ||
<StyledTable> | ||
<StyledTableCaptionGray> | ||
<StyledTypography variant="h2">{TranslateText('Tasks')}</StyledTypography> | ||
</StyledTableCaptionGray> | ||
<Table.Head> | ||
<Table.Row> | ||
<StyledTableCell>#</StyledTableCell> | ||
<StyledTableCell>{TranslateText('Tag-ID')}</StyledTableCell> | ||
<StyledTableCell>{TranslateText('Description')}</StyledTableCell> | ||
<StyledTableCell>{TranslateText('Inspection Types')}</StyledTableCell> | ||
<StyledTableCell>{TranslateText('Status')}</StyledTableCell> | ||
</Table.Row> | ||
</Table.Head> | ||
<StyledTableBody>{tasks && <TaskTableRows tasks={tasks} />}</StyledTableBody> | ||
</StyledTable> | ||
</> | ||
<StyledTable> | ||
<Table.Head> | ||
<Table.Row> | ||
<Table.Cell>#</Table.Cell> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
<Table.Cell>{TranslateText('Tag-ID')}</Table.Cell> | ||
<Table.Cell>{TranslateText('Description')}</Table.Cell> | ||
<Table.Cell>{TranslateText('Inspection Types')}</Table.Cell> | ||
<Table.Cell>{TranslateText('Status')}</Table.Cell> | ||
</Table.Row> | ||
</Table.Head> | ||
<Table.Body>{tasks && <TaskTableRows tasks={tasks} />}</Table.Body> | ||
</StyledTable> | ||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest putting the "Add to queue"-button under the title on smal screen (maybe flex: wrap?)