From b3b7ff4e38b1adc42a8706dbb9a8111b592e9cf5 Mon Sep 17 00:00:00 2001 From: gokhangunduz Date: Fri, 19 Jan 2024 09:49:32 +0300 Subject: [PATCH] refactor(animate): :tada: update animate and imports --- src/App.tsx | 2 +- .../BuildManagerStepsTable.tsx | 8 ++--- src/components/CFBuildScope/CFBuildScope.tsx | 6 ++-- .../CFLaunchScope/CFLaunchScope.tsx | 6 ++-- .../CreateRobotFormCodeScope.tsx | 4 +-- src/components/Header/Header.tsx | 3 +- .../HeaderDropdownMenu/HeaderDropdownMenu.tsx | 2 +- src/components/Sidebar/Sidebar.tsx | 2 +- .../SidebarMenuItem/SideBarMenuItem.tsx | 2 +- .../SidebarStaticItem/SidebarStaticItem.tsx | 2 +- .../EnvironmentActionCells.tsx | 6 ++-- .../TableActionCells/FleetActionCells.tsx | 4 +-- .../TableActionCells/InvoiceActionCells.tsx | 14 ++++----- .../TableActionCells/NamespaceActionCells.tsx | 2 +- .../OrganizationActionCells.tsx | 4 +-- .../TableActionCells/RegionsActionCells.tsx | 4 +-- .../TableActionCells/RobotActionCells.tsx | 6 ++-- .../TableActionCells/UserActionCells.tsx | 8 ++--- .../RobotServicesCell.tsx | 29 ------------------- .../TaskManagementContextMenu.tsx | 16 +++++----- .../TeleoperationControlBar.tsx | 10 +++---- src/components/TickCell/TickCell.tsx | 6 ++-- .../UpdateRobotLaunchsForm.tsx | 2 +- src/contexts/VDIContext.tsx | 17 ++++++----- src/controllers/NamespaceTableData.tsx | 13 ++++----- src/layouts/PrivateLayout/PrivateLayout.tsx | 2 +- src/modals/DeleteBuildManagerModal.tsx | 4 +-- src/modals/DeleteLaunchManagerModal.tsx | 4 +-- 28 files changed, 79 insertions(+), 109 deletions(-) delete mode 100644 src/components/TableInformationCells/RobotServicesCell.tsx diff --git a/src/App.tsx b/src/App.tsx index 48a1a422..c9ca30f0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ -import { ReactElement } from "react"; import VersionViewer from "./components/VersionViewer/VersionViewer"; import ThemeContext from "./contexts/ThemeContext"; import AppRoutes from "./routes/AppRoutes"; +import { ReactElement } from "react"; import { Toaster } from "sonner"; export default function App(): ReactElement { diff --git a/src/components/BuildManagerStepsTable/BuildManagerStepsTable.tsx b/src/components/BuildManagerStepsTable/BuildManagerStepsTable.tsx index e9b51dcc..8242bb53 100644 --- a/src/components/BuildManagerStepsTable/BuildManagerStepsTable.tsx +++ b/src/components/BuildManagerStepsTable/BuildManagerStepsTable.tsx @@ -1,11 +1,11 @@ -import React, { ReactElement, useMemo } from "react"; -import GeneralTable from "../Table/GeneralTable"; -import InfoCell from "../TableInformationCells/InfoCell"; -import { useParams } from "react-router-dom"; import BasicCell from "../TableInformationCells/BasicCell"; import StateCell from "../TableInformationCells/StateCell"; import LogsCell from "../TableInformationCells/LogsCell"; +import InfoCell from "../TableInformationCells/InfoCell"; import useCreateRobot from "../../hooks/useCreateRobot"; +import React, { ReactElement, useMemo } from "react"; +import GeneralTable from "../Table/GeneralTable"; +import { useParams } from "react-router-dom"; import TickCell from "../TickCell/TickCell"; interface IBuildManagerStepsTable { diff --git a/src/components/CFBuildScope/CFBuildScope.tsx b/src/components/CFBuildScope/CFBuildScope.tsx index 62bbcdbc..5770d3d8 100644 --- a/src/components/CFBuildScope/CFBuildScope.tsx +++ b/src/components/CFBuildScope/CFBuildScope.tsx @@ -1,9 +1,9 @@ -import React, { ReactElement } from "react"; import CreateRobotFormCodeScope from "../CreateRobotFormCodeScope/CreateRobotFormCodeScope"; -import { FormikProps } from "formik/dist/types"; import { IBuildSteps } from "../../interfaces/robotInterfaces"; -import useMain from "../../hooks/useMain"; import useCreateRobot from "../../hooks/useCreateRobot"; +import { FormikProps } from "formik/dist/types"; +import React, { ReactElement } from "react"; +import useMain from "../../hooks/useMain"; interface ICFBuildScope { formik: FormikProps; diff --git a/src/components/CFLaunchScope/CFLaunchScope.tsx b/src/components/CFLaunchScope/CFLaunchScope.tsx index a8e60113..b2d45900 100644 --- a/src/components/CFLaunchScope/CFLaunchScope.tsx +++ b/src/components/CFLaunchScope/CFLaunchScope.tsx @@ -1,9 +1,9 @@ -import { ReactElement } from "react"; +import CreateRobotFormCodeScope from "../CreateRobotFormCodeScope/CreateRobotFormCodeScope"; import { ILaunchStep } from "../../interfaces/robotInterfaces"; +import useCreateRobot from "../../hooks/useCreateRobot"; import { FormikProps } from "formik/dist/types"; -import CreateRobotFormCodeScope from "../CreateRobotFormCodeScope/CreateRobotFormCodeScope"; import useMain from "../../hooks/useMain"; -import useCreateRobot from "../../hooks/useCreateRobot"; +import { ReactElement } from "react"; interface ICFLaunchScope { formik: FormikProps; diff --git a/src/components/CreateRobotFormCodeScope/CreateRobotFormCodeScope.tsx b/src/components/CreateRobotFormCodeScope/CreateRobotFormCodeScope.tsx index e12850b1..5d765a57 100644 --- a/src/components/CreateRobotFormCodeScope/CreateRobotFormCodeScope.tsx +++ b/src/components/CreateRobotFormCodeScope/CreateRobotFormCodeScope.tsx @@ -1,8 +1,8 @@ -import React, { ReactElement } from "react"; import InputCheckbox from "../InputCheckbox/InputCheckbox"; import useCreateRobot from "../../hooks/useCreateRobot"; -import useMain from "../../hooks/useMain"; import CFInfoBar from "../CFInfoBar/CFInfoBar"; +import { ReactElement } from "react"; +import useMain from "../../hooks/useMain"; interface ICreateRobotFormCodeScope { virtualInstanceChecked?: boolean; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 29608bf3..5ef814f5 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -6,12 +6,11 @@ import { ReactElement } from "react"; export default function Header(): ReactElement { return ( -
+
-
diff --git a/src/components/HeaderDropdownMenu/HeaderDropdownMenu.tsx b/src/components/HeaderDropdownMenu/HeaderDropdownMenu.tsx index 35e55d42..e73f91b2 100644 --- a/src/components/HeaderDropdownMenu/HeaderDropdownMenu.tsx +++ b/src/components/HeaderDropdownMenu/HeaderDropdownMenu.tsx @@ -32,7 +32,7 @@ export default function HeaderDropdownMenu(): ReactElement {
{isOpen && (
    setIsOpen(false)}> diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index c502f1dc..ec693ff9 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -10,7 +10,7 @@ export default function Sidebar(): ReactElement { return ( -
    +
    !loading && !disabled && handleClick()} - className={`${activeSwitcher()} transition-500 animate-fadeInLeft relative cursor-pointer select-none rounded-md p-2 hover:scale-90 ${ + className={`${activeSwitcher()} transition-500 animate__animated animate__fadeInLeft relative cursor-pointer select-none rounded-md p-2 hover:scale-90 ${ (loading || disabled) && "!cursor-not-allowed" }`} onMouseEnter={() => !loading && !disabled && setIsHover(true)} diff --git a/src/components/SidebarStaticItem/SidebarStaticItem.tsx b/src/components/SidebarStaticItem/SidebarStaticItem.tsx index 14ce40b3..7ca43e48 100644 --- a/src/components/SidebarStaticItem/SidebarStaticItem.tsx +++ b/src/components/SidebarStaticItem/SidebarStaticItem.tsx @@ -19,7 +19,7 @@ export default function SidebarStaticItem({ return (
    ) : ( )} diff --git a/src/components/TickCell/TickCell.tsx b/src/components/TickCell/TickCell.tsx index fa4d288f..a4d18edf 100644 --- a/src/components/TickCell/TickCell.tsx +++ b/src/components/TickCell/TickCell.tsx @@ -1,5 +1,5 @@ -import React, { ReactElement } from "react"; import { BsCheckCircle, BsXCircle } from "react-icons/bs"; +import { ReactElement } from "react"; interface ITickCell { tick: boolean; @@ -9,9 +9,9 @@ export default function TickCell({ tick }: ITickCell): ReactElement { return (
    {tick ? ( - + ) : ( - + )}
    ); diff --git a/src/components/UpdateRobotLaunchsForm/UpdateRobotLaunchsForm.tsx b/src/components/UpdateRobotLaunchsForm/UpdateRobotLaunchsForm.tsx index 45951f76..f753d5bd 100644 --- a/src/components/UpdateRobotLaunchsForm/UpdateRobotLaunchsForm.tsx +++ b/src/components/UpdateRobotLaunchsForm/UpdateRobotLaunchsForm.tsx @@ -1,7 +1,7 @@ -import React, { Fragment, ReactElement, useEffect, useState } from "react"; import LaunchFormAccordionHeader from "../LaunchFormAccordionHeader/LaunchFormAccordionHeader"; import CreateRobotFormAddButton from "../CreateRobotFormAddButton/CreateRobotFormAddButton"; import UpdateLaunchAccordion from "../UpdateLaunchAccordion/UpdateLaunchAccordion"; +import React, { Fragment, ReactElement, useEffect, useState } from "react"; import CreateRobotFormStep4 from "../CreateForms/CFStep4"; import useCreateRobot from "../../hooks/useCreateRobot"; import SidebarInfo from "../SidebarInfo/SidebarInfo"; diff --git a/src/contexts/VDIContext.tsx b/src/contexts/VDIContext.tsx index 5c0bf136..9987e812 100644 --- a/src/contexts/VDIContext.tsx +++ b/src/contexts/VDIContext.tsx @@ -56,9 +56,11 @@ export default ({ children }: IVDIContext) => { }; case "member/disconnected": toast.error( - `${state?.members?.filter( - (member: any) => member?.id === action?.payload?.id, - )[0]?.displayname} has left the room`, + `${ + state?.members?.filter( + (member: any) => member?.id === action?.payload?.id, + )[0]?.displayname + } has left the room`, ); return { @@ -95,9 +97,11 @@ export default ({ children }: IVDIContext) => { case "control/locked": toast.success( - `${state?.members?.filter( - (member: any) => member?.id === action?.payload.id, - )[0]?.displayname} has taken control`, + `${ + state?.members?.filter( + (member: any) => member?.id === action?.payload.id, + )[0]?.displayname + } has taken control`, ); return { @@ -416,7 +420,6 @@ export default ({ children }: IVDIContext) => { }); video.current?.addEventListener("wheel", (key: any) => { - console.log(key); // 0x01; if ( remoteDesktopReducer?.controller?.displayname === diff --git a/src/controllers/NamespaceTableData.tsx b/src/controllers/NamespaceTableData.tsx index c4fc8b6d..0e8e74e5 100644 --- a/src/controllers/NamespaceTableData.tsx +++ b/src/controllers/NamespaceTableData.tsx @@ -1,5 +1,4 @@ import EnvironmentActionCells from "../components/TableActionCells/EnvironmentActionCells"; -import RobotServicesCell from "../components/TableInformationCells/RobotServicesCell"; import RobotActionCells from "../components/TableActionCells/RobotActionCells"; import { handleSplitOrganizationName } from "../functions/GeneralFunctions"; import StateCell from "../components/TableInformationCells/StateCell"; @@ -229,8 +228,9 @@ export function NamespaceTableData() { subtitle={rowData?.name?.fleetName} titleURL={`/${handleSplitOrganizationName( pagesState?.organization?.organizationName!, - )}/${pagesState.roboticsCloud?.name}/${pagesState.instance - ?.name}/${pagesState.fleet?.name}/${rowData?.name?.name}`} + )}/${pagesState.roboticsCloud?.name}/${ + pagesState.instance?.name + }/${pagesState.fleet?.name}/${rowData?.name?.name}`} /> ); }, @@ -277,16 +277,13 @@ export function NamespaceTableData() { }, !applicationMode && { key: "robotServices", - header: `${applicationMode ? "Application" : "Robot"} Services`, + header: `ROS 2 Bridge`, sortable: true, filter: false, align: "left", body: (rowData: any) => { return ( - + ); }, }, diff --git a/src/layouts/PrivateLayout/PrivateLayout.tsx b/src/layouts/PrivateLayout/PrivateLayout.tsx index 8cea8f15..df60db10 100644 --- a/src/layouts/PrivateLayout/PrivateLayout.tsx +++ b/src/layouts/PrivateLayout/PrivateLayout.tsx @@ -43,7 +43,7 @@ export default function PrivateLayout(): ReactElement { onClick={() => handleCloseSidebar()} >
    -
    +
    diff --git a/src/modals/DeleteBuildManagerModal.tsx b/src/modals/DeleteBuildManagerModal.tsx index aadc070c..fc24803f 100644 --- a/src/modals/DeleteBuildManagerModal.tsx +++ b/src/modals/DeleteBuildManagerModal.tsx @@ -1,10 +1,10 @@ -import { ReactElement, useState } from "react"; import { deleteBuildManager } from "../toolkit/RobotSlice"; +import useCreateRobot from "../hooks/useCreateRobot"; import Button from "../components/Button/Button"; import { useAppDispatch } from "../hooks/redux"; +import { ReactElement, useState } from "react"; import { useParams } from "react-router-dom"; import { Dialog } from "primereact/dialog"; -import useCreateRobot from "../hooks/useCreateRobot"; import useMain from "../hooks/useMain"; interface IDeleteBuildManagerModal { diff --git a/src/modals/DeleteLaunchManagerModal.tsx b/src/modals/DeleteLaunchManagerModal.tsx index 0d62fd01..b5dc8fd9 100644 --- a/src/modals/DeleteLaunchManagerModal.tsx +++ b/src/modals/DeleteLaunchManagerModal.tsx @@ -1,9 +1,9 @@ -import { ReactElement, useState } from "react"; import { deleteLaunchManager } from "../toolkit/RobotSlice"; +import useCreateRobot from "../hooks/useCreateRobot"; import Button from "../components/Button/Button"; import { useAppDispatch } from "../hooks/redux"; +import { ReactElement, useState } from "react"; import { Dialog } from "primereact/dialog"; -import useCreateRobot from "../hooks/useCreateRobot"; import useMain from "../hooks/useMain"; interface IDeleteLaunchManagerModal {