From 2d958e5cad22d738d5383e52a8428abb32550719 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 18 Aug 2020 14:38:29 +0300 Subject: [PATCH] Timelion app deprecation warning (#74660) (#75260) * wip deprecation notice on timelion app * Add a deprecation notice on timelion app * Minor, add visualize and timelion on the docLinks * Chage the layout a bit * Change the deprecation notice message * Change the deprecation notice message Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- ...-plugin-core-public.doclinksstart.links.md | 1 + .../public/doc_links/doc_links_service.ts | 5 ++ src/core/public/public.api.md | 1 + src/plugins/timelion/public/app.js | 2 + .../components/timelion_deprecation.tsx | 52 +++++++++++++++++++ .../timelion_deprecation_directive.js | 41 +++++++++++++++ src/plugins/timelion/public/index.html | 1 + 7 files changed, 103 insertions(+) create mode 100644 src/plugins/timelion/public/components/timelion_deprecation.tsx create mode 100644 src/plugins/timelion/public/components/timelion_deprecation_directive.js diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index 842f90b7047c8..85e1da08b00af 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -96,5 +96,6 @@ readonly links: { readonly dateMath: string; }; readonly management: Record; + readonly visualize: Record; }; ``` diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 144b641c525ed..74c7570f88b0d 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -128,6 +128,10 @@ export class DocLinksService { kibanaSearchSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`, dashboardSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-dashboard-settings`, }, + visualize: { + guide: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/visualize.html`, + timelionDeprecation: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/timelion.html#timelion-deprecation`, + }, }, }); } @@ -226,5 +230,6 @@ export interface DocLinksStart { readonly dateMath: string; }; readonly management: Record; + readonly visualize: Record; }; } diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 0e879d16b4637..17626418cbeeb 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -591,6 +591,7 @@ export interface DocLinksStart { readonly dateMath: string; }; readonly management: Record; + readonly visualize: Record; }; } diff --git a/src/plugins/timelion/public/app.js b/src/plugins/timelion/public/app.js index 614a7539de44c..40fffe7a5a063 100644 --- a/src/plugins/timelion/public/app.js +++ b/src/plugins/timelion/public/app.js @@ -43,6 +43,7 @@ import { initTimelionOptionsSheetDirective } from './directives/timelion_options import { initSavedObjectSaveAsCheckBoxDirective } from './directives/saved_object_save_as_checkbox'; import { initSavedObjectFinderDirective } from './directives/saved_object_finder'; import { initTimelionTabsDirective } from './components/timelionhelp_tabs_directive'; +import { initTimelionTDeprecationDirective } from './components/timelion_deprecation_directive'; import { initInputFocusDirective } from './directives/input_focus'; import { Chart } from './directives/chart/chart'; import { TimelionInterval } from './directives/timelion_interval/timelion_interval'; @@ -84,6 +85,7 @@ export function initTimelionApp(app, deps) { initTimelionHelpDirective(app); initInputFocusDirective(app); initTimelionTabsDirective(app, deps); + initTimelionTDeprecationDirective(app, deps); initSavedObjectFinderDirective(app, savedSheetLoader, deps.core.uiSettings); initSavedObjectSaveAsCheckBoxDirective(app); initCellsDirective(app); diff --git a/src/plugins/timelion/public/components/timelion_deprecation.tsx b/src/plugins/timelion/public/components/timelion_deprecation.tsx new file mode 100644 index 0000000000000..f9f04d3504570 --- /dev/null +++ b/src/plugins/timelion/public/components/timelion_deprecation.tsx @@ -0,0 +1,52 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiSpacer, EuiCallOut, EuiLink } from '@elastic/eui'; +import React from 'react'; +import { DocLinksStart } from '../../../../core/public'; + +export const TimelionDeprecation = ({ links }: DocLinksStart) => { + const timelionDeprecationLink = links.visualize.timelionDeprecation; + return ( + <> + + + + ), + }} + /> + } + color="warning" + iconType="alert" + size="s" + /> + + + ); +}; diff --git a/src/plugins/timelion/public/components/timelion_deprecation_directive.js b/src/plugins/timelion/public/components/timelion_deprecation_directive.js new file mode 100644 index 0000000000000..6a38161c7d40d --- /dev/null +++ b/src/plugins/timelion/public/components/timelion_deprecation_directive.js @@ -0,0 +1,41 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import { TimelionDeprecation } from './timelion_deprecation'; + +export function initTimelionTDeprecationDirective(app, deps) { + app.directive('timelionDeprecation', function (reactDirective) { + return reactDirective( + () => { + return ( + + + + ); + }, + [], + { + restrict: 'E', + scope: { + docLinks: '=', + }, + } + ); + }); +} diff --git a/src/plugins/timelion/public/index.html b/src/plugins/timelion/public/index.html index 54efae7f81ba7..0cf64287a3bd5 100644 --- a/src/plugins/timelion/public/index.html +++ b/src/plugins/timelion/public/index.html @@ -28,6 +28,7 @@
+