diff --git a/README.md b/README.md index 3b0d2751..b892860f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ node - release + release language diff --git a/package.json b/package.json index ea29fdf3..9c8bda44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "0.12.9", + "version": "0.13.0", "private": true, "dependencies": { "@emotion/css": "^11.10.6", diff --git a/src/components/Cells/StateCell.tsx b/src/components/Cells/StateCell.tsx index 7a16b7a9..d73f8801 100644 --- a/src/components/Cells/StateCell.tsx +++ b/src/components/Cells/StateCell.tsx @@ -64,6 +64,7 @@ export default function StateCell({ state, isRobolaunchState }: IStateCell) { state === "Connected" || state === "Completed" || state === "Running" || + state === "Active" || state === "EnvironmentReady" ? (
) : state === "stopping" || diff --git a/src/components/CreateForms/CreateRobotFormStep2.tsx b/src/components/CreateForms/CreateRobotFormStep2.tsx index 844ac59e..187f7d13 100644 --- a/src/components/CreateForms/CreateRobotFormStep2.tsx +++ b/src/components/CreateForms/CreateRobotFormStep2.tsx @@ -13,7 +13,10 @@ import { CreateRobotFormStep2Validations } from "../../validations/RobotsValidat import { toast } from "sonner"; import CreateRobotFormAddButton from "../CreateRobotFormAddButton/CreateRobotFormAddButton"; import CreateRobotFormCancelButton from "../CreateRobotFormCancelButton/CreateRobotFormCancelButton"; -import { envOnPremiseRobot } from "../../helpers/envProvider"; +import { + envOnPremiseFleet, + envOnPremiseRobot, +} from "../../helpers/envProvider"; import { CreateEnvironmentFormStep2Validations } from "../../validations/EnvironmentsValidations"; import { createEnvironment } from "../../toolkit/EnvironmentSlice"; import { useParams } from "react-router-dom"; @@ -32,7 +35,7 @@ export default function CreateRobotFormStep2({ const dispatch = useAppDispatch(); const [isLoadingImportRobot, setIsLoadingImportRobot] = useState(true); - const { getRobot, getFleet, getEnvironment } = useFunctions(); + const { getRobot, getFleet, getEnvironment, getNamespace } = useFunctions(); const [responseRobot, setResponseRobot] = useState(undefined); const url = useParams(); @@ -134,12 +137,14 @@ export default function CreateRobotFormStep2({ }, 2000); } else { if (!responseFleet) { - handleGetFleet(); + envOnPremiseFleet ? handleGetNamespace() : handleGetFleet(); } } const timer = setInterval(() => { - !isImportRobot && !robotData?.step1?.isVirtualRobot && handleGetFleet(); + if (!isImportRobot && !robotData?.step1?.isVirtualRobot) { + envOnPremiseFleet ? handleGetNamespace() : handleGetFleet(); + } }, 10000); return () => { @@ -201,6 +206,22 @@ export default function CreateRobotFormStep2({ ); } + function handleGetNamespace() { + getNamespace( + { + organizationId: selectedState?.organization?.organizationId, + roboticsCloudName: selectedState?.roboticsCloud?.name, + instanceId: selectedState?.instance?.instanceId, + region: selectedState?.instance?.region, + namespaceName: selectedState?.fleet?.name, + }, + { + ifErrorNavigateTo404: false, + setResponse: setResponseFleet, + } + ); + } + useEffect(() => { console.log( !formik?.isValid, @@ -211,12 +232,22 @@ export default function CreateRobotFormStep2({ ); }, [formik]); + useEffect(() => { + console.log( + responseFleet?.fleetStatus !== "Ready" || + responseFleet?.namespaceStatus !== "Active" + ); + }, [responseFleet]); + return (
VI: - +
{responseNamespaces?.filter( (pFleet: any) => fleet?.name === pFleet?.fleetName diff --git a/src/components/SidebarLists/SidebarListItem.tsx b/src/components/SidebarLists/SidebarListItem.tsx index 42945f43..10b04359 100644 --- a/src/components/SidebarLists/SidebarListItem.tsx +++ b/src/components/SidebarLists/SidebarListItem.tsx @@ -90,8 +90,9 @@ export default function SidebarListItem({ break; case "fleet": if ( - data?.fleetStatus === "Ready" && - data?.physicalInstance?.length === 0 + data?.namespaceStatus === "Active" || + (data?.fleetStatus === "Ready" && + data?.physicalInstance?.length === 0) ) { if (selectedState?.fleet?.name === data?.name) { setSelectedState({ ...selectedState, fleet: null }); diff --git a/src/pages/DashboardsPage/CloudInstancesDashboardPage/CloudInstanceDashboardPage.tsx b/src/pages/DashboardsPage/CloudInstancesDashboardPage/CloudInstanceDashboardPage.tsx index 7124d7a9..8b1e00dd 100644 --- a/src/pages/DashboardsPage/CloudInstancesDashboardPage/CloudInstanceDashboardPage.tsx +++ b/src/pages/DashboardsPage/CloudInstancesDashboardPage/CloudInstanceDashboardPage.tsx @@ -79,7 +79,7 @@ export default function CloudInstanceDashboardPage(): ReactElement { organization: url?.organizationName, roboticsCloud: url?.roboticsCloudName, instance: url?.instanceName, - state: fleet?.fleetStatus, + state: fleet?.fleetStatus || fleet?.namespaceStatus, actions: fleet, }; }),