diff --git a/x-pack/plugins/maps/public/angular/map_controller.js b/x-pack/plugins/maps/public/angular/map_controller.js index c5a7f598ebcc4..92a76b65ba5d9 100644 --- a/x-pack/plugins/maps/public/angular/map_controller.js +++ b/x-pack/plugins/maps/public/angular/map_controller.js @@ -14,6 +14,7 @@ import { timefilter } from 'ui/timefilter'; import { Provider } from 'react-redux'; import { createMapStore } from '../store/store'; import { GisMap } from '../components/gis_map'; +import { addHelpMenuToAppChrome } from '../help_menu_util'; import { setSelectedLayer, setRefreshConfig, @@ -208,6 +209,8 @@ app.controller('GisMapController', ($scope, $route, config, kbnUrl, localStorage { text: $scope.map.title } ]); + addHelpMenuToAppChrome(chrome); + async function doSave(saveOptions) { await store.dispatch(clearTransientLayerStateAndCloseFlyout()); savedMap.syncWithStore(store.getState()); diff --git a/x-pack/plugins/maps/public/help_menu_util.js b/x-pack/plugins/maps/public/help_menu_util.js new file mode 100644 index 0000000000000..e0579112c52ae --- /dev/null +++ b/x-pack/plugins/maps/public/help_menu_util.js @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ +import React from 'react'; +import { render, unmountComponentAtNode } from 'react-dom'; +import { HelpMenu } from './shared/components/help_menu'; + +export function addHelpMenuToAppChrome(chrome) { + chrome.helpExtension.set(domElement => { + render(, domElement); + return () => { + unmountComponentAtNode(domElement); + }; + }); +} diff --git a/x-pack/plugins/maps/public/shared/components/help_menu.js b/x-pack/plugins/maps/public/shared/components/help_menu.js new file mode 100644 index 0000000000000..288261da77df3 --- /dev/null +++ b/x-pack/plugins/maps/public/shared/components/help_menu.js @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { Fragment, PureComponent } from 'react'; +import { EuiButton, EuiHorizontalRule, EuiSpacer, EuiLink } from '@elastic/eui'; +import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; + +export class HelpMenu extends PureComponent { + render() { + return ( + + + + + + + + + {i18n.translate('xpack.maps.helpMenu.feedbackLinkText', { + defaultMessage: 'Provide feedback for the Maps application' + })} + + + ); + } +} diff --git a/x-pack/plugins/maps/public/shared/components/map_listing.js b/x-pack/plugins/maps/public/shared/components/map_listing.js index c3e6e42b577a1..2d99eda19132b 100644 --- a/x-pack/plugins/maps/public/shared/components/map_listing.js +++ b/x-pack/plugins/maps/public/shared/components/map_listing.js @@ -27,6 +27,8 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import { addHelpMenuToAppChrome } from '../../help_menu_util'; +import chrome from 'ui/chrome'; export const EMPTY_FILTER = ''; @@ -55,6 +57,7 @@ export class MapListing extends React.Component { componentDidMount() { this.fetchItems(); + addHelpMenuToAppChrome(chrome); } debouncedFetch = _.debounce(async (filter) => {