diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index a6ee03156..88ce3bfc0 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,3 @@ -import './app.css' import { AuthenticatedTemplate, UnauthenticatedTemplate } from '@azure/msal-react' import { SignInPage } from './components/SignInPage/SignInPage' import { FlotillaSite } from 'components/FrontPage/FlotillaSite' diff --git a/frontend/src/app.css b/frontend/src/app.css deleted file mode 100644 index 9b5698950..000000000 --- a/frontend/src/app.css +++ /dev/null @@ -1,25 +0,0 @@ -.app-ui { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(384px, 1fr)); - grid-gap: 16px; - margin-left: 24px; - margin-top: 24px; -} - -.header { - grid-column-start: 1; - grid-column-end: -1; -} - -.robot-overview { - grid-column-end: span 2; - grid-row-end: span 2; - max-height: 500px; -} - -.mission-overview { - grid-column-end: span 2; - grid-row-end: span 2; - overflow: auto; - max-height: 500px; -} diff --git a/frontend/src/components/FrontPage/FlotillaSite.tsx b/frontend/src/components/FrontPage/FlotillaSite.tsx index e8552482c..0316bbd74 100644 --- a/frontend/src/components/FrontPage/FlotillaSite.tsx +++ b/frontend/src/components/FrontPage/FlotillaSite.tsx @@ -3,7 +3,6 @@ import { fetchAccessToken } from 'authConfig' import { createContext, useEffect, useState } from 'react' import { BrowserRouter, Route, Routes } from 'react-router-dom' import { FrontPage } from './FrontPage' -import { TestPage } from './TestPage' export const AccessTokenContext = createContext('') @@ -24,7 +23,6 @@ export function FlotillaSite() { } /> - } /> diff --git a/frontend/src/components/FrontPage/FrontPage.tsx b/frontend/src/components/FrontPage/FrontPage.tsx index d57921d3f..e8907ed60 100644 --- a/frontend/src/components/FrontPage/FrontPage.tsx +++ b/frontend/src/components/FrontPage/FrontPage.tsx @@ -1,30 +1,33 @@ -import { Typography, Button } from '@equinor/eds-core-react' -import { RobotOverview } from 'components/RobotOverview' -import { ProfileContent } from 'components/SignInPage/ProfileContent' -import { defaultRobots } from 'models/robot' +import { Button } from '@equinor/eds-core-react' +import { MissionView } from 'components/MissionOverview/MissionView' +import { RobotStatusSection } from 'components/RobotCards/RobotStatusSection' +import { useApi } from 'components/SignInPage/ApiCaller' +import styled from 'styled-components' -const robots = [defaultRobots['taurob'], defaultRobots['exRobotics'], defaultRobots['turtle']] +const StyledFrontPage = styled.div` + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 1rem; +` export function FrontPage() { + const apiCaller = useApi() + var backendRobots return ( - <> - -
- + + + +
+
-
- - Flotilla - -
-
- -
-
- - Mission Overview - -
- +
) } diff --git a/frontend/src/components/FrontPage/TestPage.tsx b/frontend/src/components/FrontPage/TestPage.tsx deleted file mode 100644 index c888fd977..000000000 --- a/frontend/src/components/FrontPage/TestPage.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { Button } from '@equinor/eds-core-react' -import { MissionView } from 'components/MissionOverview/MissionView' -import { RobotStatusSection } from 'components/RobotCards/RobotStatusSection' -import { useApi } from 'components/SignInPage/ApiCaller' -import { defaultRobots } from 'models/robot' -import styled from 'styled-components' -const robots = [defaultRobots['taurob'], defaultRobots['exRobotics'], defaultRobots['turtle']] - -const FrontPage = styled.div` - display: grid; - grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); - gap: 1rem; -` - -export function TestPage() { - const apiCaller = useApi() - var backendRobots - return ( - -
-

This is a test page

-
- - -
- -
-
- ) -} diff --git a/frontend/src/components/InfoButton/InfoButton.tsx b/frontend/src/components/InfoButton/InfoButton.tsx deleted file mode 100644 index 1f1227bdc..000000000 --- a/frontend/src/components/InfoButton/InfoButton.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { info_circle } from '@equinor/eds-icons' -import { Button, Icon } from '@equinor/eds-core-react' -import { Popover } from '@equinor/eds-core-react' -import { useRef, useState } from 'react' - -import { tokens } from '@equinor/eds-tokens' - -Icon.add({ info_circle }) - -interface InfoButtonProps { - title: string - content: JSX.Element -} - -const InfoButton = ({ title, content }: InfoButtonProps): JSX.Element => { - const [isOpen, setIsOpen] = useState(false) - const anchorRef = useRef(null) - - const closePopover = () => setIsOpen(false) - const toggleOpen = () => setIsOpen(!isOpen) - return ( - <> - - - {title} - {content} - - - ) -} - -export default InfoButton diff --git a/frontend/src/components/MissionOverview/MissionCard.tsx b/frontend/src/components/MissionOverview/MissionCard.tsx index e8c700ec2..98941f89d 100644 --- a/frontend/src/components/MissionOverview/MissionCard.tsx +++ b/frontend/src/components/MissionOverview/MissionCard.tsx @@ -1,4 +1,4 @@ -import { Card, Typography } from '@equinor/eds-core-react' +import { Card } from '@equinor/eds-core-react' import { tokens } from '@equinor/eds-tokens' import { ScheduledMission } from 'models/scheduledMission' interface ScheduledMissionProps { diff --git a/frontend/src/components/MissionOverview/MissionView.tsx b/frontend/src/components/MissionOverview/MissionView.tsx index 1bd77a04e..90ef19c07 100644 --- a/frontend/src/components/MissionOverview/MissionView.tsx +++ b/frontend/src/components/MissionOverview/MissionView.tsx @@ -1,4 +1,4 @@ -import { Button, Card, Typography } from '@equinor/eds-core-react' +import { Button, Typography } from '@equinor/eds-core-react' import styled from 'styled-components' import { MissionCard } from './MissionCard' import { useApi } from 'components/SignInPage/ApiCaller' diff --git a/frontend/src/components/RobotCards/RobotStatusSection.tsx b/frontend/src/components/RobotCards/RobotStatusSection.tsx index 08fa37a2e..0959c51d6 100644 --- a/frontend/src/components/RobotCards/RobotStatusSection.tsx +++ b/frontend/src/components/RobotCards/RobotStatusSection.tsx @@ -1,6 +1,5 @@ import { Typography } from '@equinor/eds-core-react' -import { useApi } from 'components/SignInPage/ApiCaller' -import { defaultRobots, Robot } from 'models/robot' +import { defaultRobots } from 'models/robot' import styled from 'styled-components' import { RobotStatusCard } from './RobotStatusCard' const robots = [defaultRobots['taurob'], defaultRobots['exRobotics'], defaultRobots['turtle']] @@ -17,8 +16,6 @@ const RobotView = styled.div` ` export function RobotStatusSection() { - const apiCaller = useApi() - // var backendRobots = apiCaller.getRobots() var defaultRobots = robots.map(function (robot, index) { return }) diff --git a/frontend/src/components/RobotOverview/RobotInfoButton.tsx b/frontend/src/components/RobotOverview/RobotInfoButton.tsx deleted file mode 100644 index 450853c01..000000000 --- a/frontend/src/components/RobotOverview/RobotInfoButton.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Typography } from '@equinor/eds-core-react' -import { Pose } from 'models/pose' -import { Robot } from 'models/robot' -import InfoButton from '../InfoButton/InfoButton' -import styles from './robotOverview.module.css' - -interface RobotInfoButtonProps { - robot: Robot -} - -interface RobotPoseInfoProps { - pose: Pose -} - -const RobotPoseInfo = ({ pose }: RobotPoseInfoProps): JSX.Element => { - return ( -
-
- Position: -
- X: {pose.position.x} - Y: {pose.position.x} - Z: {pose.position.x} -
- Orientation: -
- X: {pose.orientation.x} - Y: {pose.orientation.y} - Z: {pose.orientation.z} - W: {pose.orientation.w} -
-
-
- ) -} - -const RobotInfoButton = ({ robot }: RobotInfoButtonProps): JSX.Element => { - const content = - return -} - -export default RobotInfoButton diff --git a/frontend/src/components/RobotOverview/RobotOverview.tsx b/frontend/src/components/RobotOverview/RobotOverview.tsx deleted file mode 100644 index f342a6b37..000000000 --- a/frontend/src/components/RobotOverview/RobotOverview.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { Icon, Typography, Table } from '@equinor/eds-core-react' -import { info_circle } from '@equinor/eds-icons' -import { Robot, RobotStatus } from 'models/robot' -import { Battery } from 'models/battery' -import RobotInfoButton from './RobotInfoButton' -import styles from './robotOverview.module.css' -import RobotOverviewHeader from './RobotOverviewHeader' - -import RobotStatusView from './RobotStatusView' -import BatteryStatusView from '../RobotCards/BatteryStatusView' - -Icon.add({ info_circle }) - -interface RobotProps { - robot: Robot -} - -const RobotStatusRow = ({ robot }: RobotProps): JSX.Element => { - const name: string = robot.robotInfo.name - const type: string = robot.robotInfo.type - const status: RobotStatus = robot.status - const battery: Battery = robot.battery - return ( - - {name} - {type} - -
- -
-
- - - - - - -
- ) -} - -interface RobotOverviewProps { - robots: Robot[] -} - -const RobotOverview = ({ robots }: RobotOverviewProps): JSX.Element => { - var rows = robots.map(function (robot) { - return - }) - return ( - - - Robot Overview - - - {rows} -
- ) -} - -export default RobotOverview diff --git a/frontend/src/components/RobotOverview/RobotOverviewHeader.tsx b/frontend/src/components/RobotOverview/RobotOverviewHeader.tsx deleted file mode 100644 index 4c989cd1d..000000000 --- a/frontend/src/components/RobotOverview/RobotOverviewHeader.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { Table } from '@equinor/eds-core-react' -import React from 'react' -import styles from './robotOverview.module.css' - -interface RobotOverviewHeaderCellProps { - label: string - overideClassName?: string -} - -const RobotOverviewHeaderCell = ({ label, overideClassName }: RobotOverviewHeaderCellProps): JSX.Element => { - return ( - - {label} - - ) -} - -const RobotOverviewHeader = (): JSX.Element => { - return ( - - - - - - - - - - ) -} - -export default RobotOverviewHeader diff --git a/frontend/src/components/RobotOverview/RobotStatusView.tsx b/frontend/src/components/RobotOverview/RobotStatusView.tsx deleted file mode 100644 index f73f227a6..000000000 --- a/frontend/src/components/RobotOverview/RobotStatusView.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Typography } from '@equinor/eds-core-react' -import { RobotStatus } from 'models/robot' -import styles from './robotOverview.module.css' - -export interface RobotStatusViewProps { - status: RobotStatus -} - -const RobotStatusView = ({ status }: RobotStatusViewProps): JSX.Element => { - let style_background - if (status === RobotStatus.Available) { - style_background = styles.available - } else if (status === RobotStatus.MissionInProgress) { - style_background = styles.missionInProgress - } else { - style_background = styles.offline - } - return ( -
- {status} -
- ) -} - -export default RobotStatusView diff --git a/frontend/src/components/RobotOverview/index.ts b/frontend/src/components/RobotOverview/index.ts deleted file mode 100644 index f18a9f786..000000000 --- a/frontend/src/components/RobotOverview/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as RobotOverview } from './RobotOverview' diff --git a/frontend/src/components/RobotOverview/robotOverview.module.css b/frontend/src/components/RobotOverview/robotOverview.module.css deleted file mode 100644 index 052d79379..000000000 --- a/frontend/src/components/RobotOverview/robotOverview.module.css +++ /dev/null @@ -1,116 +0,0 @@ -.tableWrapper { - width: 100%; - margin-top: 20px; -} - -.tableCaption { -} - -.tableHeadWrapper { - display: block; - width: 100%; - table-layout: fixed; - border-bottom: none !important; -} - -.tableBodyWrapper { - height: 100%; - width: 100%; - overflow-y: auto; - display: block; -} - -.tableRowWrapper { - display: table; - table-layout: fixed; - width: 100%; - cursor: pointer; -} - -.tableCellWrapper { - overflow-x: hidden; -} - -.tableHeaderCell { - z-index: 2; - cursor: pointer; - overflow-x: hidden; -} - -.tableNameCell { - width: 20%; - overflow-x: hidden; -} - -.tableTypeCell { - width: 20%; - overflow-x: hidden; -} - -.tableStatusCell { - width: 20%; - overflow-x: hidden; -} - -.tableStatusCellDiv { - overflow-x: auto; -} - -.tableBatteryCell { - width: 10%; - overflow-x: hidden; -} - -.batteryStatus { - display: flex; - align-items: center; - justify-content: flex-end; -} - -.activeTableHeaderCell { - background-color: var(--equiGray4) !important; - color: var(--asBuilt) !important; - border-bottom: 2px solid var(--asBuilt) !important; - overflow-x: hidden; -} - -.label { - margin-right: 24px; -} - -.poseItem { - margin-left: 12px; - margin-bottom: 12px; -} - -.poseWrapper  { - margin: 12px; -} - -.infoContentWrapper { - width: 90%; - max-height: 146px; - overflow-y: auto; - margin: 12px; -} - -.available { - background-color: #c1e7c1; - border-radius: 8px; - width: inherit; - justify-content: center; -} - -.missionInProgress { - background-color: #ffdaa8; - border-radius: 8px; - width: inherit; - justify-content: center; -} - -.offline { - background-color: #ff949b; - border-radius: 8px; - width: inherit; - justify-content: center; -} diff --git a/frontend/src/components/SignInPage/ProfileContent.tsx b/frontend/src/components/SignInPage/ProfileContent.tsx deleted file mode 100644 index 425ea5b3a..000000000 --- a/frontend/src/components/SignInPage/ProfileContent.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Button } from '@equinor/eds-core-react' -import { useApi } from './ApiCaller' - -export function ProfileContent() { - const apiCaller = useApi() - return ( - <> -
Welcome
- - - ) -} diff --git a/frontend/src/components/SignInPage/SignInButton.tsx b/frontend/src/components/SignInPage/SignInButton.tsx index 4e3aed886..88a0ee2f5 100644 --- a/frontend/src/components/SignInPage/SignInButton.tsx +++ b/frontend/src/components/SignInPage/SignInButton.tsx @@ -1,6 +1,6 @@ import { useMsal } from '@azure/msal-react' import { loginRequest } from '../../authConfig' -import { Button, Icon } from '@equinor/eds-core-react' +import { Button } from '@equinor/eds-core-react' import { IPublicClientApplication } from '@azure/msal-browser' function handleLogin(instance: IPublicClientApplication) { diff --git a/frontend/src/components/SignInPage/SignInPage.tsx b/frontend/src/components/SignInPage/SignInPage.tsx index dea63fad5..a9d7f7806 100644 --- a/frontend/src/components/SignInPage/SignInPage.tsx +++ b/frontend/src/components/SignInPage/SignInPage.tsx @@ -1,4 +1,4 @@ -import { useIsAuthenticated, useMsal } from '@azure/msal-react' +import { useIsAuthenticated } from '@azure/msal-react' import { SignInButton } from './SignInButton' export const SignInPage = () => {