Skip to content

Commit

Permalink
refactor(dashboards): 🎉 update imports and dashoards
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Nov 3, 2023
1 parent 7af675d commit f2b3a00
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 112 deletions.
40 changes: 11 additions & 29 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1248,10 +1248,6 @@ video {
width: 0.75rem;
}

.w-3\/4 {
width: 75%;
}

.w-32 {
width: 8rem;
}
Expand Down Expand Up @@ -1424,6 +1420,13 @@ video {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
}

.scale-110 {
--tw-scale-x: 1.1;
--tw-scale-y: 1.1;
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-150 {
--tw-scale-x: 1.5;
--tw-scale-y: 1.5;
Expand Down Expand Up @@ -1459,13 +1462,6 @@ video {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-\[1\.8\] {
--tw-scale-x: 1.8;
--tw-scale-y: 1.8;
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-\[2\.25\] {
--tw-scale-x: 2.25;
--tw-scale-y: 2.25;
Expand All @@ -1480,20 +1476,6 @@ video {
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-125 {
--tw-scale-x: 1.25;
--tw-scale-y: 1.25;
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.scale-110 {
--tw-scale-x: 1.1;
--tw-scale-y: 1.1;
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.transform {
-webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
Expand Down Expand Up @@ -1729,6 +1711,10 @@ video {
overflow-wrap: break-word;
}

.\!rounded-full {
border-radius: 9999px !important;
}

.rounded {
border-radius: 0.25rem;
}
Expand All @@ -1745,10 +1731,6 @@ video {
border-radius: 0.375rem;
}

.\!rounded-full {
border-radius: 9999px !important;
}

.rounded-l-lg {
border-top-left-radius: 0.5rem;
border-bottom-left-radius: 0.5rem;
Expand Down
4 changes: 2 additions & 2 deletions src/components/CFAdvancedSettings/CFAdvancedSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CFPortSetter from "../CFPortSetter/CFPortSetter";
import CFPersistDirTags from "../CFPersistDirTags/CFPersistDirTags";
import { IDetails } from "../../interfaces/robotInterfaces";
import CFGrantDirTags from "../CFGrantDirTags/CFGrantDirTags";
import { IDetails } from "../../interfaces/robotInterfaces";
import CFPortSetter from "../CFPortSetter/CFPortSetter";
import Accordion from "../Accordion/AccordionV2";
import { FormikProps } from "formik/dist/types";
import { ReactElement, useState } from "react";
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/ProfileContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { createContext, useState } from "react";
import { Itabs, ProfileActiveTab } from "../interfaces/profileInterfaces";
import React, { createContext, useState } from "react";

export const ProfileContext: any = createContext<any>(null);

Expand Down
42 changes: 21 additions & 21 deletions src/contexts/RobotContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, createContext, useState } from "react";
import { envOnPremiseFleet, envOnPremiseRobot } from "../helpers/envProvider";
import React, { useEffect, createContext, useState } from "react";
import { IrobotPages } from "../interfaces/generalInterfaces";
import useFunctions from "../hooks/useFunctions";
import adrinData from "../mock/adrinData.json";
Expand Down Expand Up @@ -71,7 +71,7 @@ export default ({ children }: any) => {
!sidebarState?.isOpen &&
Array.isArray(responseRobot?.robotClusters) &&
responseRobot?.robotClusters?.filter(
(robot: any) => robot?.robotStatus !== "EnvironmentReady"
(robot: any) => robot?.robotStatus !== "EnvironmentReady",
)?.length
) {
envOnPremiseRobot ? handleGetEnvironment() : handleGetRobot();
Expand All @@ -81,7 +81,7 @@ export default ({ children }: any) => {
const timerResponseBuildManager = setInterval(() => {
!sidebarState?.isOpen &&
responseBuildManager?.robotClusters?.filter(
(robot: any) => robot?.buildManagerStatus !== "Ready"
(robot: any) => robot?.buildManagerStatus !== "Ready",
)?.length &&
!envOnPremiseRobot &&
handleGetBuildManager();
Expand Down Expand Up @@ -128,10 +128,10 @@ export default ({ children }: any) => {
useEffect(() => {
if (
responseRobot?.robotClusters?.filter(
(robot: any) => robot?.robotStatus !== "EnvironmentReady"
(robot: any) => robot?.robotStatus !== "EnvironmentReady",
)?.length ||
responseBuildManager?.robotClusters?.filter(
(robot: any) => robot?.buildManagerStatus !== "Ready"
(robot: any) => robot?.buildManagerStatus !== "Ready",
)?.length ||
responseLaunchManagers
?.map((launchStep: any) => {
Expand Down Expand Up @@ -172,7 +172,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: !responseRobot,
isSetState: true,
setPages: true,
}
},
);
}

Expand All @@ -186,7 +186,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: !responseRobot,
isSetState: true,
setPages: true,
}
},
);
}

Expand All @@ -203,7 +203,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: !responseRobot,
isSetState: true,
setPages: true,
}
},
);
}

Expand All @@ -212,15 +212,15 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
fleetName: url?.fleetName!,
},
{
ifErrorNavigateTo404: !responseRobot,
isSetState: true,
setPages: true,
}
},
);
}

Expand All @@ -229,15 +229,15 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
namespaceName: url?.fleetName!,
},
{
ifErrorNavigateTo404: !responseRobot,
isSetState: true,
setPages: true,
}
},
);
}

