-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Synthetics UI] Add deprecation warnings for the synthetics integrati…
…on monitors (#150437) Closes #150287 ## Summary Adds or updates deprecation notices regarding the synthetics integration when the user has monitors created through it. ## Screenshots In the Uptime UI: <img width="1280" alt="Screenshot 2023-02-07 at 15 10 37" src="https://user-images.githubusercontent.com/57448/217268105-c2dcd6ad-556e-4c88-ace2-4f3be6fb9576.png"> When editing an integration: <img width="1259" alt="Screenshot 2023-02-07 at 15 44 57" src="https://user-images.githubusercontent.com/57448/217277804-c54cfcd0-b1e6-4b42-9f4a-b08167c8b2a1.png">
- Loading branch information
Alejandro Fernández Gómez
authored
Feb 8, 2023
1 parent
1856323
commit 9aae30e
Showing
16 changed files
with
179 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...ins/synthetics/public/legacy_uptime/components/overview/integration_deprecation/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { useState, useEffect } from 'react'; | ||
import { EuiSpacer } from '@elastic/eui'; | ||
import { useFetcher } from '@kbn/observability-plugin/public'; | ||
import { useSelector } from 'react-redux'; | ||
import { getHasIntegrationMonitors } from '../../../state/api/has_integration_monitors'; | ||
import { monitorListSelector } from '../../../state/selectors'; | ||
import { IntegrationDeprecationCallout } from './integration_deprecation_callout'; | ||
|
||
export const INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY = | ||
'SYNTHETICS_INTEGRATION_DEPRECATION_HAS_BEEN_DISMISSED'; | ||
|
||
export const IntegrationDeprecation = () => { | ||
const monitorList = useSelector(monitorListSelector); | ||
const noticeHasBeenDismissed = | ||
window.sessionStorage.getItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY) === 'true'; | ||
const { data, loading } = useFetcher(() => { | ||
// load it when list is loaded | ||
if (!noticeHasBeenDismissed && monitorList.isLoaded) { | ||
return getHasIntegrationMonitors(); | ||
} | ||
return undefined; | ||
}, [monitorList.isLoaded]); | ||
const hasIntegrationMonitors = !loading && data && data.hasIntegrationMonitors; | ||
const [shouldShowNotice, setShouldShowNotice] = useState( | ||
Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed) | ||
); | ||
|
||
const handleDismissDeprecationNotice = () => { | ||
window.sessionStorage.setItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY, 'true'); | ||
setShouldShowNotice(false); | ||
}; | ||
|
||
useEffect(() => { | ||
setShouldShowNotice(Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed)); | ||
}, [hasIntegrationMonitors, noticeHasBeenDismissed]); | ||
|
||
return shouldShowNotice ? ( | ||
<> | ||
<IntegrationDeprecationCallout | ||
handleDismissDeprecationNotice={handleDismissDeprecationNotice} | ||
/> | ||
<EuiSpacer size="s" /> | ||
</> | ||
) : null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...cy_uptime/components/overview/integration_deprecation/integration_deprecation_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { getDocLinks } from '../../../../kibana_services'; | ||
|
||
interface IntegrationDeprecationCalloutProps { | ||
handleDismissDeprecationNotice?: () => void; | ||
} | ||
|
||
export function IntegrationDeprecationCallout({ | ||
handleDismissDeprecationNotice, | ||
}: IntegrationDeprecationCalloutProps) { | ||
return ( | ||
<EuiCallOut | ||
title={ | ||
<FormattedMessage | ||
id="xpack.synthetics.integration.deprecation.title" | ||
defaultMessage="Migrate your Elastic Synthetics integration monitors before Elastic 8.8" | ||
/> | ||
} | ||
color="warning" | ||
> | ||
<EuiFlexGroup alignItems="center" gutterSize="s"> | ||
<EuiFlexItem> | ||
<span> | ||
<FormattedMessage | ||
id="xpack.synthetics.integration.deprecation.content" | ||
defaultMessage="You have at least one monitor configured using the Elastic Synthetics integration. From Elastic 8.8, the integration will be deprecated and you will no longer be able to edit these monitors. To avoid this, migrate them to Project monitors or add them to the new Synthetics app directly available in Observability before the 8.8 update. Check our {link} for more details." | ||
values={{ | ||
link: ( | ||
<EuiLink | ||
target="_blank" | ||
href={getDocLinks()?.links?.observability?.syntheticsProjectMonitors} | ||
external | ||
> | ||
<FormattedMessage | ||
id="xpack.synthetics.integration.deprecation.link" | ||
defaultMessage="Synthetics migration docs" | ||
/> | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</span> | ||
</EuiFlexItem> | ||
{handleDismissDeprecationNotice ? ( | ||
<EuiFlexItem grow={false}> | ||
<EuiButton onClick={handleDismissDeprecationNotice} color="warning"> | ||
<FormattedMessage | ||
id="xpack.synthetics.integration.deprecation.dismiss" | ||
defaultMessage="Dismiss" | ||
/> | ||
</EuiButton> | ||
</EuiFlexItem> | ||
) : null} | ||
</EuiFlexGroup> | ||
</EuiCallOut> | ||
); | ||
} |
92 changes: 0 additions & 92 deletions
92
...plugins/synthetics/public/legacy_uptime/components/overview/zip_url_deprecation/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.