@@ -64,10 +72,11 @@ export const PageTemplate: React.FC
= ({
return (
{item.label}
@@ -79,3 +88,31 @@ export const PageTemplate: React.FC = ({
);
};
+
+function isDisabledTab(product: string | undefined) {
+ const setupMode = getSetupModeState();
+ if (!isSetupModeFeatureEnabled(SetupModeFeature.MetricbeatMigration)) {
+ return false;
+ }
+
+ if (!setupMode.data) {
+ return false;
+ }
+
+ if (!product) {
+ return false;
+ }
+
+ const data = setupMode.data[product] || {};
+ if (data.totalUniqueInstanceCount === 0) {
+ return true;
+ }
+ if (
+ data.totalUniqueInternallyCollectedCount === 0 &&
+ data.totalUniqueFullyMigratedCount === 0 &&
+ data.totalUniquePartiallyMigratedCount === 0
+ ) {
+ return true;
+ }
+ return false;
+}
diff --git a/x-pack/plugins/monitoring/public/application/route_init.tsx b/x-pack/plugins/monitoring/public/application/route_init.tsx
index cf3b0c6646d0f..8a9a906dbd563 100644
--- a/x-pack/plugins/monitoring/public/application/route_init.tsx
+++ b/x-pack/plugins/monitoring/public/application/route_init.tsx
@@ -10,9 +10,12 @@ import { useClusters } from './hooks/use_clusters';
import { GlobalStateContext } from './global_state_context';
import { getClusterFromClusters } from '../lib/get_cluster_from_clusters';
+export interface ComponentProps {
+ clusters: [];
+}
interface RouteInitProps {
path: string;
- component: React.ComponentType;
+ component: React.ComponentType