Expand All @@ -246,7 +246,7 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
fleetName: pagesState?.fleet?.name,
robotName: url?.robotName!,
Expand All @@ -255,7 +255,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: !responseRobot,
setRobotData: true,
setResponse: setResponseRobot,
}
},
);
}

Expand All @@ -264,7 +264,7 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
fleetName: pagesState?.fleet?.name,
environmentName: url?.robotName!,
Expand All @@ -273,7 +273,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: !responseRobot,
setResponse: setResponseRobot,
setRobotData: true,
}
},
);
}

Expand All @@ -282,7 +282,7 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
fleetName: pagesState?.fleet?.name,
robotName: url?.robotName!,
Expand All @@ -291,7 +291,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: false,
setResponse: setResponseBuildManager,
setRobotData: true,
}
},
);
}

Expand All @@ -300,7 +300,7 @@ export default ({ children }: any) => {
{
organizationId: pagesState?.organization?.organizationId!,
roboticsCloudName: pagesState?.roboticsCloud?.name!,
instanceId: pagesState?.instance?.instanceId,
instanceId: pagesState?.instance?.instanceId!,
region: pagesState?.roboticsCloud?.region!,
fleetName: pagesState?.fleet?.name,
robotName: url?.robotName!,
Expand All @@ -309,7 +309,7 @@ export default ({ children }: any) => {
ifErrorNavigateTo404: false,
setResponse: setResponseLaunchManagers,
setRobotData: true,
}
},
);
}

