diff --git a/src/components/SidebarLists/RobotsList.tsx b/src/components/SidebarLists/RobotsList.tsx
index e273c9fe..1b205fcf 100644
--- a/src/components/SidebarLists/RobotsList.tsx
+++ b/src/components/SidebarLists/RobotsList.tsx
@@ -1,5 +1,5 @@
-import React, { Fragment, ReactElement, useEffect, useState } from "react";
import SidebarListLoader from "../SidebarListLoader/SidebarListLoader";
+import { Fragment, ReactElement, useEffect, useState } from "react";
import { envApplication } from "../../helpers/envProvider";
import StateCell from "../TableInformationCells/StateCell";
import SidebarInfo from "../SidebarInfo/SidebarInfo";
diff --git a/src/components/SidebarLists/SidebarListItem.tsx b/src/components/SidebarLists/SidebarListItem.tsx
index a017e793..834b5126 100644
--- a/src/components/SidebarLists/SidebarListItem.tsx
+++ b/src/components/SidebarLists/SidebarListItem.tsx
@@ -4,6 +4,7 @@ import { useNavigate } from "react-router-dom";
import useMain from "../../hooks/useMain";
import { ReactElement } from "react";
import { toast } from "sonner";
+import { MdKeyboardArrowRight } from "react-icons/md";
interface ISidebarListItem {
name: string;
@@ -122,24 +123,79 @@ export default function SidebarListItem({
}
};
+ function handleNotSelectableClick() {
+ switch (type) {
+ case "organization":
+ setSelectedState({
+ ...selectedState,
+ organization: data,
+ roboticsCloud: null,
+ instance: null,
+ fleet: null,
+ });
+ setSidebarState({ ...sidebarState, isOpen: false });
+ navigate(url);
+ break;
+ case "roboticscloud":
+ setSelectedState({
+ ...selectedState,
+ roboticsCloud: data,
+ instance: null,
+ fleet: null,
+ });
+ setSidebarState({ ...sidebarState, isOpen: false });
+ navigate(url);
+ break;
+ case "instance":
+ if (data?.instanceCloudState === "ConnectionHub_Ready") {
+ setSelectedState({
+ ...selectedState,
+ instance: data,
+ fleet: null,
+ });
+ setSidebarState({ ...sidebarState, isOpen: false });
+ navigate(url);
+ } else {
+ toast.error(
+ "Instance is not selectable now. Please try again later.",
+ );
+ }
+ break;
+ case "fleet":
+ if (
+ data?.fleetStatus === "Ready" ||
+ data?.namespaceStatus === "Active"
+ ) {
+ setSelectedState({ ...selectedState, fleet: data });
+ setSidebarState({ ...sidebarState, isOpen: false });
+ navigate(url);
+ } else {
+ toast.error("Fleet is not selectable now. Please try again later.");
+ }
+
+ break;
+ }
+ }
+
return (
handleSelectItem()}
- className={`transition-300 flex w-full gap-4 rounded-l-lg border-r p-2.5 ${
- selected
- ? "border-light-400 hover:bg-light-200"
- : "border-light-200 hover:bg-light-100"
- } ${notSelectable && "!border-0"}`}
+ className={`flex w-full gap-4 rounded-l-lg p-2.5
+ ${selected ? " hover:bg-light-200" : " hover:bg-light-100"}
+ `}
>
-
{name}
-
{description}
+
{name}
+
{description}
{!notSelectable && (
{
- switch (type) {
- case "organization":
- setSelectedState({
- ...selectedState,
- organization: data,
- roboticsCloud: null,
- instance: null,
- fleet: null,
- });
- setSidebarState({ ...sidebarState, isOpen: false });
- navigate(url);
- break;
- case "roboticscloud":
- setSelectedState({
- ...selectedState,
- roboticsCloud: data,
- instance: null,
- fleet: null,
- });
- setSidebarState({ ...sidebarState, isOpen: false });
- navigate(url);
- break;
- case "instance":
- if (data?.instanceCloudState === "ConnectionHub_Ready") {
- setSelectedState({
- ...selectedState,
- instance: data,
- fleet: null,
- });
- setSidebarState({ ...sidebarState, isOpen: false });
- navigate(url);
- } else {
- toast.error(
- "Instance is not selectable now. Please try again later.",
- );
- }
- break;
- case "fleet":
- if (
- data?.fleetStatus === "Ready" ||
- data?.namespaceStatus === "Active"
- ) {
- setSelectedState({ ...selectedState, fleet: data });
- setSidebarState({ ...sidebarState, isOpen: false });
- navigate(url);
- } else {
- toast.error(
- "Fleet is not selectable now. Please try again later.",
- );
- }
-
- break;
- }
- }}
- className={`transition-300 flex items-center justify-center rounded-r-lg px-3.5 ${
+ onClick={() => handleNotSelectableClick()}
+ className={`transition-300 flex h-full items-center justify-center border-l px-3 ${
selected
- ? "border-light-400 hover:bg-light-200"
- : "border-light-100 hover:bg-light-100"
+ ? "border-light-300 hover:bg-light-200"
+ : "border-light-200 hover:bg-light-100"
} `}
>
-
+
)}
diff --git a/src/components/SidebarMenu/SidebarMenu.tsx b/src/components/SidebarMenu/SidebarMenu.tsx
index c271806b..d8bd5128 100644
--- a/src/components/SidebarMenu/SidebarMenu.tsx
+++ b/src/components/SidebarMenu/SidebarMenu.tsx
@@ -93,12 +93,6 @@ export default function PrivateSidebar(): ReactElement {
) : (
- {/* {!(envApplicationFleet || envApplication) && (
-
- )} */}