Skip to content

Commit 12e3c35

Browse files
committed
Warning and link to support matrix for IE11
1 parent ac4f5d5 commit 12e3c35

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

src/core/public/chrome/chrome_service.tsx

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
*/
1919

2020
import { Breadcrumb as EuiBreadcrumb, IconType } from '@elastic/eui';
21-
import { i18n } from '@kbn/i18n';
2221
import React from 'react';
22+
import { FormattedMessage } from '@kbn/i18n/react';
2323
import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs';
2424
import { flatMap, map, takeUntil } from 'rxjs/operators';
2525
import { parse } from 'url';
26+
import { EuiLink } from '@elastic/eui';
27+
import { mountReactNode } from '../utils/mount';
2628
import { InternalApplicationStart } from '../application';
2729
import { DocLinksStart } from '../doc_links';
2830
import { HttpStart } from '../http';
@@ -165,12 +167,41 @@ export class ChromeService {
165167
// Can delete
166168
const getNavType$ = uiSettings.get$('pageNavigation').pipe(takeUntil(this.stop$));
167169

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+
168178
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+
}
174205
}
175206

176207
return {

0 commit comments

Comments
 (0)