Expand All @@ -323,7 +323,7 @@ export default ({ children }: any) => {
| "Settings"
| "Remote Desktop"
| "Development Suite"
| "Code Editor"
| "Code Editor",
) {
setActiveTab("Loading");

Expand Down
6 changes: 5 additions & 1 deletion src/layouts/RobotSubPageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { ReactElement } from "react";
import DevelopmentSuite from "../pages/RobotPage/DevelopmentSuite/DevelopmentSuite";
import Teleoperation from "../pages/RobotPage/Teleoperation/Teleoperation";
import Visualization from "../pages/RobotPage/Visualization/Visualization";
import RemoteDesktop from "../pages/RobotPage/RemoteDesktop/RemoteDesktop";
import RosConnector from "../components/RosConnector/RosConnector";
import CodeEditor from "../components/CodeEditor/CodeEditor";
import Overview from "../pages/RobotPage/Overview/Overview";
import { envOnPremiseRobot } from "../helpers/envProvider";
Expand All @@ -11,12 +11,16 @@ import BarcodeContext from "../contexts/BarcodeContext";
import MissionContext from "../contexts/MissionContext";
import { useAppSelector } from "../hooks/redux";
import useRobot from "../hooks/useRobot";
import { ReactElement } from "react";

export default function RobotSubPageLayout(): ReactElement {
const { activeTab, setActiveTab, responseRobot, isSettedCookie } = useRobot();
const { urls } = useAppSelector((state) => state.robot);

return (
<div className="col-span-full">
{!envOnPremiseRobot && <RosConnector />}

{(() => {
switch (activeTab) {
case "Overview":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import useMain from "../../../hooks/useMain";
import { RiCpuLine } from "react-icons/ri";
import { BsGpuCard } from "react-icons/bs";

export default function CloudInstanceDashboardPage(): ReactElement {
export default function CIDashboard(): ReactElement {
const [responseFleets, setResponseFleets] = useState<any>(undefined);
const {
getOrganization,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getGuideItem } from "../../../functions/handleGuide";
import TourGuide from "../../../components/TourGuide/TourGuide";
import { NamespaceTableData } from "../../../controllers/NamespaceTableData";

export default function FleetDashboardPage(): ReactElement {
export default function NSDashboard(): ReactElement {
const [responseRobots, setResponseRobots] = useState<any>(undefined);
const { pagesState, selectedState } = useMain();
const [reload, setReload] = useState<boolean>(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, { ReactElement, useEffect, useState } from "react";
import InformationWidget from "../../../components/InformationWidget/InformationWidget";
import RegionsWidget from "../../../components/RegionsWidget/RegionsWidget";
import { stringCapitalization } from "../../../functions/GeneralFunctions";
import CountWidget from "../../../components/CountWidget/CountWidget";
import GeneralTable from "../../../components/Table/GeneralTable";
import React, { ReactElement, useEffect, useState } from "react";
import { OrgTableData } from "../../../controllers/OrgTableData";
import TourGuide from "../../../components/TourGuide/TourGuide";
import DashboardLayout from "../../../layouts/DashboardLayout";
import { getGuideItem } from "../../../functions/handleGuide";
import useFunctions from "../../../hooks/useFunctions";
import { useParams } from "react-router-dom";
import useMain from "../../../hooks/useMain";
import { OrgTableData } from "../../../controllers/OrgTableData";

export default function OrganizationDashboardPage(): ReactElement {
export default function OrgDashboard(): ReactElement {
const [reload, setReload] = useState<boolean>(false);
const { getOrganization, getRoboticsClouds } = useFunctions();
const { pagesState } = useMain();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useFunctions from "../../../hooks/useFunctions";
import { useParams } from "react-router-dom";
import useMain from "../../../hooks/useMain";

export default function RoboticsCloudDashboardPage(): ReactElement {
export default function RegionDashboard(): ReactElement {
const [responseInstances, setResponseInstances] = useState<any[] | undefined>(
undefined,
);
Expand Down
13 changes: 8 additions & 5 deletions src/pages/Profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React, { ReactElement } from "react";
import ProfileHeader from "../../components/ProfileHeader/ProfileHeader";
import ProfileSubPageLayout from "../../layouts/ProfileSubPageLayout";
import ProfileContext from "../../contexts/ProfileContext";
import React, { ReactElement } from "react";

export default function Profile(): ReactElement {
return (
<div className="grid grid-cols-2 gap-6">
<ProfileHeader />
<ProfileSubPageLayout />
</div>
<ProfileContext>
<div className="grid grid-cols-2 gap-6">
<ProfileHeader />
<ProfileSubPageLayout />
</div>
</ProfileContext>
);
}
Loading

0 comments on commit f2b3a00

Please sign in to comment.