|
17 | 17 | * under the License. |
18 | 18 | */ |
19 | 19 |
|
| 20 | +import * as Rx from 'rxjs'; |
20 | 21 | import { FormattedMessage } from '@kbn/i18n/react'; |
21 | 22 | import React, { Component, Fragment } from 'react'; |
22 | | -import * as Rx from 'rxjs'; |
23 | | - |
| 23 | +import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; |
24 | 24 | import { |
25 | | - // TODO: add type annotations |
26 | | - // @ts-ignore |
27 | | - EuiButton, |
28 | | - // @ts-ignore |
| 25 | + EuiButtonEmpty, |
29 | 26 | EuiFlexGroup, |
30 | | - // @ts-ignore |
31 | 27 | EuiFlexItem, |
32 | | - // @ts-ignore |
33 | 28 | EuiHeaderSectionItemButton, |
34 | 29 | EuiIcon, |
35 | 30 | EuiPopover, |
36 | 31 | EuiPopoverTitle, |
37 | 32 | EuiSpacer, |
38 | | - EuiText, |
39 | 33 | } from '@elastic/eui'; |
40 | | -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; |
41 | 34 |
|
42 | 35 | import { HeaderExtension } from './header_extension'; |
43 | 36 | 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'; |
44 | 43 |
|
45 | 44 | interface Props { |
46 | 45 | helpExtension$: Rx.Observable<ChromeHelpExtension>; |
47 | 46 | intl: InjectedIntl; |
48 | 47 | kibanaVersion: string; |
49 | 48 | useDefaultContent?: boolean; |
50 | 49 | kibanaDocLink: string; |
| 50 | + isCloudEnabled: boolean; |
51 | 51 | } |
52 | 52 |
|
53 | 53 | interface State { |
@@ -90,23 +90,50 @@ class HeaderHelpMenuUI extends Component<Props, State> { |
90 | 90 |
|
91 | 91 | const defaultContent = useDefaultContent ? ( |
92 | 92 | <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 | + > |
105 | 132 | <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" |
108 | 135 | /> |
109 | | - </EuiButton> |
| 136 | + </EuiButtonEmpty> |
110 | 137 | </Fragment> |
111 | 138 | ) : null; |
112 | 139 |
|
|
0 commit comments