diff --git a/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu.js b/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu.js new file mode 100644 index 0000000000000..56b2bd253381c --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu.js @@ -0,0 +1,42 @@ +/* + * 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, { Fragment, PureComponent } from 'react'; +import { EuiButton, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; + +export class HelpMenu extends PureComponent { + render() { + return ( + + + + + + + + ); + } +} diff --git a/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js new file mode 100644 index 0000000000000..aeabff2d97007 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/dashboard/help_menu/help_menu_util.js @@ -0,0 +1,31 @@ +/* + * 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 { render, unmountComponentAtNode } from 'react-dom'; +import { HelpMenu } from './help_menu'; + +export function addHelpMenuToAppChrome(chrome) { + chrome.helpExtension.set(domElement => { + render(, domElement); + return () => { + unmountComponentAtNode(domElement); + }; + }); +} diff --git a/src/legacy/core_plugins/kibana/public/dashboard/index.js b/src/legacy/core_plugins/kibana/public/dashboard/index.js index 3eff43db2fd9d..5993c723a81fc 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/index.js +++ b/src/legacy/core_plugins/kibana/public/dashboard/index.js @@ -38,6 +38,7 @@ import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_regis import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing'; import { uiModules } from 'ui/modules'; import 'ui/capabilities/route_setup'; +import { addHelpMenuToAppChrome } from './help_menu/help_menu_util'; // load directives import '../../../data/public'; @@ -55,6 +56,7 @@ function createNewDashboardCtrl($scope) { $scope.visitVisualizeAppLinkText = i18n.translate('kbn.dashboard.visitVisualizeAppLinkText', { defaultMessage: 'visit the Visualize app', }); + addHelpMenuToAppChrome(chrome); } uiRoutes @@ -107,6 +109,7 @@ uiRoutes defaultMessage: 'Dashboards', }), }]); + addHelpMenuToAppChrome(chrome); }, resolve: { dash: function ($route, Private, redirectWhenMissing, kbnUrl) { diff --git a/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu.js b/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu.js new file mode 100644 index 0000000000000..95db1b686f7aa --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu.js @@ -0,0 +1,42 @@ +/* + * 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, { Fragment, PureComponent } from 'react'; +import { EuiButton, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; + +export class HelpMenu extends PureComponent { + render() { + return ( + + + + + + + + ); + } +} diff --git a/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js new file mode 100644 index 0000000000000..aeabff2d97007 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/discover/components/help_menu/help_menu_util.js @@ -0,0 +1,31 @@ +/* + * 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 { render, unmountComponentAtNode } from 'react-dom'; +import { HelpMenu } from './help_menu'; + +export function addHelpMenuToAppChrome(chrome) { + chrome.helpExtension.set(domElement => { + render(, domElement); + return () => { + unmountComponentAtNode(domElement); + }; + }); +} diff --git a/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js b/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js index 377fd72e9c771..290b92a395e00 100644 --- a/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js +++ b/src/legacy/core_plugins/kibana/public/discover/controllers/discover.js @@ -70,6 +70,7 @@ import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_s import { getRootBreadcrumbs, getSavedSearchBreadcrumbs } from '../breadcrumbs'; import { buildVislibDimensions } from 'ui/visualize/loader/pipeline_helpers/build_pipeline'; import 'ui/capabilities/route_setup'; +import { addHelpMenuToAppChrome } from '../components/help_menu/help_menu_util'; const fetchStatuses = { UNINITIALIZED: 'uninitialized', @@ -1027,5 +1028,7 @@ function discoverController( return; } + addHelpMenuToAppChrome(chrome); + init(); } diff --git a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js index 4c98e54168c78..d0896dd438684 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js +++ b/src/legacy/core_plugins/kibana/public/visualize/editor/editor.js @@ -54,6 +54,7 @@ import { showSaveModal } from 'ui/saved_objects/show_saved_object_save_modal'; import { SavedObjectSaveModal } from 'ui/saved_objects/components/saved_object_save_modal'; import { getEditBreadcrumbs, getCreateBreadcrumbs } from '../breadcrumbs'; import { npStart } from 'ui/new_platform'; +import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; uiRoutes @@ -568,5 +569,7 @@ function VisEditor( vis.type.feedbackMessage; }; + addHelpMenuToAppChrome(chrome); + init(); } diff --git a/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu.js b/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu.js new file mode 100644 index 0000000000000..d95f7ea85c5db --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu.js @@ -0,0 +1,42 @@ +/* + * 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, { Fragment, PureComponent } from 'react'; +import { EuiButton, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; + +export class HelpMenu extends PureComponent { + render() { + return ( + + + + + + + + ); + } +} diff --git a/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu_util.js b/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu_util.js new file mode 100644 index 0000000000000..aeabff2d97007 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/visualize/help_menu/help_menu_util.js @@ -0,0 +1,31 @@ +/* + * 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 { render, unmountComponentAtNode } from 'react-dom'; +import { HelpMenu } from './help_menu'; + +export function addHelpMenuToAppChrome(chrome) { + chrome.helpExtension.set(domElement => { + render(, domElement); + return () => { + unmountComponentAtNode(domElement); + }; + }); +} diff --git a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js b/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js index b321dd4d8297e..73afccf2a288a 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js +++ b/src/legacy/core_plugins/kibana/public/visualize/listing/visualize_listing.js @@ -25,6 +25,7 @@ import { VisTypesRegistryProvider } from 'ui/registry/vis_types'; import chrome from 'ui/chrome'; import { wrapInI18nContext } from 'ui/i18n'; import { toastNotifications } from 'ui/notify'; +import { addHelpMenuToAppChrome } from '../help_menu/help_menu_util'; import { VisualizeListingTable } from './visualize_listing_table'; import { NewVisModal } from '../wizard/new_vis_modal'; @@ -111,4 +112,6 @@ export function VisualizeListingController($injector, createNewVis) { }]); this.listingLimit = config.get('savedObjects:listingLimit'); + + addHelpMenuToAppChrome(chrome); }