diff --git a/client/src/controllers/UpgradeController.test.js b/client/src/controllers/UpgradeController.test.js
index 796de97992..4f57e5e818 100644
--- a/client/src/controllers/UpgradeController.test.js
+++ b/client/src/controllers/UpgradeController.test.js
@@ -10,12 +10,12 @@ describe('UpgradeController', () => {
beforeEach(() => {
document.body.innerHTML = `
Your version: ${version}.
@@ -30,7 +30,7 @@ describe('UpgradeController', () => {
application.stop();
});
- it('should keep the hidden class by default & then show a message when version is out of date', async () => {
+ it('should keep the hidden attribute by default & then show a message when version is out of date', async () => {
const data = {
version: '5.15.1',
url: 'https://docs.wagtail.org/latest/url',
@@ -58,16 +58,12 @@ describe('UpgradeController', () => {
{ referrerPolicy: 'strict-origin-when-cross-origin' },
);
- expect(
- document.getElementById('panel').classList.contains('w-hidden'),
- ).toBe(true);
+ expect(document.getElementById('panel').hidden).toBe(true);
await new Promise(requestAnimationFrame);
// should remove the hidden class on success
- expect(
- document.getElementById('panel').classList.contains('w-hidden'),
- ).toBe(false);
+ expect(document.getElementById('panel').hidden).toBe(false);
// should update the latest version number in the text
expect(document.getElementById('latest-version').textContent).toBe(
@@ -103,9 +99,7 @@ describe('UpgradeController', () => {
// trigger next browser render cycle
await Promise.resolve();
- expect(
- document.getElementById('panel').classList.contains('w-hidden'),
- ).toBe(true);
+ expect(document.getElementById('panel').hidden).toBe(true);
});
it('should throw an error if the fetch fails', async () => {
diff --git a/client/src/controllers/UpgradeController.ts b/client/src/controllers/UpgradeController.ts
index f2c603748e..df6a796323 100644
--- a/client/src/controllers/UpgradeController.ts
+++ b/client/src/controllers/UpgradeController.ts
@@ -20,7 +20,6 @@ import { VersionNumber, VersionDeltaType } from '../utils/version';
* }
*/
export class UpgradeController extends Controller {
- static classes = ['hidden'];
static targets = ['latestVersion', 'link'];
static values = {
currentVersion: String,
@@ -29,7 +28,6 @@ export class UpgradeController extends Controller {
};
declare currentVersionValue: string;
- declare hiddenClass: string;
declare latestVersionTarget: HTMLElement;
declare linkTarget: HTMLElement;
declare ltsOnlyValue: any;
@@ -87,7 +85,7 @@ export class UpgradeController extends Controller {
if (this.linkTarget instanceof HTMLElement) {
this.linkTarget.setAttribute('href', releaseNotesUrl || '');
}
- this.element.classList.remove(this.hiddenClass);
+ this.element.hidden = false;
}
})
.catch((err) => {
diff --git a/wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html b/wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html
index eb0ca28c25..a358ad245d 100644
--- a/wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html
+++ b/wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html
@@ -1,10 +1,10 @@
{% load i18n wagtailcore_tags wagtailadmin_tags %}
{% wagtail_version as current_version %}
-