From aaee9b8c81db38290147eac8a37727ac7ff731a7 Mon Sep 17 00:00:00 2001 From: Gianluca De Cola Date: Wed, 16 Feb 2022 00:40:38 +0100 Subject: [PATCH] Remove IE11 warning message and related files - resolves #7993 --- CHANGELOG.txt | 1 + CONTRIBUTORS.rst | 1 + client/src/config/wagtailConfig.js | 2 -- client/src/entrypoints/admin/wagtailadmin.js | 9 +------- client/src/includes/initIE11Warning.js | 21 ------------------ client/src/includes/initIE11Warning.test.js | 22 ------------------- client/src/index.ts | 2 -- docs/editor_manual/browser_issues.rst | 2 +- docs/releases/2.17.md | 5 +++++ .../templates/wagtailadmin/skeleton.html | 8 ------- 10 files changed, 9 insertions(+), 64 deletions(-) delete mode 100644 client/src/includes/initIE11Warning.js delete mode 100644 client/src/includes/initIE11Warning.test.js diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 21a3d8a1a4..98807cf738 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 7bd857593c..c159b15533 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -562,6 +562,7 @@ Contributors * Rizwan Mansuri * Dennis McGregor * Joshua Munn +* Gianluca De Cola Translators =========== diff --git a/client/src/config/wagtailConfig.js b/client/src/config/wagtailConfig.js index e4087023c5..75bb994039 100644 --- a/client/src/config/wagtailConfig.js +++ b/client/src/config/wagtailConfig.js @@ -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 */ diff --git a/client/src/entrypoints/admin/wagtailadmin.js b/client/src/entrypoints/admin/wagtailadmin.js index d12c311142..e13ebb6f43 100644 --- a/client/src/entrypoints/admin/wagtailadmin.js +++ b/client/src/entrypoints/admin/wagtailadmin.js @@ -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(); }); diff --git a/client/src/includes/initIE11Warning.js b/client/src/includes/initIE11Warning.js deleted file mode 100644 index 8739f62cd0..0000000000 --- a/client/src/includes/initIE11Warning.js +++ /dev/null @@ -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 }; diff --git a/client/src/includes/initIE11Warning.test.js b/client/src/includes/initIE11Warning.test.js deleted file mode 100644 index 1fa3f4bb09..0000000000 --- a/client/src/includes/initIE11Warning.test.js +++ /dev/null @@ -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 = ''; - initIE11Warning(); - expect(document.querySelector('[data-ie11-warning]').hidden).toBe(false); - }); - - it('no warnings for other browsers', () => { - wagtailConfig.IS_IE11 = false; - document.body.innerHTML = ''; - initIE11Warning(); - expect(document.querySelector('[data-ie11-warning]').hidden).toBe(true); - }); -}); diff --git a/client/src/index.ts b/client/src/index.ts index 8498ee5da5..a44b7ee45e 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -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, }; diff --git a/docs/editor_manual/browser_issues.rst b/docs/editor_manual/browser_issues.rst index 0cdc3ec74a..1a23d276c7 100644 --- a/docs/editor_manual/browser_issues.rst +++ b/docs/editor_manual/browser_issues.rst @@ -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, Microsoft’s replacement for Internet Explorer. You may consider using its `IE mode `_ to keep access to IE11-only sites, while other sites and apps like Wagtail can use modern browser capabilities. diff --git a/docs/releases/2.17.md b/docs/releases/2.17.md index c7e3d7510e..2a6a5d7cfe 100644 --- a/docs/releases/2.17.md +++ b/docs/releases/2.17.md @@ -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, Microsoft’s replacement for Internet Explorer. You may consider using its `IE mode `_ to keep access to IE11-only sites, while other sites and apps like Wagtail can leverage modern browser capabilities. diff --git a/wagtail/admin/templates/wagtailadmin/skeleton.html b/wagtail/admin/templates/wagtailadmin/skeleton.html index 4ca7c0b792..621aa6ba59 100644 --- a/wagtail/admin/templates/wagtailadmin/skeleton.html +++ b/wagtail/admin/templates/wagtailadmin/skeleton.html @@ -76,14 +76,6 @@ {% endblocktrans %} - {% block ie11warning %} - - {% endblock %} - {% block js %}{% endblock %}