Skip to content

Commit 40bc4a7

Browse files
committed
Add "Get Help" and "Kibana Feedback" links to the help popover (#49797)
* Initial work * Move links to constants * Update UI based on design and copy * Apply PR feedback * Remove unused translations * Apply requested changes * Remove some icons
1 parent 02a63d6 commit 40bc4a7

File tree

6 files changed

+81
-30
lines changed

6 files changed

+81
-30
lines changed

src/core/public/chrome/chrome_service.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export class ChromeService {
125125
<LoadingIndicator loadingCount$={http.getLoadingCount$()} />
126126

127127
<Header
128+
isCloudEnabled={injectedMetadata.getInjectedVar('isCloudEnabled') as boolean}
128129
application={application}
129130
appTitle$={appTitle$.pipe(takeUntil(this.stop$))}
130131
badge$={badge$.pipe(takeUntil(this.stop$))}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export const ELASTIC_SUPPORT_LINK = 'https://support.elastic.co/';
21+
export const KIBANA_FEEDBACK_LINK = 'https://www.elastic.co/kibana/feedback';
22+
export const KIBANA_ASK_ELASTIC_LINK = 'https://www.elastic.co/kibana/ask-elastic';
23+
export const GITHUB_CREATE_ISSUE_LINK = 'https://github.com/elastic/kibana/issues/new/choose';

src/core/public/chrome/ui/header/header.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ interface Props {
179179
basePath: HttpStart['basePath'];
180180
isLocked?: boolean;
181181
onIsLockedUpdate?: (isLocked: boolean) => void;
182+
isCloudEnabled: boolean;
182183
}
183184

184185
interface State {
@@ -296,6 +297,7 @@ class HeaderUI extends Component<Props, State> {
296297
kibanaVersion,
297298
onIsLockedUpdate,
298299
legacyMode,
300+
isCloudEnabled,
299301
} = this.props;
300302
const {
301303
appTitle,
@@ -394,7 +396,9 @@ class HeaderUI extends Component<Props, State> {
394396

395397
<EuiHeaderSection side="right">
396398
<EuiHeaderSectionItem>
397-
<HeaderHelpMenu {...{ helpExtension$, kibanaDocLink, kibanaVersion }} />
399+
<HeaderHelpMenu
400+
{...{ isCloudEnabled, helpExtension$, kibanaDocLink, kibanaVersion }}
401+
/>
398402
</EuiHeaderSectionItem>
399403

400404
<HeaderNavControls side="right" navControls={navControlsRight} />

src/core/public/chrome/ui/header/header_help_menu.tsx

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,37 @@
1717
* under the License.
1818
*/
1919

20+
import * as Rx from 'rxjs';
2021
import { FormattedMessage } from '@kbn/i18n/react';
2122
import React, { Component, Fragment } from 'react';
22-
import * as Rx from 'rxjs';
23-
23+
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
2424
import {
25-
// TODO: add type annotations
26-
// @ts-ignore
27-
EuiButton,
28-
// @ts-ignore
25+
EuiButtonEmpty,
2926
EuiFlexGroup,
30-
// @ts-ignore
3127
EuiFlexItem,
32-
// @ts-ignore
3328
EuiHeaderSectionItemButton,
3429
EuiIcon,
3530
EuiPopover,
3631
EuiPopoverTitle,
3732
EuiSpacer,
38-
EuiText,
3933
} from '@elastic/eui';
40-
import { InjectedIntl, injectI18n } from '@kbn/i18n/react';
4134

4235
import { HeaderExtension } from './header_extension';
4336
import { ChromeHelpExtension } from '../../chrome_service';
37+
import {
38+
ELASTIC_SUPPORT_LINK,
39+
GITHUB_CREATE_ISSUE_LINK,
40+
KIBANA_ASK_ELASTIC_LINK,
41+
KIBANA_FEEDBACK_LINK,
42+
} from '../../constants';
4443

4544
interface Props {
4645
helpExtension$: Rx.Observable<ChromeHelpExtension>;
4746
intl: InjectedIntl;
4847
kibanaVersion: string;
4948
useDefaultContent?: boolean;
5049
kibanaDocLink: string;
50+
isCloudEnabled: boolean;
5151
}
5252

5353
interface State {
@@ -90,23 +90,50 @@ class HeaderHelpMenuUI extends Component<Props, State> {
9090

9191
const defaultContent = useDefaultContent ? (
9292
<Fragment>
93-
<EuiText size="s">
94-
<p>
95-
<FormattedMessage
96-
id="core.ui.chrome.headerGlobalNav.helpMenuHelpDescription"
97-
defaultMessage="Get updates, information, and answers in our documentation."
98-
/>
99-
</p>
100-
</EuiText>
101-
102-
<EuiSpacer />
103-
104-
<EuiButton iconType="popout" href={kibanaDocLink} target="_blank">
93+
<EuiButtonEmpty href={kibanaDocLink} target="_blank" size="xs" flush="left">
94+
<FormattedMessage
95+
id="core.ui.chrome.headerGlobalNav.helpMenuKibanaDocumentationTitle"
96+
defaultMessage="Kibana documentation"
97+
/>
98+
</EuiButtonEmpty>
99+
100+
<EuiSpacer size="xs" />
101+
102+
<EuiButtonEmpty
103+
href={this.props.isCloudEnabled ? ELASTIC_SUPPORT_LINK : KIBANA_ASK_ELASTIC_LINK}
104+
target="_blank"
105+
size="xs"
106+
flush="left"
107+
>
108+
<FormattedMessage
109+
id="core.ui.chrome.headerGlobalNav.helpMenuAskElasticTitle"
110+
defaultMessage="Ask Elastic"
111+
/>
112+
</EuiButtonEmpty>
113+
114+
<EuiSpacer size="xs" />
115+
116+
<EuiButtonEmpty href={KIBANA_FEEDBACK_LINK} target="_blank" size="xs" flush="left">
117+
<FormattedMessage
118+
id="core.ui.chrome.headerGlobalNav.helpMenuGiveFeedbackTitle"
119+
defaultMessage="Give feedback"
120+
/>
121+
</EuiButtonEmpty>
122+
123+
<EuiSpacer size="xs" />
124+
125+
<EuiButtonEmpty
126+
href={GITHUB_CREATE_ISSUE_LINK}
127+
target="_blank"
128+
size="xs"
129+
iconType="logoGithub"
130+
flush="left"
131+
>
105132
<FormattedMessage
106-
id="core.ui.chrome.headerGlobalNav.helpMenuGoToDocumentation"
107-
defaultMessage="Go to documentation"
133+
id="core.ui.chrome.headerGlobalNav.helpMenuOpenGitHubIssueTitle"
134+
defaultMessage="Open an issue in GitHub"
108135
/>
109-
</EuiButton>
136+
</EuiButtonEmpty>
110137
</Fragment>
111138
) : null;
112139

x-pack/plugins/translations/translations/ja-JP.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,6 @@
601601
"core.ui.overlays.banner.closeButtonLabel": "閉じる",
602602
"core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "ホームページに移動",
603603
"core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "ヘルプメニュー",
604-
"core.ui.chrome.headerGlobalNav.helpMenuGoToDocumentation": "ドキュメントに移動",
605-
"core.ui.chrome.headerGlobalNav.helpMenuHelpDescription": "不明な点、アップデートなどの情報はドキュメントをご覧ください。",
606604
"core.ui.chrome.headerGlobalNav.helpMenuTitle": "ヘルプ",
607605
"core.ui.chrome.headerGlobalNav.helpMenuVersion": "v {version}",
608606
"core.ui.chrome.sideGlobalNav.viewRecentItemsFlyoutTitle": "最近のアイテム",

x-pack/plugins/translations/translations/zh-CN.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,6 @@
602602
"core.ui.overlays.banner.closeButtonLabel": "关闭",
603603
"core.ui.chrome.headerGlobalNav.goHomePageIconAriaLabel": "前往主页",
604604
"core.ui.chrome.headerGlobalNav.helpMenuButtonAriaLabel": "帮助菜单",
605-
"core.ui.chrome.headerGlobalNav.helpMenuGoToDocumentation": "前往文档",
606-
"core.ui.chrome.headerGlobalNav.helpMenuHelpDescription": "在我们的文档中获取更新、信息以及答案。",
607605
"core.ui.chrome.headerGlobalNav.helpMenuTitle": "帮助",
608606
"core.ui.chrome.headerGlobalNav.helpMenuVersion": "v {version}",
609607
"core.ui.chrome.sideGlobalNav.viewRecentItemsFlyoutTitle": "最近项",

0 commit comments

Comments
 (0)