-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Vislib XY axis] Adds a deprecation notice in the UI and a docs secti…
…on (#105055) * [Vislib XY axis] Adds a deprecation notice in the UI and a docs section * Remove cyclic dependency * Fix link * Add functional test * fix functional tests * Apply PR comments * Update docs/user/dashboard/aggregation-based.asciidoc Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co> * Apply PR changes * minor * Change the implementation * Use title calse in Advanced Settings Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
- Loading branch information
1 parent
1f5be1e
commit 8b2ceae
Showing
8 changed files
with
99 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,4 +178,3 @@ image:images/bar-chart-tutorial-2.png[Bar chart with sample logs data] | |
|
||
|
||
|
||
|
66 changes: 66 additions & 0 deletions
66
src/plugins/visualize/public/application/components/deprecation_vis_warning.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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiCallOut, EuiLink } from '@elastic/eui'; | ||
import { useKibana } from '../../../../kibana_react/public'; | ||
import { VisualizeServices } from '../types'; | ||
|
||
export const LEGACY_CHARTS_LIBRARY = 'visualization:visualize:legacyChartsLibrary'; | ||
|
||
export const DeprecationWarning = () => { | ||
const { services } = useKibana<VisualizeServices>(); | ||
const canEditAdvancedSettings = services.application.capabilities.advancedSettings.save; | ||
const advancedSettingsLink = services.application.getUrlForApp('management', { | ||
path: `/kibana/settings?query=${LEGACY_CHARTS_LIBRARY}`, | ||
}); | ||
|
||
return ( | ||
<EuiCallOut | ||
data-test-subj="vizDeprecationWarning" | ||
title={ | ||
<FormattedMessage | ||
id="visualize.legacyCharts.notificationMessage" | ||
defaultMessage="You are using the legacy charts library, which will be removed in 7.16. {conditionalMessage}" | ||
values={{ | ||
conditionalMessage: ( | ||
<> | ||
{canEditAdvancedSettings && ( | ||
<FormattedMessage | ||
id="visualize.legacyCharts.conditionalMessage.newLibrary" | ||
defaultMessage="Switch to the new library in {link}" | ||
values={{ | ||
link: ( | ||
<EuiLink href={advancedSettingsLink}> | ||
<FormattedMessage | ||
id="visualize.legacyCharts.conditionalMessage.advanced settings link" | ||
defaultMessage="Advanced Settings." | ||
/> | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
)} | ||
{!canEditAdvancedSettings && ( | ||
<FormattedMessage | ||
id="visualize.legacyCharts.conditionalMessage.noPermissions" | ||
defaultMessage="Contact your system administrator to switch to the new library." | ||
/> | ||
)} | ||
</> | ||
), | ||
}} | ||
/> | ||
} | ||
iconType="alert" | ||
color="warning" | ||
size="s" | ||
/> | ||
); | ||
}; |
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
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