From 93fd9c5cfd6e09e2bb6ed68912476c42ac453ceb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 13 Sep 2022 14:54:47 +0200 Subject: [PATCH] Set TypeScript build target to ES2022 --- .../js/WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead.js | 3 +-- files/js/WoltLabSuite/Core/Conversation/Ui/MarkAsRead.js | 3 +-- .../WoltLabSuite/Core/Conversation/Ui/Participant/Add.js | 1 + .../WoltLabSuite/Core/Conversation/Ui/Subject/Editor.js | 2 ++ .../Core/Conversation/Ui/User/Menu/Data/Conversation.js | 8 +++++--- tsconfig.json | 7 ++++--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead.js b/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead.js index 2e3d657..4cec716 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAllAsRead.js @@ -13,12 +13,11 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ajax", "WoltLabSuite/C exports.setup = void 0; UiNotification = tslib_1.__importStar(UiNotification); async function markAllAsRead() { - var _a; await (0, Ajax_1.dboAction)("markAllAsRead", "wcf\\data\\conversation\\ConversationAction").dispatch(); document.querySelectorAll(".conversationList .new").forEach((el) => { el.classList.remove("new"); }); - (_a = document.querySelector("#unreadConversations .badgeUpdate")) === null || _a === void 0 ? void 0 : _a.remove(); + document.querySelector("#unreadConversations .badgeUpdate")?.remove(); UiNotification.show(); } function setup() { diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAsRead.js b/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAsRead.js index b16b5f2..95ccbd1 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAsRead.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/MarkAsRead.js @@ -13,11 +13,10 @@ define(["require", "exports", "WoltLabSuite/Core/Ajax"], function (require, expo exports.setup = void 0; const unreadConversations = new WeakSet(); async function markAsRead(conversation) { - var _a; const conversationId = parseInt(conversation.dataset.conversationId, 10); await (0, Ajax_1.dboAction)("markAsRead", "wcf\\data\\conversation\\ConversationAction").objectIds([conversationId]).dispatch(); conversation.classList.remove("new"); - (_a = conversation.querySelector(".columnAvatar p")) === null || _a === void 0 ? void 0 : _a.removeAttribute("title"); + conversation.querySelector(".columnAvatar p")?.removeAttribute("title"); } function setup() { document.querySelectorAll(".conversationList .new .columnAvatar").forEach((el) => { diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/Participant/Add.js b/files/js/WoltLabSuite/Core/Conversation/Ui/Participant/Add.js index 436edce..390ba9f 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/Participant/Add.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/Participant/Add.js @@ -15,6 +15,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ajax", "WoltLabSuite/C UiItemListUser = tslib_1.__importStar(UiItemListUser); Language = tslib_1.__importStar(Language); class UiParticipantAdd { + conversationId; constructor(conversationId) { this.conversationId = conversationId; Ajax.api(this, { diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/Subject/Editor.js b/files/js/WoltLabSuite/Core/Conversation/Ui/Subject/Editor.js index 0cc10bd..bd0e5f7 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/Subject/Editor.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/Subject/Editor.js @@ -8,6 +8,8 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ui/Dialog", "WoltLabSu Language = tslib_1.__importStar(Language); UiNotification = tslib_1.__importStar(UiNotification); class UiSubjectEditor { + objectId; + subject; constructor(objectId) { this.objectId = objectId; } diff --git a/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js b/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js index 754ee7a..e0e5f3c 100644 --- a/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js +++ b/files/js/WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation.js @@ -13,10 +13,12 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Ajax", "WoltLabSuite/C exports.setup = void 0; View_1 = tslib_1.__importDefault(View_1); class UserMenuDataConversation { + button; + counter = 0; + options; + stale = true; + view = undefined; constructor(button, options) { - this.counter = 0; - this.stale = true; - this.view = undefined; this.button = button; this.options = options; const badge = button.querySelector(".badge"); diff --git a/tsconfig.json b/tsconfig.json index 69fdae6..9188a36 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,13 +4,14 @@ "ts/**/*" ], "compilerOptions": { - "target": "es2019", + "target": "ES2022", "module": "amd", "rootDir": "ts/", "outDir": "files/js/", "lib": [ - "dom", - "es2019" + "DOM", + "DOM.Iterable", + "ES2022" ], "strictNullChecks": true, "moduleResolution": "node", -- 2.20.1