Skip to content

Commit

Permalink
refactor(*): 🎉 update build-accordion bug and update on-premise labels
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhangunduz committed Aug 9, 2023
1 parent cb997e4 commit b0c900e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { createRobot } from "../../toolkit/RobotSlice";
import { useNavigate } from "react-router-dom";
import { createTrial } from "../../toolkit/TrialSlice";
import useMain from "../../hooks/useMain";
import { envOnPremise } from "../../helpers/envProvider";

interface IDeployApplicationSelector {
item: any;
Expand Down Expand Up @@ -412,7 +413,9 @@ export default function DeployApplicationSelector({
src={`/svg/general/fleet/fleet-gray.svg`}
alt="robolaunch"
/>
<span className="capitalize text-xs">Fleet</span>
<span className="capitalize text-xs">
{envOnPremise ? "Namespace" : "Fleet"}
</span>
</div>
<div className="flex items-center gap-3">
{!formik?.values?.fleet && (
Expand Down
101 changes: 53 additions & 48 deletions src/components/PrivateSidebar/PrivateSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,55 +37,60 @@ export default function PrivateSidebar(): ReactElement {
description="You can go back to the previous page here."
/>
)}
<SideBarMenuItem
type="robot"
description="You can access all your robots here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
<SideBarMenuItem
type="workspacesmanager"
description="You can access all your workspaces here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>

<SideBarMenuItem
type="buildsmanager"
description="You can access all your builds here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
<SideBarMenuItem
type="launchsmanager"
description="You can access all your launches here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
{!envOnPremise && (
<Fragment>
<SideBarMenuItem
type="robot"
description="You can access all your robots here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
<SideBarMenuItem
type="workspacesmanager"
description="You can access all your workspaces here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>

<SideBarMenuItem
type="buildsmanager"
description="You can access all your builds here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
<SideBarMenuItem
type="launchsmanager"
description="You can access all your launches here."
loading={isLoading}
disabled={
sidebarState?.isCreateMode &&
(sidebarState?.page === "robot" ||
sidebarState?.page === "workspacesmanager" ||
sidebarState?.page === "buildsmanager" ||
sidebarState?.page === "launchsmanager")
}
/>
</Fragment>
)}
</Fragment>
) : (
<Fragment>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RobotHeader/RobotHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ export default function RobotHeader({
className={`text-[0.64rem] capitalize font-medium px-3 py-1 rounded-lg w-fit text-layer-primary-500 bg-layer-primary-100`}
>
{responseRobot?.robotClusters?.length === 1
? "Virtual Robot"
? `Virtual ${envOnPremise ? "Application" : "Robot"}`
: (responseRobot?.robotClusters?.length === 2 &&
"Physical Robot") || (
`Physical ${envOnPremise ? "Application" : "Robot"}`) || (
<ContentLoader
speed={1}
width={64}
Expand Down

0 comments on commit b0c900e

Please sign in to comment.