[Chrome] More Help Menu extensions with semantic links (#50736) (#51286)

* Update help menu util to allow common types of links

- Github, Docs, and custom

* Fix test?

* Updating API docs?

* Quick layout fix

* Kibana core apps updated (Visualize, Dashboard, Discover)

* Updated Canvas usage

* Updated Maps usage

* Added a `discuss` link type

* Updated Logs and Metrics usage

* Update APM usage

* Update Uptime usage

* Update SIEM usage

* Removing old Uptime file

* Update Lens usage

* Update API doc

* [Uptime] Remove test for file that no longer exists

* One more snap and i18n tokens

* PR feedback

- Wrap feedbackText in method
- Use `rel: noopener` on external links
- Rename HeaderHelpMenuUIExtraLink -> ChromeHelpExtensionMenuExtraLink and export

* [APM] Use ‘custom’ style link for Upgrade assistant

* API docs

* i18n

* Fix link

* Documented ChromeHelpExtension props

* Use heading levels

* Update names of props, document prop, and update API docs

* Remove `ae-missing-release-tag` warnings
This commit is contained in:
Caroline Horn 2019-11-21 15:22:29 -05:00 committed by GitHub
parent ee175f19f3
commit 48c961c0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 555 additions and 583 deletions

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [appName](./kibana-plugin-public.chromehelpextension.appname.md)
## ChromeHelpExtension.appName property
Provide your plugin's name to create a header for separation
<b>Signature:</b>
```typescript
appName: string;
```

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [content](./kibana-plugin-public.chromehelpextension.content.md)
## ChromeHelpExtension.content property
Custom content to occur below the list of links
<b>Signature:</b>
```typescript
content?: (element: HTMLDivElement) => () => void;
```

View file

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) &gt; [links](./kibana-plugin-public.chromehelpextension.links.md)
## ChromeHelpExtension.links property
Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button
<b>Signature:</b>
```typescript
links?: ChromeHelpExtensionMenuLink[];
```

View file

@ -2,11 +2,20 @@
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md)
## ChromeHelpExtension type
## ChromeHelpExtension interface
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtension = (element: HTMLDivElement) => () => void;
export interface ChromeHelpExtension
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [appName](./kibana-plugin-public.chromehelpextension.appname.md) | <code>string</code> | Provide your plugin's name to create a header for separation |
| [content](./kibana-plugin-public.chromehelpextension.content.md) | <code>(element: HTMLDivElement) =&gt; () =&gt; void</code> | Custom content to occur below the list of links |
| [links](./kibana-plugin-public.chromehelpextension.links.md) | <code>ChromeHelpExtensionMenuLink[]</code> | Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button |

View file

@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-public.chromehelpextensionmenucustomlink.md)
## ChromeHelpExtensionMenuCustomLink type
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtensionMenuCustomLink = EuiButtonEmptyProps & {
linkType: 'custom';
content: React.ReactNode;
};
```

View file

@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-public.chromehelpextensionmenudiscusslink.md)
## ChromeHelpExtensionMenuDiscussLink type
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtensionMenuDiscussLink = EuiButtonEmptyProps & {
linkType: 'discuss';
href: string;
};
```

View file

@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-public.chromehelpextensionmenudocumentationlink.md)
## ChromeHelpExtensionMenuDocumentationLink type
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtensionMenuDocumentationLink = EuiButtonEmptyProps & {
linkType: 'documentation';
href: string;
};
```

View file

@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-public.chromehelpextensionmenugithublink.md)
## ChromeHelpExtensionMenuGitHubLink type
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtensionMenuGitHubLink = EuiButtonEmptyProps & {
linkType: 'github';
labels: string[];
title?: string;
};
```

View file

@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeHelpExtensionMenuLink](./kibana-plugin-public.chromehelpextensionmenulink.md)
## ChromeHelpExtensionMenuLink type
<b>Signature:</b>
```typescript
export declare type ChromeHelpExtensionMenuLink = ExclusiveUnion<ChromeHelpExtensionMenuGitHubLink, ExclusiveUnion<ChromeHelpExtensionMenuDiscussLink, ExclusiveUnion<ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuCustomLink>>>;
```

View file

@ -33,6 +33,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [ChromeBadge](./kibana-plugin-public.chromebadge.md) | |
| [ChromeBrand](./kibana-plugin-public.chromebrand.md) | |
| [ChromeDocTitle](./kibana-plugin-public.chromedoctitle.md) | APIs for accessing and updating the document title. |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeNavControl](./kibana-plugin-public.chromenavcontrol.md) | |
| [ChromeNavControls](./kibana-plugin-public.chromenavcontrols.md) | [APIs](./kibana-plugin-public.chromenavcontrols.md) for registering new controls to be displayed in the navigation bar. |
| [ChromeNavLink](./kibana-plugin-public.chromenavlink.md) | |
@ -98,7 +99,11 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| --- | --- |
| [AppUnmount](./kibana-plugin-public.appunmount.md) | A function called when an application should be unmounted from the page. This function should be synchronous. |
| [ChromeBreadcrumb](./kibana-plugin-public.chromebreadcrumb.md) | |
| [ChromeHelpExtension](./kibana-plugin-public.chromehelpextension.md) | |
| [ChromeHelpExtensionMenuCustomLink](./kibana-plugin-public.chromehelpextensionmenucustomlink.md) | |
| [ChromeHelpExtensionMenuDiscussLink](./kibana-plugin-public.chromehelpextensionmenudiscusslink.md) | |
| [ChromeHelpExtensionMenuDocumentationLink](./kibana-plugin-public.chromehelpextensionmenudocumentationlink.md) | |
| [ChromeHelpExtensionMenuGitHubLink](./kibana-plugin-public.chromehelpextensionmenugithublink.md) | |
| [ChromeHelpExtensionMenuLink](./kibana-plugin-public.chromehelpextensionmenulink.md) | |
| [ChromeNavLinkUpdateableFields](./kibana-plugin-public.chromenavlinkupdateablefields.md) | |
| [HandlerContextType](./kibana-plugin-public.handlercontexttype.md) | Extracts the type of the first argument of a [HandlerFunction](./kibana-plugin-public.handlerfunction.md) to represent the type of the context. |
| [HandlerFunction](./kibana-plugin-public.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-public.icontextcontainer.md) |

View file

