|
18 | 18 | */ |
19 | 19 |
|
20 | 20 | import { Breadcrumb as EuiBreadcrumb, IconType } from '@elastic/eui'; |
21 | | -import { i18n } from '@kbn/i18n'; |
22 | 21 | import React from 'react'; |
| 22 | +import { FormattedMessage } from '@kbn/i18n/react'; |
23 | 23 | import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs'; |
24 | 24 | import { flatMap, map, takeUntil } from 'rxjs/operators'; |
25 | 25 | import { parse } from 'url'; |
| 26 | +import { EuiLink } from '@elastic/eui'; |
| 27 | +import { mountReactNode } from '../utils/mount'; |
26 | 28 | import { InternalApplicationStart } from '../application'; |
27 | 29 | import { DocLinksStart } from '../doc_links'; |
28 | 30 | import { HttpStart } from '../http'; |
@@ -165,12 +167,41 @@ export class ChromeService { |
165 | 167 | // Can delete |
166 | 168 | const getNavType$ = uiSettings.get$('pageNavigation').pipe(takeUntil(this.stop$)); |
167 | 169 |
|
| 170 | + const isIE = () => { |
| 171 | + const ua = window.navigator.userAgent; |
| 172 | + const msie = ua.indexOf('MSIE '); // IE 10 or older |
| 173 | + const trident = ua.indexOf('Trident/'); // IE 11 |
| 174 | + |
| 175 | + return msie > 0 || trident > 0; |
| 176 | + }; |
| 177 | + |
168 | 178 | if (!this.params.browserSupportsCsp && injectedMetadata.getCspConfig().warnLegacyBrowsers) { |
169 | | - notifications.toasts.addWarning( |
170 | | - i18n.translate('core.chrome.legacyBrowserWarning', { |
171 | | - defaultMessage: 'Your browser does not meet the security requirements for Kibana.', |
172 | | - }) |
173 | | - ); |
| 179 | + notifications.toasts.addWarning({ |
| 180 | + title: mountReactNode( |
| 181 | + <FormattedMessage |
| 182 | + id="core.chrome.legacyBrowserWarning" |
| 183 | + defaultMessage="Your browser does not meet the security requirements for Kibana." |
| 184 | + /> |
| 185 | + ), |
| 186 | + }); |
| 187 | + |
| 188 | + if (isIE()) { |
| 189 | + notifications.toasts.addWarning({ |
| 190 | + title: mountReactNode( |
| 191 | + <FormattedMessage |
| 192 | + id="core.chrome.browserDeprecationWarning" |
| 193 | + defaultMessage="Support for Internet Explorer will be dropped in future versions of this software, please check {link}." |
| 194 | + values={{ |
| 195 | + link: ( |
| 196 | + <EuiLink target="_blank" href="https://www.elastic.co/support/matrix" external> |
| 197 | + the support matrix on our website |
| 198 | + </EuiLink> |
| 199 | + ), |
| 200 | + }} |
| 201 | + /> |
| 202 | + ), |
| 203 | + }); |
| 204 | + } |
174 | 205 | } |
175 | 206 |
|
176 | 207 | return { |
|
0 commit comments