Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
add cloud enabled for cloud connection and migration manager
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNti committed Mar 14, 2022
1 parent 7522916 commit b73da92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/components/header/ACLK/cloud-connection-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -28,6 +30,8 @@ const CloudConnectionStatus = () => {

const onRefresh = useRequestRefreshOfAccessMessage()

if (!cloudEnabled) return null

return (
<Flex column>
<Pill data-testid="header-connection-to-cloud-button" onClick={openModal} flavour="neutral">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 (
<MigrationModal
savePromoRemindMeSelection={savePromoRemindMeSelection}
Expand Down

0 comments on commit b73da92

Please sign in to comment.