chore: show migration info to all cloud regions (#8077)

This commit is contained in:
Srikanth Chekuri 2025-05-28 10:18:42 +05:30 committed by GitHub
parent 3d758d4358
commit 0a6a7ba729
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,6 @@ import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';
import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';
import ROUTES from 'constants/routes';
import { getHostListsQuery } from 'container/InfraMonitoringHosts/utils';
import { useGetDeploymentsData } from 'hooks/CustomDomain/useGetDeploymentsData';
import { useGetHostList } from 'hooks/infraMonitoring/useGetHostList';
import { useGetK8sPodsList } from 'hooks/infraMonitoring/useGetK8sPodsList';
import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';
@ -29,7 +28,6 @@ import Card from 'periscope/components/Card/Card';
import { useAppContext } from 'providers/App/App';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useMutation, useQuery } from 'react-query';
import { LicensePlatform } from 'types/api/licensesV3/getActive';
import { DataSource } from 'types/common/queryBuilder';
import { UserPreference } from 'types/reducer/app';
import { USER_ROLES } from 'types/roles';
@ -303,19 +301,7 @@ export default function Home(): JSX.Element {
}
}, [hostData, k8sPodsData, handleUpdateChecklistDoneItem]);
const { activeLicense, isFetchingActiveLicense } = useAppContext();
const [isEnabled, setIsEnabled] = useState(false);
useEffect(() => {
if (isFetchingActiveLicense) {
setIsEnabled(false);
return;
}
setIsEnabled(Boolean(activeLicense?.platform === LicensePlatform.CLOUD));
}, [activeLicense, isFetchingActiveLicense]);
const { data: deploymentsData } = useGetDeploymentsData(isEnabled);
const { isCloudUser, isEnterpriseSelfHostedUser } = useGetTenantLicense();
useEffect(() => {
logEvent('Homepage: Visited', {});
@ -701,7 +687,7 @@ export default function Home(): JSX.Element {
)}
</div>
<div className="home-right-content">
{deploymentsData?.data?.data?.cluster?.region?.name === 'in' && (
{(isCloudUser || isEnterpriseSelfHostedUser) && (
<div className="home-notifications-container">
<div className="notification">
<Alert