Remove IE11 warning message and related files

- resolves #7993
pull/8026/head
Gianluca De Cola 2022-02-16 00:40:38 +01:00 zatwierdzone przez LB (Ben Johnston)
rodzic b8405e9ca8
commit aaee9b8c81
10 zmienionych plików z 9 dodań i 64 usunięć

Wyświetl plik

@ -12,6 +12,7 @@ Changelog
* Add black configuration and reformat code using it (Dan Braghis)
* Remove UI code for legacy browser support: polyfills, IE11 workarounds, Modernizr (Thibaud Colas)
* Remove redirect auto-creation recipe from documentation as this feature is now supported in Wagtail core (Andy Babic)
* Remove IE11 warnings (Gianluca De Cola)
* Fix: When using `simple_translations` ensure that the user is redirected to the page edit view when submitting for a single locale (Mitchel Cabuloy)
* Fix: When previewing unsaved changes to `Form` pages, ensure that all added fields are correctly shown in the preview (Joshua Munn)

Wyświetl plik

@ -562,6 +562,7 @@ Contributors
* Rizwan Mansuri
* Dennis McGregor
* Joshua Munn
* Gianluca De Cola
Translators
===========

Wyświetl plik

@ -5,8 +5,6 @@ export const ADMIN_URLS = global.wagtailConfig.ADMIN_URLS;
// Maximum number of pages to load inside the explorer menu.
export const MAX_EXPLORER_PAGES = 200;
export const IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
export const LOCALE_NAMES = new Map();
/* eslint-disable-next-line camelcase */

Wyświetl plik

@ -1,12 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import {
Icon,
Portal,
initFocusOutline,
initIE11Warning,
initUpgradeNotification,
} from '../..';
import { Icon, Portal, initFocusOutline, initUpgradeNotification } from '../..';
if (process.env.NODE_ENV === 'development') {
// Run react-axe in development only, so it does not affect performance
@ -27,6 +21,5 @@ window.wagtail.components = {
*/
document.addEventListener('DOMContentLoaded', () => {
initFocusOutline();
initIE11Warning();
initUpgradeNotification();
});

Wyświetl plik

@ -1,21 +0,0 @@
import { IS_IE11 } from '../config/wagtailConfig';
/**
* Toggles IE11-only warning messages, if any.
*/
const initIE11Warning = () => {
if (!IS_IE11) {
return;
}
const warnings = [].slice.call(
document.querySelectorAll('[data-ie11-warning]'),
);
warnings.forEach((warning) => {
// eslint-disable-next-line no-param-reassign
warning.hidden = false;
});
};
export { initIE11Warning };

Wyświetl plik

@ -1,22 +0,0 @@
const wagtailConfig = require('../config/wagtailConfig');
const { initIE11Warning } = require('./initIE11Warning');
describe('initIE11Warning', () => {
it('skips logic if the page has no warnings', () => {
initIE11Warning();
});
it('shows warnings in IE11', () => {
wagtailConfig.IS_IE11 = true;
document.body.innerHTML = '<p data-ie11-warning hidden>Test</p>';
initIE11Warning();
expect(document.querySelector('[data-ie11-warning]').hidden).toBe(false);
});
it('no warnings for other browsers', () => {
wagtailConfig.IS_IE11 = false;
document.body.innerHTML = '<p data-ie11-warning hidden>Test</p>';
initIE11Warning();
expect(document.querySelector('[data-ie11-warning]').hidden).toBe(true);
});
});

Wyświetl plik

@ -10,7 +10,6 @@ import Portal from './components/Portal/Portal';
import PublicationStatus from './components/PublicationStatus/PublicationStatus';
import Transition from './components/Transition/Transition';
import { initFocusOutline } from './utils/focus';
import { initIE11Warning } from './includes/initIE11Warning';
import { initUpgradeNotification } from './components/UpgradeNotification';
export {
@ -21,6 +20,5 @@ export {
PublicationStatus,
Transition,
initFocusOutline,
initIE11Warning,
initUpgradeNotification,
};

Wyświetl plik

@ -20,7 +20,7 @@ Wagtail has officially removed support for the legacy Internet Explorer browser
* In Wagtail 2.11 (LTS), there was be a warning message displayed on the Wagtail dashboard for IE11 users with administrator role.
* In Wagtail 2.12, the message was displayed to all users regardless of their role.
* In Wagtail 2.13 and 2.14, the message was displayed at the top of all pages.
* Wagtail will no longer support IE11 as of version 2.15 and beyond.
* Wagtail will no longer support IE11 as of version 2.15 and beyond, for any releases after 2.16 there will no longer be a warning to users.
If this affects you or your organisation, consider which alternative browsers you may be able to use.
Wagtail is fully compatible with Microsoft Edge, Microsofts replacement for Internet Explorer. You may consider using its `IE mode <https://docs.microsoft.com/en-us/deployedge/edge-ie-mode>`_ to keep access to IE11-only sites, while other sites and apps like Wagtail can use modern browser capabilities.

Wyświetl plik

@ -23,6 +23,7 @@ Here are other changes related to the redesign:
* Add black configuration and reformat code using it (Dan Braghis)
* Remove UI code for legacy browser support: polyfills, IE11 workarounds, Modernizr (Thibaud Colas)
* Remove redirect auto-creation recipe from documentation as this feature is now supported in Wagtail core (Andy Babic)
* Remove IE11 warnings (Gianluca De Cola)
### Bug fixes
@ -34,3 +35,7 @@ Here are other changes related to the redesign:
## Upgrade considerations
## Removed warning in Internet Explorer (IE11)
* IE11 support was officially dropped in Wagtail 2.15, as of this release there will no longer be a warning shown to users of this browser.
* Wagtail is fully compatible with Microsoft Edge, Microsofts replacement for Internet Explorer. You may consider using its `IE mode <https://docs.microsoft.com/en-us/deployedge/edge-ie-mode>`_ to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities.

Wyświetl plik

@ -76,14 +76,6 @@
{% endblocktrans %}
</noscript>
{% block ie11warning %}
<div data-ie11-warning hidden>
<div class="capabilitymessage">
{% blocktrans with url="https://docs.wagtail.org/en/stable/editor_manual/browser_issues.html#ie11" %}Wagtail has removed support for IE11. <a href="{{ url }}">Learn more about IE11 alternatives</a>.{% endblocktrans %}
</div>
</div>
{% endblock %}
{% block js %}{% endblock %}
<a class="skiplink button" href="#main" data-skiplink>{% trans 'Skip to main content' %}</a>