@ -418,17 +418,20 @@ describe('start', () => {
.pipe(toArray())
.toPromise();
chrome.setHelpExtension(() => () => undefined);
chrome.setHelpExtension({ appName: 'App name', content: () => () => undefined });
chrome.setHelpExtension(undefined);
service.stop();
await expect(promise).resolves.toMatchInlineSnapshot(`
Array [
undefined,
[Function],
undefined,
]
`);
Array [
undefined,
Object {
"appName": "App name",
"content": [Function],
},
undefined,
]
`);
});
});
});

View file

@ -36,6 +36,7 @@ import { NavControlsService, ChromeNavControls } from './nav_controls';
import { DocTitleService, ChromeDocTitle } from './doc_title';
import { LoadingIndicator, HeaderWrapper as Header } from './ui';
import { DocLinksStart } from '../doc_links';
import { ChromeHelpExtensionMenuLink } from './ui/header/header_help_menu';
export { ChromeNavControls, ChromeRecentlyAccessed, ChromeDocTitle };
@ -58,7 +59,20 @@ export interface ChromeBrand {
export type ChromeBreadcrumb = EuiBreadcrumb;
/** @public */
export type ChromeHelpExtension = (element: HTMLDivElement) => () => void;
export interface ChromeHelpExtension {
/**
* Provide your plugin's name to create a header for separation
*/
appName: string;
/**
* Creates unified links for sending users to documentation, GitHub, Discuss, or a custom link/button
*/
links?: ChromeHelpExtensionMenuLink[];
/**
* Custom content to occur below the list of links
*/
content?: (element: HTMLDivElement) => () => void;
}
interface ConstructorParams {
browserSupportsCsp: boolean;

View file

@ -26,6 +26,13 @@ export {
ChromeBrand,
ChromeHelpExtension,
} from './chrome_service';
export {
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
} from './ui/header/header_help_menu';
export { ChromeNavLink, ChromeNavLinks, ChromeNavLinkUpdateableFields } from './nav_links';
export { ChromeRecentlyAccessed, ChromeRecentlyAccessedHistoryItem } from './recently_accessed';
export { ChromeNavControl, ChromeNavControls } from './nav_controls';

View file

@ -24,21 +24,13 @@ import * as Rx from 'rxjs';
import {
// TODO: add type annotations
// @ts-ignore
EuiHeader,
// @ts-ignore
EuiHeaderLogo,
// @ts-ignore
EuiHeaderSection,
// @ts-ignore
EuiHeaderSectionItem,
// @ts-ignore
EuiHeaderSectionItemButton,
// @ts-ignore
EuiHideFor,
EuiHorizontalRule,
EuiIcon,
// @ts-ignore
EuiImage,
// @ts-ignore
EuiNavDrawer,

View file

@ -18,11 +18,12 @@
*/
import * as Rx from 'rxjs';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component, Fragment } from 'react';
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { InjectedIntl, injectI18n, FormattedMessage } from '@kbn/i18n/react';
import {
EuiButtonEmpty,
EuiButtonEmptyProps,
EuiFlexGroup,
EuiFlexItem,
EuiHeaderSectionItemButton,
@ -30,8 +31,11 @@ import {
EuiPopover,
EuiPopoverTitle,
EuiSpacer,
EuiTitle,
EuiHorizontalRule,
} from '@elastic/eui';
import { ExclusiveUnion } from '@elastic/eui';
import { HeaderExtension } from './header_extension';
import { ChromeHelpExtension } from '../../chrome_service';
import {
@ -41,6 +45,69 @@ import {
KIBANA_FEEDBACK_LINK,
} from '../../constants';
/** @public */
export type ChromeHelpExtensionMenuGitHubLink = EuiButtonEmptyProps & {
/**
* Creates a link to a new github issue in the Kibana repo
*/
linkType: 'github';
/**
* Include at least one app-specific label to be applied to the new github issue
*/
labels: string[];
/**
* Provides initial text for the title of the issue
*/
title?: string;
};
/** @public */
export type ChromeHelpExtensionMenuDiscussLink = EuiButtonEmptyProps & {
/**
* Creates a generic give feedback link with comment icon
*/
linkType: 'discuss';
/**
* URL to discuss page.
* i.e. `https://discuss.elastic.co/c/${appName}`
*/
href: string;
};
/** @public */
export type ChromeHelpExtensionMenuDocumentationLink = EuiButtonEmptyProps & {
/**
* Creates a deep-link to app-specific documentation
*/
linkType: 'documentation';
/**
* URL to documentation page.
* i.e. `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${appName}.html`,
*/
href: string;
};
/** @public */
export type ChromeHelpExtensionMenuCustomLink = EuiButtonEmptyProps & {
/**
* Extend EuiButtonEmpty to provide extra functionality
*/
linkType: 'custom';
/**
* Content of the button (in lieu of `children`)
*/
content: React.ReactNode;
};
/** @public */
export type ChromeHelpExtensionMenuLink = ExclusiveUnion<
ChromeHelpExtensionMenuGitHubLink,
ExclusiveUnion<
ChromeHelpExtensionMenuDiscussLink,
ExclusiveUnion<ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuCustomLink>
>
>;
interface Props {
helpExtension$: Rx.Observable<ChromeHelpExtension | undefined>;
intl: InjectedIntl;
@ -84,6 +151,36 @@ class HeaderHelpMenuUI extends Component<Props, State> {
}
}
createGithubUrl = (labels: string[], title?: string) => {
const url = new URL('https://github.com/elastic/kibana/issues/new?');
if (labels.length) {
url.searchParams.set('labels', labels.join(','));
}
if (title) {
url.searchParams.set('title', title);
}
return url.toString();
};
createCustomLink = (
index: number,
text: React.ReactNode,
addSpacer?: boolean,
buttonProps?: EuiButtonEmptyProps
) => {
return (
<Fragment key={`helpButton${index}`}>
<EuiButtonEmpty {...buttonProps} size="xs" flush="left">
{text}
</EuiButtonEmpty>
{addSpacer && <EuiSpacer size="xs" />}
</Fragment>
);
};
public render() {
const { intl, kibanaVersion, useDefaultContent, kibanaDocLink } = this.props;
const { helpExtension } = this.state;
@ -137,6 +234,74 @@ class HeaderHelpMenuUI extends Component<Props, State> {
</Fragment>
) : null;
let customContent;
if (helpExtension) {
const { appName, links, content } = helpExtension;
const getFeedbackText = () =>
i18n.translate('core.ui.chrome.headerGlobalNav.helpMenuGiveFeedbackOnApp', {
defaultMessage: 'Give feedback on {appName}',
values: { appName: helpExtension.appName },
});
const customLinks =
links &&
links.map((link, index) => {
const { linkType, title, labels = [], content: text, ...rest } = link;
switch (linkType) {
case 'documentation':
return this.createCustomLink(
index,
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuDocumentation"
defaultMessage="Documentation"
/>,
index < links.length - 1,
{
target: '_blank',
rel: 'noopener',
...rest,
}
);
case 'github':
return this.createCustomLink(index, getFeedbackText(), index < links.length - 1, {
iconType: 'logoGithub',
href: this.createGithubUrl(labels, title),
target: '_blank',
rel: 'noopener',
...rest,
});
case 'discuss':
return this.createCustomLink(index, getFeedbackText(), index < links.length - 1, {
iconType: 'editorComment',
target: '_blank',
rel: 'noopener',
...rest,
});
case 'custom':
return this.createCustomLink(index, text, index < links.length - 1, { ...rest });
default:
break;
}
});
customContent = (
<>
<EuiTitle size="xxs">
<h3>{appName}</h3>
</EuiTitle>
<EuiSpacer size="s" />
{customLinks}
{content && (
<>
{customLinks && <EuiSpacer size="s" />}
<HeaderExtension extension={content} />
</>
)}
</>
);
}
const button = (
<EuiHeaderSectionItemButton
aria-expanded={this.state.isOpen}
@ -165,10 +330,12 @@ class HeaderHelpMenuUI extends Component<Props, State> {
<EuiPopoverTitle>
<EuiFlexGroup responsive={false}>
<EuiFlexItem>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuTitle"
defaultMessage="Help"
/>
<h2>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuTitle"
defaultMessage="Help"
/>
</h2>
</EuiFlexItem>
<EuiFlexItem grow={false} className="chrHeaderHelpMenu__version">
<FormattedMessage
@ -182,8 +349,8 @@ class HeaderHelpMenuUI extends Component<Props, State> {
<div style={{ maxWidth: 240 }}>
{defaultContent}
{defaultContent && helpExtension && <EuiSpacer />}
{helpExtension && <HeaderExtension extension={helpExtension} />}
{defaultContent && customContent && <EuiHorizontalRule margin="m" />}
{customContent}
</div>
</EuiPopover>
);

View file

@ -19,3 +19,10 @@
export { Header, HeaderProps } from './header';
export { HeaderWrapper } from './header_wrapper';
export {
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
} from './header_help_menu';

View file

@ -18,4 +18,12 @@
*/
export { LoadingIndicator } from './loading_indicator';
export { Header, HeaderWrapper } from './header';
export {
Header,
HeaderWrapper,
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
} from './header';

View file

@ -40,6 +40,11 @@ import {
ChromeBrand,
ChromeBreadcrumb,
ChromeHelpExtension,
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
ChromeNavControl,
ChromeNavControls,
ChromeNavLink,
@ -243,6 +248,11 @@ export {
ChromeBrand,
ChromeBreadcrumb,
ChromeHelpExtension,
ChromeHelpExtensionMenuLink,
ChromeHelpExtensionMenuCustomLink,
ChromeHelpExtensionMenuDiscussLink,
ChromeHelpExtensionMenuDocumentationLink,
ChromeHelpExtensionMenuGitHubLink,
ChromeNavControl,
ChromeNavControls,
ChromeNavLink,

View file

@ -5,7 +5,9 @@
```ts
import { Breadcrumb } from '@elastic/eui';
import { EuiButtonEmptyProps } from '@elastic/eui';
import { EuiGlobalToastListToast } from '@elastic/eui';
import { ExclusiveUnion } from '@elastic/eui';
import { IconType } from '@elastic/eui';
import { Observable } from 'rxjs';
import React from 'react';
@ -119,7 +121,39 @@ export interface ChromeDocTitle {
}
// @public (undocumented)
export type ChromeHelpExtension = (element: HTMLDivElement) => () => void;
export interface ChromeHelpExtension {
appName: string;
content?: (element: HTMLDivElement) => () => void;
links?: ChromeHelpExtensionMenuLink[];
}
// @public (undocumented)
export type ChromeHelpExtensionMenuCustomLink = EuiButtonEmptyProps & {
linkType: 'custom';
content: React.ReactNode;
};
// @public (undocumented)
export type ChromeHelpExtensionMenuDiscussLink = EuiButtonEmptyProps & {
linkType: 'discuss';
href: string;
};
// @public (undocumented)
export type ChromeHelpExtensionMenuDocumentationLink = EuiButtonEmptyProps & {
linkType: 'documentation';
href: string;
};
// @public (undocumented)
export type ChromeHelpExtensionMenuGitHubLink = EuiButtonEmptyProps & {
linkType: 'github';
labels: string[];
title?: string;
};
// @public (undocumented)
export type ChromeHelpExtensionMenuLink = ExclusiveUnion<ChromeHelpExtensionMenuGitHubLink, ExclusiveUnion<ChromeHelpExtensionMenuDiscussLink, ExclusiveUnion<ChromeHelpExtensionMenuDocumentationLink, ChromeHelpExtensionMenuCustomLink>>>;
// @public (undocumented)
export interface ChromeNavControl {

View file

@ -1,46 +0,0 @@
/*
* 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, { PureComponent } from 'react';
import { EuiButton, EuiHorizontalRule, EuiSpacer } from '@elastic/eui';
import { FormattedMessage, I18nProvider } from '@kbn/i18n/react';
export class HelpMenu extends PureComponent {
render() {
return (
<I18nProvider>
<>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiButton
fill
iconType="popout"
href={`${this.props.docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${this.props.docLinks.DOC_LINK_VERSION}/dashboard.html`}
target="_blank"
>
<FormattedMessage
id="kbn.dashboard.helpMenu.docLabel"
defaultMessage="Dashboard documentation"
/>
</EuiButton>
</>
</I18nProvider>
);
}
}

View file

@ -17,15 +17,19 @@
* under the License.
*/
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HelpMenu } from './help_menu';
import { i18n } from '@kbn/i18n';
import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links';
export function addHelpMenuToAppChrome(chrome, docLinks) {
chrome.setHelpExtension(domElement => {
render(<HelpMenu docLinks={docLinks} />, domElement);
return () => {
unmountComponentAtNode(domElement);
};
export function addHelpMenuToAppChrome(chrome) {
chrome.setHelpExtension({
appName: i18n.translate('kbn.dashboard.helpMenu.appName', {
defaultMessage: 'Dashboards',
}),
links: [
{
linkType: 'documentation',
href: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`,
},
],
});
}

View file

@ -1,43 +0,0 @@
/*
* 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 { getServices } from '../../kibana_services';
const { docLinks } = getServices();
export class HelpMenu extends PureComponent {
render() {
return (
<Fragment>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiButton
fill
iconType="popout"
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/discover.html`}
target="_blank"
>
<FormattedMessage id="kbn.discover.helpMenu.docLabel" defaultMessage="Discover documentation" />
</EuiButton>
</Fragment>
);
}
}

View file

@ -17,15 +17,20 @@
* under the License.
*/
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HelpMenu } from './help_menu';
import { i18n } from '@kbn/i18n';
import { getServices } from '../../kibana_services';
const { docLinks } = getServices();
export function addHelpMenuToAppChrome(chrome) {
chrome.setHelpExtension(domElement => {
render(<HelpMenu/>, domElement);
return () => {
unmountComponentAtNode(domElement);
};
chrome.setHelpExtension({
appName: i18n.translate('kbn.discover.helpMenu.appName', {
defaultMessage: 'Discover',
}),
links: [
{
linkType: 'documentation',
href: `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/discover.html`,
},
],
});
}

View file

@ -1,45 +0,0 @@
/*
* 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 { getServices } from '../kibana_services';
const { docLinks } = getServices();
export class HelpMenu extends PureComponent {
render() {
return (
<Fragment>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiButton
fill
iconType="popout"
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/visualize.html`}
target="_blank"
>
<FormattedMessage id="kbn.visualize.helpMenu.docLabel" defaultMessage="Visualize documentation" />
</EuiButton>
</Fragment>
);
}
}

View file

@ -17,15 +17,20 @@
* under the License.
*/
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { HelpMenu } from './help_menu';
import { i18n } from '@kbn/i18n';
import { getServices } from '../kibana_services';
const { docLinks } = getServices();
export function addHelpMenuToAppChrome(chrome) {
chrome.setHelpExtension(domElement => {
render(<HelpMenu/>, domElement);
return () => {
unmountComponentAtNode(domElement);
};
chrome.setHelpExtension({
appName: i18n.translate('kbn.visualize.helpMenu.appName', {
defaultMessage: 'Visualize',
}),
links: [
{
linkType: 'documentation',
href: `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/visualize.html`,
},
],
});
}

View file

@ -1,49 +0,0 @@
/*
* 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 { EuiLink } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { Fragment } from 'react';
import styled from 'styled-components';
import url from 'url';
import { px, units } from '../../../style/variables';
import { useKibanaCore } from '../../../../../observability/public';
const Container = styled.div`
margin: ${px(units.minus)} 0;
`;
export const GlobalHelpExtension: React.SFC = () => {
const core = useKibanaCore();
return (
<Fragment>
<Container>
<EuiLink
href="https://discuss.elastic.co/c/apm"
target="_blank"
rel="noopener"
>
{i18n.translate('xpack.apm.feedbackMenu.provideFeedbackTitle', {
defaultMessage: 'Provide feedback for APM'
})}
</EuiLink>
</Container>
<Container>
<EuiLink
href={url.format({
pathname: core.http.basePath.prepend('/app/kibana'),
hash: '/management/elasticsearch/upgrade_assistant'
})}
>
{i18n.translate('xpack.apm.helpMenu.upgradeAssistantLink', {
defaultMessage: 'Upgrade assistant'
})}
</EuiLink>
</Container>
</Fragment>
);
};

View file

@ -4,33 +4,43 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { npStart } from 'ui/new_platform';
import 'react-vis/dist/style.css';
import 'ui/autoload/all';
import chrome from 'ui/chrome';
import { i18n } from '@kbn/i18n';
import url from 'url';
// @ts-ignore
import { uiModules } from 'ui/modules';
import { GlobalHelpExtension } from './components/app/GlobalHelpExtension';
import { plugin } from './new-platform';
import { REACT_APP_ROOT_ID } from './new-platform/plugin';
import './style/global_overrides.css';
import template from './templates/index.html';
import { KibanaCoreContextProvider } from '../../observability/public';
const { core } = npStart;
// render APM feedback link in global help menu
core.chrome.setHelpExtension(domElement => {
ReactDOM.render(
<KibanaCoreContextProvider core={core}>
<GlobalHelpExtension />
</KibanaCoreContextProvider>,
domElement
);
return () => {
ReactDOM.unmountComponentAtNode(domElement);
};
core.chrome.setHelpExtension({
appName: i18n.translate('xpack.apm.feedbackMenu.appName', {
defaultMessage: 'APM'
}),
links: [
{
linkType: 'discuss',
href: 'https://discuss.elastic.co/c/apm'
},
{
linkType: 'custom',
href: url.format({
pathname: core.http.basePath.prepend('/app/kibana'),
hash: '/management/elasticsearch/upgrade_assistant'
}),
content: i18n.translate('xpack.apm.helpMenu.upgradeAssistantLink', {
defaultMessage: 'Upgrade assistant'
})
}
]
});
// @ts-ignore

View file

@ -531,7 +531,7 @@ export const ComponentStrings = {
}),
getKeyboardShortcutsLinkLabel: () =>
i18n.translate('xpack.canvas.helpMenu.keyboardShortcutsLinkLabel', {
defaultMessage: 'Keyboard Shortcuts',
defaultMessage: 'Keyboard shortcuts',
}),
},
KeyboardShortcutsDoc: {
@ -547,7 +547,7 @@ export const ComponentStrings = {
}),
getTitle: () =>
i18n.translate('xpack.canvas.keyboardShortcutsDoc.flyoutHeaderTitle', {
defaultMessage: 'Keyboard Shortcuts',
defaultMessage: 'Keyboard shortcuts',
}),
},
Link: {

View file

@ -9,7 +9,9 @@ import './angular/config';
import './angular/services';
import React from 'react';
import ReactDOM from 'react-dom';
import { i18n } from '@kbn/i18n';
import chrome from 'ui/chrome';
import { documentationLinks } from './lib/documentation_links';
import { CanvasRootController } from './angular/controllers';
// Import the uiExports that the application uses
@ -33,6 +35,17 @@ import { HelpMenu } from './components/help_menu/help_menu';
chrome.setRootController('canvas', CanvasRootController);
// add Canvas docs to help menu in global nav
chrome.helpExtension.set(domNode => {
ReactDOM.render(<HelpMenu />, domNode);
chrome.helpExtension.set({
appName: i18n.translate('xpack.canvas.helpMenu.appName', {
defaultMessage: 'Canvas',
}),
links: [
{
linkType: 'documentation',
href: documentationLinks.canvas,
},
],
content: domNode => {
ReactDOM.render(<HelpMenu />, domNode);
},
});

View file

@ -5,8 +5,7 @@
*/
import React, { Fragment, PureComponent } from 'react';
import { EuiButton, EuiHorizontalRule, EuiText, EuiSpacer, EuiPortal } from '@elastic/eui';
import { documentationLinks } from '../../lib/documentation_links';
import { EuiButtonEmpty, EuiPortal } from '@elastic/eui';
import { KeyboardShortcutsDoc } from '../keyboard_shortcuts_doc';
import { ComponentStrings } from '../../../i18n';
@ -26,19 +25,14 @@ export class HelpMenu extends PureComponent {
render() {
return (
<Fragment>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiText size="s">
<p>{strings.getHelpMenuDescription()}</p>
</EuiText>
<EuiSpacer />
<EuiButton fill iconType="popout" href={documentationLinks.canvas} target="_blank">
{strings.getDocumentationLinkLabel()}
</EuiButton>
<EuiSpacer />
<EuiButton onClick={this.showFlyout} target="_blank">
<EuiButtonEmpty
size="xs"
flush="left"
iconType="keyboardShortcut"
onClick={this.showFlyout}
>
{strings.getKeyboardShortcutsLinkLabel()}
</EuiButton>
</EuiButtonEmpty>
{this.state.isFlyoutVisible && (
<EuiPortal>

View file

@ -71,7 +71,7 @@ exports[`Storyshots components/KeyboardShortcutsDoc default 1`] = `
<h2
className="euiTitle euiTitle--small"
>
Keyboard Shortcuts
Keyboard shortcuts
</h2>
</div>
<div

View file

@ -4,37 +4,26 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { EuiLink } from '@elastic/eui';
import React, { useEffect } from 'react';
import ReactDOM from 'react-dom';
import chrome from 'ui/chrome';
interface HelpCenterContentProps {
feedbackLink: string;
feedbackLinkText: string;
appName: string;
}
const Content: React.FC<HelpCenterContentProps> = ({ feedbackLink, feedbackLinkText }) => (
<EuiLink href={feedbackLink} target="_blank" rel="noopener">
{feedbackLinkText}
</EuiLink>
);
export const HelpCenterContent: React.FC<HelpCenterContentProps> = ({
feedbackLink,
feedbackLinkText,
}) => {
export const HelpCenterContent: React.FC<HelpCenterContentProps> = ({ feedbackLink, appName }) => {
useEffect(() => {
chrome.helpExtension.set(domElement => {
ReactDOM.render(
<Content feedbackLink={feedbackLink} feedbackLinkText={feedbackLinkText} />,
domElement
);
return () => {
ReactDOM.unmountComponentAtNode(domElement);
};
chrome.helpExtension.set({
appName,
links: [
{
linkType: 'discuss',
href: feedbackLink,
},
],
});
}, [feedbackLink, feedbackLinkText]);
}, [feedbackLink, appName]);
return null;
};

View file

@ -41,10 +41,9 @@ export const InfrastructurePage = injectUICapabilities(
<HelpCenterContent
feedbackLink="https://discuss.elastic.co/c/metrics"
feedbackLinkText={i18n.translate(
'xpack.infra.infrastructure.infrastructureHelpContent.feedbackLinkText',
{ defaultMessage: 'Provide feedback for Metrics' }
)}
appName={i18n.translate('xpack.infra.header.infrastructureHelpAppName', {
defaultMessage: 'Metrics',
})}
/>
<Header

View file

@ -64,7 +64,7 @@ export const LogsPage = injectUICapabilities(({ match, uiCapabilities }: LogsPag
<ColumnarPage>
<DocumentTitle title={pageTitle} />
<HelpCenterContent feedbackLink={feedbackLinkUrl} feedbackLinkText={feedbackLinkText} />
<HelpCenterContent feedbackLink={feedbackLinkUrl} appName={pageTitle} />
<Header
breadcrumbs={[
@ -130,8 +130,4 @@ const settingsTabTitle = i18n.translate('xpack.infra.logs.index.settingsTabTitle
defaultMessage: 'Settings',
});
const feedbackLinkText = i18n.translate('xpack.infra.logsPage.logsHelpContent.feedbackLinkText', {
defaultMessage: 'Provide feedback for Logs',
});
const feedbackLinkUrl = 'https://discuss.elastic.co/c/logs';

View file

@ -4,55 +4,22 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import { EuiHorizontalRule, EuiSpacer, EuiLink, EuiText, EuiIcon, EuiButton } 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';
import { render, unmountComponentAtNode } from 'react-dom';
import { ChromeStart } from 'kibana/public';
const docsPage = 'lens';
export function addHelpMenuToAppChrome(chrome: ChromeStart) {
chrome.setHelpExtension(domElement => {
render(<HelpMenu />, domElement);
return () => {
unmountComponentAtNode(domElement);
};
chrome.setHelpExtension({
appName: 'Lens',
links: [
{
linkType: 'documentation',
href: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/lens.html`,
},
{
linkType: 'github',
title: '[Lens]',
labels: ['Feature:Lens'],
},
],
});
}
function HelpMenu() {
return (
<>
<EuiHorizontalRule margin="none" />
{docsPage && (
<>
<EuiSpacer />
<EuiButton
fill
iconType="popout"
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${docsPage}.html`}
target="_blank"
>
<FormattedMessage
id="xpack.lens.helpMenu.docLabel"
defaultMessage="Lens documentation"
/>
</EuiButton>
</>
)}
<EuiSpacer />
<EuiText size="s">
<EuiIcon type="logoGithub" color="primary" /> &nbsp;
<EuiLink href="https://github.com/elastic/kibana/issues/new/choose" target="_blank">
{i18n.translate('xpack.lens.helpMenu.feedbackLinkText', {
defaultMessage: 'Provide feedback for the Lens application',
})}
</EuiLink>
</EuiText>
</>
);
}

View file

@ -1,39 +0,0 @@
/*
* 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, EuiText, EuiIcon } 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 (
<Fragment>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiButton
fill
iconType="popout"
href={`${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/maps.html`}
target="_blank"
>
<FormattedMessage id="xpack.maps.helpMenu.docLabel" defaultMessage="Maps documentation" />
</EuiButton>
<EuiSpacer />
<EuiText size="s">
<EuiIcon type="logoGithub" color="primary" /> &nbsp;
<EuiLink href="https://github.com/elastic/kibana/issues/new" target="_blank">
{i18n.translate('xpack.maps.helpMenu.feedbackLinkText', {
defaultMessage: 'Provide feedback for the Maps application',
})}
</EuiLink>
</EuiText>
</Fragment>
);
}
}

View file

@ -3,15 +3,21 @@
* 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 './components/help_menu';
import { ELASTIC_WEBSITE_URL, DOC_LINK_VERSION } from 'ui/documentation_links';
export function addHelpMenuToAppChrome(chrome) {
chrome.helpExtension.set(domElement => {
render(<HelpMenu/>, domElement);
return () => {
unmountComponentAtNode(domElement);
};
chrome.helpExtension.set({
appName: 'Maps',
links: [
{
linkType: 'documentation',
href: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/maps.html`,
},
{
linkType: 'github',
title: '[Maps]',
labels: ['Team:Geo'],
},
],
});
}

View file

@ -1,43 +0,0 @@
/*
* 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 { EuiButton, EuiHorizontalRule, EuiIcon, EuiTitle, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import theme from '@elastic/eui/dist/eui_theme_light.json';
import styled from 'styled-components';
export const Icon = styled(EuiIcon)`
margin-right: ${theme.euiSizeS};
`;
Icon.displayName = 'Icon';
export const HelpMenuComponent = React.memo(() => (
<>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiTitle size="xxs">
<h6>
<Icon type="securityAnalyticsApp" />
<FormattedMessage
id="xpack.siem.chrome.help.title"
defaultMessage="SIEM Application Help"
/>
</h6>
</EuiTitle>
<EuiSpacer />
<EuiButton iconType="popout" href="https://discuss.elastic.co/c/siem" target="_blank">
<FormattedMessage id="xpack.siem.chrome.help.feedback" defaultMessage="Submit feedback" />
</EuiButton>
</>
));
HelpMenuComponent.displayName = 'HelpMenuComponent';

View file

@ -4,20 +4,23 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { render, unmountComponentAtNode } from 'react-dom';
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import { pure } from 'recompose';
import chrome from 'ui/chrome';
import { HelpMenuComponent } from './help_menu';
import { i18n } from '@kbn/i18n';
export const HelpMenu = pure<{}>(() => {
useEffect(() => {
chrome.helpExtension.set(domNode => {
render(<HelpMenuComponent />, domNode);
return () => {
unmountComponentAtNode(domNode);
};
chrome.helpExtension.set({
appName: i18n.translate('xpack.siem.chrome.help.appName', {
defaultMessage: 'SIEM',
}),
links: [
{
linkType: 'discuss',
href: 'https://discuss.elastic.co/c/siem',
},
],
});
}, []);

View file

@ -1,43 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renderUptimeKibanaGlobalHelp renders links with expected urls 1`] = `
<React.Fragment>
<EuiHorizontalRule
margin="none"
/>
<EuiSpacer />
<EuiText
size="s"
>
For Uptime specific information
</EuiText>
<EuiSpacer />
<EuiButton
aria-label="Go to Uptime documentation"
fill={true}
href="https://elastic.co/guide/en/kibana/master/xpack-uptime.html"
iconType="popout"
target="_blank"
>
<FormattedMessage
defaultMessage="Uptime documentation"
description="The link will navigate users to the Uptime UI documentation pages."
id="xpack.uptime.header.documentationLinkText"
values={Object {}}
/>
</EuiButton>
<EuiSpacer />
<ForwardRef
aria-label="Go to our discuss page"
href="https://discuss.elastic.co/c/uptime"
target="_blank"
>
<FormattedMessage
defaultMessage="Provide feedback for Uptime"
description="The link is to a support form called 'Discuss', where users can submit feedback."
id="xpack.uptime.header.helpLinkText"
values={Object {}}
/>
</ForwardRef>
</React.Fragment>
`;

View file

@ -1,13 +0,0 @@
/*
* 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 { renderUptimeKibanaGlobalHelp } from '../kibana_global_help';
describe('renderUptimeKibanaGlobalHelp', () => {
it('renders links with expected urls', () => {
expect(renderUptimeKibanaGlobalHelp('https://elastic.co/', 'master')).toMatchSnapshot();
});
});

View file

@ -1,48 +0,0 @@
/*
* 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 { EuiLink, EuiSpacer, EuiHorizontalRule, EuiButton, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';
export const renderUptimeKibanaGlobalHelp = (docsSiteUrl: string, docLinkVersion: string) => (
<React.Fragment>
<EuiHorizontalRule margin="none" />
<EuiSpacer />
<EuiText size="s">For Uptime specific information</EuiText>
<EuiSpacer />
<EuiButton
fill
iconType="popout"
target="_blank"
aria-label={i18n.translate('xpack.uptime.header.docsLinkAriaLabel', {
defaultMessage: 'Go to Uptime documentation',
})}
href={`${docsSiteUrl}guide/en/kibana/${docLinkVersion}/xpack-uptime.html`}
>
<FormattedMessage
id="xpack.uptime.header.documentationLinkText"
defaultMessage="Uptime documentation"
description="The link will navigate users to the Uptime UI documentation pages."
/>
</EuiButton>
<EuiSpacer />
<EuiLink
aria-label={i18n.translate('xpack.uptime.header.helpLinkAriaLabel', {
defaultMessage: 'Go to our discuss page',
})}
href="https://discuss.elastic.co/c/uptime"
target="_blank"
>
<FormattedMessage
id="xpack.uptime.header.helpLinkText"
defaultMessage="Provide feedback for Uptime"
description="The link is to a support form called 'Discuss', where users can submit feedback."
/>
</EuiLink>
</React.Fragment>
);

View file

@ -9,12 +9,12 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { get } from 'lodash';
import { AutocompleteProviderRegister } from 'src/plugins/data/public';
import { i18n as i18nFormatter } from '@kbn/i18n';
import { CreateGraphQLClient } from './framework_adapter_types';
import { UptimeApp, UptimeAppProps } from '../../../uptime_app';
import { getIntegratedAppAvailability } from './capabilities_adapter';
import { INTEGRATED_SOLUTIONS, PLUGIN } from '../../../../common/constants';
import { getTelemetryMonitorPageLogger, getTelemetryOverviewPageLogger } from '../telemetry';
import { renderUptimeKibanaGlobalHelp } from './kibana_global_help';
import { UMFrameworkAdapter, BootstrapUptimeApp } from '../../lib';
import { createApolloClient } from './apollo_client_adapter';
@ -52,12 +52,20 @@ export const getKibanaFrameworkAdapter = (
logMonitorPageLoad: getTelemetryMonitorPageLogger('true', basePath.get()),
logOverviewPageLoad: getTelemetryOverviewPageLogger('true', basePath.get()),
renderGlobalHelpControls: () =>
setHelpExtension((element: HTMLElement) => {
ReactDOM.render(
renderUptimeKibanaGlobalHelp(ELASTIC_WEBSITE_URL, DOC_LINK_VERSION),
element
);
return () => ReactDOM.unmountComponentAtNode(element);
setHelpExtension({
appName: i18nFormatter.translate('xpack.uptime.header.appName', {
defaultMessage: 'Uptime',
}),
links: [
{
linkType: 'documentation',
href: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/xpack-uptime.html`,
},
{
linkType: 'discuss',
href: 'https://discuss.elastic.co/c/uptime',
},
],
}),
routerBasename: basePath.prepend(PLUGIN.ROUTER_BASE_NAME),
setBadge,

View file

@ -3364,7 +3364,6 @@
"xpack.apm.errorsTable.occurrencesColumnLabel": "オカレンス",
"xpack.apm.errorsTable.unhandledLabel": "未対応",
"xpack.apm.featureRegistry.apmFeatureName": "APM",
"xpack.apm.feedbackMenu.provideFeedbackTitle": "APM のフィードバックを提供",
"xpack.apm.filter.environment.allLabel": "すべて",
"xpack.apm.filter.environment.label": "環境",
"xpack.apm.filter.environment.notDefinedLabel": "未定義",
@ -5850,7 +5849,6 @@
"xpack.infra.homePage.noMetricsIndicesTitle": "メトリックインデックスがないようです。",
"xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "インフラストラクチャーデータを検索… (例: host.name:host-1)",
"xpack.infra.homePage.toolbar.showingLastOneMinuteDataText": "指定期間の最後の 1 分間のデータを表示中",
"xpack.infra.infrastructure.infrastructureHelpContent.feedbackLinkText": "インフラストラクチャーのフィードバックを提供",
"xpack.infra.infrastructureDescription": "インフラストラクチャーを閲覧します",
"xpack.infra.infrastructureMetricsExplorerPage.documentTitle": "{previousTitle} | メトリックエクスプローラー",
"xpack.infra.infrastructureSnapshotPage.documentTitle": "{previousTitle} | インベントリ",
@ -5901,7 +5899,6 @@
"xpack.infra.logs.stopStreamingButtonLabel": "ストリーム停止",
"xpack.infra.logs.streamingDescription": "新しいエントリーをストリーム中...",
"xpack.infra.logs.streamingNewEntriesText": "新しいエントリーをストリーム中",
"xpack.infra.logsPage.logsHelpContent.feedbackLinkText": "ログのフィードバックを提供",
"xpack.infra.logsPage.noLoggingIndicesDescription": "追加しましょう!",
"xpack.infra.logsPage.noLoggingIndicesInstructionsActionLabel": "セットアップの手順を表示",
"xpack.infra.logsPage.noLoggingIndicesTitle": "ログインデックスがないようです。",
@ -6428,8 +6425,6 @@
"xpack.maps.heatmap.colorRampLabel": "色の範囲",
"xpack.maps.heatmapLegend.coldLabel": "コールド",
"xpack.maps.heatmapLegend.hotLabel": "ホット",
"xpack.maps.helpMenu.docLabel": "Maps ドキュメンテーション",
"xpack.maps.helpMenu.feedbackLinkText": "Maps アプリケーションに関するフィードバックを提供",
"xpack.maps.inspector.centerLatLabel": "中央緯度",
"xpack.maps.inspector.centerLonLabel": "中央経度",
"xpack.maps.inspector.mapboxStyleTitle": "マップボックススタイル",
@ -10372,8 +10367,6 @@
"xpack.siem.certificate.fingerprint.clientCertLabel": "クライアント証明書",
"xpack.siem.certificate.fingerprint.serverCertLabel": "サーバー証明書",
"xpack.siem.chart.dataNotAvailableTitle": "チャートデータが利用できません",
"xpack.siem.chrome.help.feedback": "フィードバックを送信",
"xpack.siem.chrome.help.title": "SIEM アプリケーションのヘルプ",
"xpack.siem.clipboard.copied": "コピー完了",
"xpack.siem.clipboard.copy": "コピー",
"xpack.siem.clipboard.to.the.clipboard": "クリップボードに",
@ -11804,8 +11797,6 @@
"xpack.uptime.filterBar.options.location.name": "場所",
"xpack.uptime.filterBar.options.portLabel": "ポート",
"xpack.uptime.filterBar.options.schemeLabel": "スキーム",
"xpack.uptime.header.helpLinkAriaLabel": "ディスカッションページへ移動",
"xpack.uptime.header.helpLinkText": "アップタイムのフィードバックを提供",
"xpack.uptime.integrationLink.missingDataMessage": "この統合に必要なデータが見つかりませんでした。",
"xpack.uptime.monitorCharts.checkStatus.series.downCountLabel": "ダウンカウント",
"xpack.uptime.monitorCharts.checkStatus.series.upCountLabel": "アップカウント",
@ -11867,8 +11858,6 @@
"xpack.uptime.snapshotHistogram.series.upLabel": "アップ",
"xpack.uptime.uptimeFeatureCatalogueTitle": "起動時間",
"xpack.uptime.emptyState.noDataMessage": "アップタイムデータが見つかりませんでした",
"xpack.uptime.header.docsLinkAriaLabel": "アップタイムドキュメンテーションに移動",
"xpack.uptime.header.documentationLinkText": "アップタイムドキュメンテーション",
"xpack.uptime.pingList.collapseRow": "縮小",
"xpack.uptime.pingList.durationMsColumnFormatting": "{millis}ミリ秒",
"xpack.uptime.pingList.expandedRow.bodySize": "本文サイズは {bodyBytes} です。",
@ -12671,8 +12660,6 @@
"xpack.lens.functions.mergeTables.help": "いくつかの Kibana 表を 1 つの表に結合するのをアシストします",
"xpack.lens.functions.renameColumns.help": "データベースの列の名前の変更をアシストします",
"xpack.lens.functions.renameColumns.idMap.help": "キーが古い列 ID で値が対応する新しい列 ID となるように JSON エンコーディングされたオブジェクトです。他の列 ID はすべてのそのままです。",
"xpack.lens.helpMenu.docLabel": "レンズドキュメンテーション",
"xpack.lens.helpMenu.feedbackLinkText": "レンズアプリケーションに関するフィードバックを提供",
"xpack.lens.indexPattern.avg": "平均",
"xpack.lens.indexPattern.avgOf": "{name} の平均",
"xpack.lens.indexPattern.cardinality": "ユニークカウント",

View file

@ -3365,7 +3365,6 @@
"xpack.apm.errorsTable.occurrencesColumnLabel": "发生次数",
"xpack.apm.errorsTable.unhandledLabel": "未处理",
"xpack.apm.featureRegistry.apmFeatureName": "APM",
"xpack.apm.feedbackMenu.provideFeedbackTitle": "提供 APM 的反馈",
"xpack.apm.filter.environment.allLabel": "全部",
"xpack.apm.filter.environment.label": "环境",
"xpack.apm.filter.environment.notDefinedLabel": "未定义",
@ -5852,7 +5851,6 @@
"xpack.infra.homePage.noMetricsIndicesTitle": "似乎您没有任何指标索引。",
"xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder": "搜索基础设施数据……(例如 host.name:host-1",
"xpack.infra.homePage.toolbar.showingLastOneMinuteDataText": "在选定时间显示过去 1 分钟的数据",
"xpack.infra.infrastructure.infrastructureHelpContent.feedbackLinkText": "提供 Infrastructure 的反馈",
"xpack.infra.infrastructureDescription": "浏览您的基础设施",
"xpack.infra.infrastructureMetricsExplorerPage.documentTitle": "{previousTitle} | 指标浏览器",
"xpack.infra.infrastructureSnapshotPage.documentTitle": "{previousTitle} | 库存",
@ -5903,7 +5901,6 @@
"xpack.infra.logs.stopStreamingButtonLabel": "停止流式传输",
"xpack.infra.logs.streamingDescription": "正在流式传输新条目……",
"xpack.infra.logs.streamingNewEntriesText": "正在流式传输新条目",
"xpack.infra.logsPage.logsHelpContent.feedbackLinkText": "提供 Logs 的反馈",
"xpack.infra.logsPage.noLoggingIndicesDescription": "让我们添加一些!",
"xpack.infra.logsPage.noLoggingIndicesInstructionsActionLabel": "查看设置说明",
"xpack.infra.logsPage.noLoggingIndicesTitle": "似乎您没有任何日志索引。",
@ -6369,8 +6366,6 @@
"xpack.maps.heatmap.colorRampLabel": "颜色范围",
"xpack.maps.heatmapLegend.coldLabel": "冷",
"xpack.maps.heatmapLegend.hotLabel": "热",
"xpack.maps.helpMenu.docLabel": "地图文档",
"xpack.maps.helpMenu.feedbackLinkText": "提供 Maps 应用程序的反馈",
"xpack.maps.inspector.centerLatLabel": "中心纬度",
"xpack.maps.inspector.centerLonLabel": "中心经度",
"xpack.maps.inspector.mapboxStyleTitle": "Mapbox 样式",
@ -10401,8 +10396,6 @@
"xpack.siem.certificate.fingerprint.clientCertLabel": "客户端证书",
"xpack.siem.certificate.fingerprint.serverCertLabel": "服务器证书",
"xpack.siem.chart.dataNotAvailableTitle": "图表数据不可用",
"xpack.siem.chrome.help.feedback": "提交反馈",
"xpack.siem.chrome.help.title": "SIEM 应用程序帮助",
"xpack.siem.clipboard.copied": "已复制",
"xpack.siem.clipboard.copy": "复制",
"xpack.siem.clipboard.to.the.clipboard": "至剪贴板",
@ -11833,8 +11826,6 @@
"xpack.uptime.filterBar.options.location.name": "位置",
"xpack.uptime.filterBar.options.portLabel": "端口",
"xpack.uptime.filterBar.options.schemeLabel": "方案",
"xpack.uptime.header.helpLinkAriaLabel": "前往我们的讨论页",
"xpack.uptime.header.helpLinkText": "提供运行时间反馈",
"xpack.uptime.integrationLink.missingDataMessage": "未找到此集成的所需数据。",
"xpack.uptime.monitorCharts.checkStatus.series.downCountLabel": "关闭计数",
"xpack.uptime.monitorCharts.checkStatus.series.upCountLabel": "运行计数",
@ -11896,8 +11887,6 @@
"xpack.uptime.snapshotHistogram.series.upLabel": "运行",
"xpack.uptime.uptimeFeatureCatalogueTitle": "运行时间",
"xpack.uptime.emptyState.noDataMessage": "未找到任何运行时间数据",
"xpack.uptime.header.docsLinkAriaLabel": "前往 Uptime 文档",
"xpack.uptime.header.documentationLinkText": "Uptime 文档",
"xpack.uptime.pingList.collapseRow": "折叠",
"xpack.uptime.pingList.durationMsColumnFormatting": "{millis} 毫秒",
"xpack.uptime.pingList.expandedRow.bodySize": "正文大小为 {bodyBytes}。",
@ -12700,8 +12689,6 @@
"xpack.lens.functions.mergeTables.help": "将任何数目的 kibana 表合并成单个表的助手",
"xpack.lens.functions.renameColumns.help": "用于重命名数据表列的助手",
"xpack.lens.functions.renameColumns.idMap.help": "旧列 ID 为键且相应新列 ID 为值的 JSON 编码对象。所有其他列 ID 都将保留。",
"xpack.lens.helpMenu.docLabel": "Lens 文档",
"xpack.lens.helpMenu.feedbackLinkText": "提供 Lens 应用程序的反馈",
"xpack.lens.indexPattern.avg": "平均值",
"xpack.lens.indexPattern.avgOf": "{name} 的平均值",
"xpack.lens.indexPattern.cardinality": "唯一计数",