From b73da9239c1cd64cec1781e1c6521798d26e2b0c Mon Sep 17 00:00:00 2001 From: Alexandros Ntitorss Date: Mon, 14 Mar 2022 18:32:08 +0200 Subject: [PATCH] add cloud enabled for cloud connection and migration manager --- src/components/header/ACLK/cloud-connection-status.tsx | 4 ++++ .../components/migration-manager/migration-manager.tsx | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/header/ACLK/cloud-connection-status.tsx b/src/components/header/ACLK/cloud-connection-status.tsx index a4b28d2a..8b5fcff3 100644 --- a/src/components/header/ACLK/cloud-connection-status.tsx +++ b/src/components/header/ACLK/cloud-connection-status.tsx @@ -7,9 +7,11 @@ import { useSelector } from "react-redux" import { useRequestRefreshOfAccessMessage } from "hooks/use-user-node-access" import { selectUserNodeAccess } from "domains/global/selectors" import { PromoProps } from "@/src/domains/dashboard/components/migration-modal" +import { selectIsCloudEnabled } from "domains/global/selectors" const CloudConnectionStatus = () => { const userNodeAccess = useSelector(selectUserNodeAccess) as PromoProps + const cloudEnabled = useSelector(selectIsCloudEnabled) const [isModalOpen, setModalOpen] = useState(false) const cloudConnectionStatusInfo = useCloudConnectionStatus({ @@ -28,6 +30,8 @@ const CloudConnectionStatus = () => { const onRefresh = useRequestRefreshOfAccessMessage() + if (!cloudEnabled) return null + return ( diff --git a/src/domains/dashboard/components/migration-manager/migration-manager.tsx b/src/domains/dashboard/components/migration-manager/migration-manager.tsx index 254f537a..9b2a3c2e 100644 --- a/src/domains/dashboard/components/migration-manager/migration-manager.tsx +++ b/src/domains/dashboard/components/migration-manager/migration-manager.tsx @@ -12,6 +12,7 @@ import { } from "@/src/domains/dashboard/components/migration-modal" import { selectSignInUrl } from "domains/global/selectors" import { useRequestRefreshOfAccessMessage } from "hooks/use-user-node-access" +import { selectIsCloudEnabled } from "domains/global/selectors" // const PROMO_SIGN_UP_CLOUD: PromoProps = { userStatus: "UNKNOWN", nodeClaimedStatus: "NOT_CLAIMED" } //CLOUD // const PROMO_SIGN_IN_CLOUD: PromoProps = { @@ -54,6 +55,7 @@ import { useRequestRefreshOfAccessMessage } from "hooks/use-user-node-access" const MigrationManager = () => { const cloudUrl = useSelector(state => selectSignInUrl("go-to-cloud-migration")(state as any)) + const cloudEnabled = useSelector(selectIsCloudEnabled) const linkToCoud = useMemo(() => { const { href } = window.location @@ -98,7 +100,7 @@ const MigrationManager = () => { if (goToAgentDashboard({ userSavedPreference })) console.log("Lets go to Agent") }, [userSavedPreference]) - if (migrationModalPromoInfo && isModalOpen && !hasPromoSelectionSaved) + if (cloudEnabled && migrationModalPromoInfo && isModalOpen && !hasPromoSelectionSaved) return (