From 3a437962e19f324b22d91caafca9253830d17903 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Thu, 29 Oct 2020 15:33:54 +0100 Subject: [PATCH] Remove custom handling of license enabling --- .../__snapshots__/license_info.test.tsx.snap | 42 +++++++---------- .../__snapshots__/ml_flyout.test.tsx.snap | 25 +++++----- .../components/monitor/ml/license_info.tsx | 46 ++++--------------- 3 files changed, 35 insertions(+), 78 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap index 68e3606d880d6..edf89caaff557 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap @@ -26,24 +26,21 @@ Array [

In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - + - - Start free 14-day trial - + Start free 14-day trial - - + + ,
In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - - Start free 14-day trial - - + Start free 14-day trial + diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap index ac1afccd1feae..fd59b14520ce1 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap @@ -146,24 +146,21 @@ exports[`ML Flyout component shows license info if no ml available 1`] = `

In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - + - - Start free 14-day trial - + Start free 14-day trial - - + +
{ const { basePath } = useContext(UptimeSettingsContext); - const [loading, setLoading] = useState(false); - const hasMlFeature = useSelector(hasMLFeatureSelector); const dispatch = useDispatch(); @@ -22,29 +19,6 @@ export const ShowLicenseInfo = () => { dispatch(getMLCapabilitiesAction.get()); }, [dispatch]); - useEffect(() => { - let retryInterval: any; - if (loading) { - retryInterval = setInterval(() => { - dispatch(getMLCapabilitiesAction.get()); - }, 5000); - } else { - clearInterval(retryInterval); - } - - return () => { - clearInterval(retryInterval); - }; - }, [dispatch, loading]); - - useEffect(() => { - setLoading(false); - }, [hasMlFeature]); - - const startLicenseTrial = () => { - setLoading(true); - }; - return ( <> { iconType="help" >

{labels.START_TRAIL_DESC}

- {}}> - - {labels.START_TRAIL} - - + + {labels.START_TRAIL} +