diff --git a/app/assets/javascripts/admin/addon/components/ace-editor.js b/app/assets/javascripts/admin/addon/components/ace-editor.js index 22c901096fd..838bf21506d 100644 --- a/app/assets/javascripts/admin/addon/components/ace-editor.js +++ b/app/assets/javascripts/admin/addon/components/ace-editor.js @@ -27,6 +27,7 @@ export default class AceEditor extends Component { } didRender() { + super.didRender(...arguments); this._skipContentChangeEvent = false; } @@ -160,9 +161,8 @@ export default class AceEditor extends Component { } willDestroyElement() { - if (this._darkModeListener) { - this._darkModeListener.removeListener(this.setAceTheme); - } + super.willDestroyElement(...arguments); + this._darkModeListener?.removeListener(this.setAceTheme); } @bind diff --git a/app/assets/javascripts/admin/addon/components/admin-graph.js b/app/assets/javascripts/admin/addon/components/admin-graph.js index 29852f1c09c..419122b8b6a 100644 --- a/app/assets/javascripts/admin/addon/components/admin-graph.js +++ b/app/assets/javascripts/admin/addon/components/admin-graph.js @@ -53,6 +53,7 @@ export default class AdminGraph extends Component { } didInsertElement() { + super.didInsertElement(...arguments); loadScript("/javascripts/Chart.min.js").then(() => this.refreshChart.apply(this) ); diff --git a/app/assets/javascripts/admin/addon/components/modal/install-theme.js b/app/assets/javascripts/admin/addon/components/modal/install-theme.js index 29dc28c3ece..ef38cc02625 100644 --- a/app/assets/javascripts/admin/addon/components/modal/install-theme.js +++ b/app/assets/javascripts/admin/addon/components/modal/install-theme.js @@ -117,6 +117,7 @@ export default class InstallTheme extends Component { } willDestroy() { + super.willDestroy(...arguments); this.args.model.clearParams?.(); } diff --git a/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js b/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js index 244f5292edd..d0830cf5e18 100644 --- a/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js +++ b/app/assets/javascripts/admin/addon/components/modal/merge-users-progress.js @@ -16,6 +16,7 @@ export default class MergeUsersProgress extends Component { } willDestroy() { + super.willDestroy(...arguments); this.messageBus.unsubscribe("/merge_user", this.onMessage); } diff --git a/app/assets/javascripts/discourse/app/components/d-modal-body.js b/app/assets/javascripts/discourse/app/components/d-modal-body.js index 4e1c6c5d95c..93d3619d81d 100644 --- a/app/assets/javascripts/discourse/app/components/d-modal-body.js +++ b/app/assets/javascripts/discourse/app/components/d-modal-body.js @@ -66,6 +66,7 @@ export default class DModalBody extends Component { @action willDestroy() { + super.willDestroy(...arguments); this.appEvents.trigger("modal:body-dismissed"); } } diff --git a/app/assets/javascripts/discourse/app/components/discourse-banner.js b/app/assets/javascripts/discourse/app/components/discourse-banner.js index b645973622b..768762571af 100644 --- a/app/assets/javascripts/discourse/app/components/discourse-banner.js +++ b/app/assets/javascripts/discourse/app/components/discourse-banner.js @@ -44,6 +44,7 @@ export default Component.extend({ }, didInsertElement() { + this._super(...arguments); this.appEvents.trigger("decorate-non-stream-cooked-element", this.element); }, }); diff --git a/app/assets/javascripts/discourse/app/components/mobile-nav.js b/app/assets/javascripts/discourse/app/components/mobile-nav.js index 5bfdbe72bc3..90054a7cd83 100644 --- a/app/assets/javascripts/discourse/app/components/mobile-nav.js +++ b/app/assets/javascripts/discourse/app/components/mobile-nav.js @@ -48,6 +48,7 @@ export default Component.extend({ }, willDestroyElement() { + this._super(...arguments); this.router.off("routeDidChange", this, this.currentRouteChanged); }, diff --git a/app/assets/javascripts/discourse/app/components/modal/bookmark.js b/app/assets/javascripts/discourse/app/components/modal/bookmark.js index 7e34e2e997b..96a136d02b0 100644 --- a/app/assets/javascripts/discourse/app/components/modal/bookmark.js +++ b/app/assets/javascripts/discourse/app/components/modal/bookmark.js @@ -128,6 +128,7 @@ export default class BookmarkModal extends Component { } willDestroy() { + super.willDestroy(...arguments); this._itsatrap?.destroy(); this._itsatrap = null; KeyboardShortcuts.unpause(); diff --git a/app/assets/javascripts/discourse/app/components/mount-widget.js b/app/assets/javascripts/discourse/app/components/mount-widget.js index 67c9ff6576c..5c74169c1c0 100644 --- a/app/assets/javascripts/discourse/app/components/mount-widget.js +++ b/app/assets/javascripts/discourse/app/components/mount-widget.js @@ -84,6 +84,7 @@ export default Component.extend({ }, didInsertElement() { + this._super(...arguments); WidgetClickHook.setupDocumentCallback(); this._rootNode = document.createElement("div"); @@ -92,6 +93,7 @@ export default Component.extend({ }, willClearRender() { + this._super(...arguments); const callbacks = _cleanCallbacks[this.widget]; if (callbacks) { callbacks.forEach((cb) => cb(this._tree)); @@ -106,6 +108,7 @@ export default Component.extend({ }, willDestroyElement() { + this._super(...arguments); this._dispatched.forEach((evt) => { const [eventName, caller] = evt; this.appEvents.off(eventName, this, caller); @@ -198,6 +201,7 @@ export default Component.extend({ }, didUpdateAttrs() { + this._super(...arguments); this.queueRerender(); }, }); diff --git a/app/assets/javascripts/discourse/app/components/pending-post.js b/app/assets/javascripts/discourse/app/components/pending-post.js index e2b42f69198..fd825064f9f 100644 --- a/app/assets/javascripts/discourse/app/components/pending-post.js +++ b/app/assets/javascripts/discourse/app/components/pending-post.js @@ -6,6 +6,7 @@ import { afterRender } from "discourse-common/utils/decorators"; export default Component.extend({ didRender() { + this._super(...arguments); this._loadOneboxes(); this._resolveUrls(); }, diff --git a/app/assets/javascripts/discourse/app/components/scrolling-post-stream.js b/app/assets/javascripts/discourse/app/components/scrolling-post-stream.js index 5d649a89a5f..d4635a4f8f1 100644 --- a/app/assets/javascripts/discourse/app/components/scrolling-post-stream.js +++ b/app/assets/javascripts/discourse/app/components/scrolling-post-stream.js @@ -365,6 +365,7 @@ export default MountWidget.extend({ }, didUpdateAttrs() { + this._super(...arguments); this._refresh({ force: true }); }, diff --git a/app/assets/javascripts/discourse/app/components/sidebar.js b/app/assets/javascripts/discourse/app/components/sidebar.js index 7043231b821..5dca3f4c39e 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar.js +++ b/app/assets/javascripts/discourse/app/components/sidebar.js @@ -57,6 +57,7 @@ export default class Sidebar extends Component { } willDestroy() { + super.willDestroy(...arguments); if (this.site.mobileView) { document.removeEventListener("click", this.collapseSidebar); } diff --git a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js index 2a1b98ad10a..5fce784ae53 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/more-section-links.js @@ -18,6 +18,7 @@ export default class SidebarMoreSectionLinks extends Component { } willDestroy() { + super.willDestroy(...arguments); this.#removeClickEventListener(); this.router.off("routeDidChange", this, this.#setActiveSectionLink); } diff --git a/app/assets/javascripts/discourse/app/components/sidebar/section-link.js b/app/assets/javascripts/discourse/app/components/sidebar/section-link.js index 0c50537e832..b886a79207e 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/section-link.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/section-link.js @@ -20,9 +20,8 @@ export default class SectionLink extends Component { @service currentUser; willDestroy() { - if (this.args.willDestroy) { - this.args.willDestroy(); - } + super.willDestroy(...arguments); + this.args.willDestroy?.(); } didInsert(_element, [args]) { diff --git a/app/assets/javascripts/discourse/app/components/sidebar/section.js b/app/assets/javascripts/discourse/app/components/sidebar/section.js index 8fdae287ead..a16d78abc12 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/section.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/section.js @@ -25,9 +25,8 @@ export default class SidebarSection extends Component { } willDestroy() { - if (this.args.willDestroy) { - this.args.willDestroy(); - } + super.willDestroy(...arguments); + this.args.willDestroy?.(); } @action diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js index 478bbd9d322..1ab0d38c0a2 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js @@ -53,6 +53,8 @@ export default class SidebarUserMessagesSection extends Component { } willDestroy() { + super.willDestroy(...arguments); + this.appEvents.off( "page:changed", this, diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.js b/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.js index 410f4aa8d1f..e35ac3fd60e 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/user/tags-section.js @@ -29,6 +29,7 @@ export default class SidebarUserTagsSection extends Component { } willDestroy() { + super.willDestroy(...arguments); this.topicTrackingState.offStateChange(this.callbackId); } diff --git a/app/assets/javascripts/discourse/app/components/site-header.js b/app/assets/javascripts/discourse/app/components/site-header.js index d9eda6dc195..22b7b90ebfc 100644 --- a/app/assets/javascripts/discourse/app/components/site-header.js +++ b/app/assets/javascripts/discourse/app/components/site-header.js @@ -220,6 +220,8 @@ const SiteHeaderComponent = MountWidget.extend( }, willRender() { + this._super(...arguments); + if (this.get("currentUser.staff")) { document.body.classList.add("staff"); } diff --git a/app/assets/javascripts/discourse/app/components/table-header-toggle.js b/app/assets/javascripts/discourse/app/components/table-header-toggle.js index 81ec2d7bd21..6745c9639d0 100644 --- a/app/assets/javascripts/discourse/app/components/table-header-toggle.js +++ b/app/assets/javascripts/discourse/app/components/table-header-toggle.js @@ -59,11 +59,15 @@ export default Component.extend({ this.toggleChevron(); this._updateA11yAttributes(); }, + didRender() { + this._super(...arguments); + if (this.onActiveRender && this.chevronIcon) { this.onActiveRender(this.element); } }, + _updateA11yAttributes() { let criteria = ""; const pressed = this.order === this.field; diff --git a/app/assets/javascripts/discourse/app/components/topic-entrance.js b/app/assets/javascripts/discourse/app/components/topic-entrance.js index 2392d3dcd47..493d426c727 100644 --- a/app/assets/javascripts/discourse/app/components/topic-entrance.js +++ b/app/assets/javascripts/discourse/app/components/topic-entrance.js @@ -161,6 +161,7 @@ export default Component.extend(CleansUp, { }, willDestroyElement() { + this._super(...arguments); this.appEvents.off("topic-entrance:show", this, "_show"); }, diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js index 630763debeb..544159ff0b5 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js @@ -387,6 +387,8 @@ export default class TopicTimelineScrollArea extends Component { } willDestroy() { + super.willDestroy(...arguments); + if (!this.args.mobileView) { this.intersectionObserver?.disconnect(); this.intersectionObserver = null; diff --git a/app/assets/javascripts/discourse/app/components/user-status-picker.js b/app/assets/javascripts/discourse/app/components/user-status-picker.js index 522b6791886..d51411a62ac 100644 --- a/app/assets/javascripts/discourse/app/components/user-status-picker.js +++ b/app/assets/javascripts/discourse/app/components/user-status-picker.js @@ -10,7 +10,7 @@ export default class UserStatusPicker extends Component { emojiPickerIsActive = false; didInsertElement() { - this._super(...arguments); + super.didInsertElement(...arguments); if (!this.status) { this.set("status", {}); diff --git a/app/assets/javascripts/discourse/app/lib/plugin-api.js b/app/assets/javascripts/discourse/app/lib/plugin-api.js index 9a348b2ffa7..b02837e3393 100644 --- a/app/assets/javascripts/discourse/app/lib/plugin-api.js +++ b/app/assets/javascripts/discourse/app/lib/plugin-api.js @@ -1923,6 +1923,7 @@ class PluginApi { pluginId: `${mountedComponent}/${widgetKey}/${appEvent}`, didInsertElement() { + // eslint-disable-next-line ember/no-ember-super-in-es-classes this._super(); this.dispatch(appEvent, widgetKey); }, diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-post-decorate-cooked-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-post-decorate-cooked-test.js index 65236bc4554..78ca9fe28bd 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/topic-post-decorate-cooked-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/topic-post-decorate-cooked-test.js @@ -15,6 +15,7 @@ acceptance("Acceptance | decorateCookedElement", function () { return super(...arguments); } willDestroy() { + super.willDestroy(...arguments); DemoComponent.eventLog.push("willDestroy"); } } diff --git a/app/assets/javascripts/discourse/tests/integration/components/widgets/render-glimmer-test.js b/app/assets/javascripts/discourse/tests/integration/components/widgets/render-glimmer-test.js index 70cfee4c268..853d74a4e16 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/widgets/render-glimmer-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/widgets/render-glimmer-test.js @@ -68,18 +68,22 @@ class DemoComponent extends ClassicComponent { } didInsertElement() { + super.didInsertElement(...arguments); DemoComponent.eventLog.push("didInsertElement"); } willDestroyElement() { + super.willDestroyElement(...arguments); DemoComponent.eventLog.push("willDestroyElement"); } didReceiveAttrs() { + super.didReceiveAttrs(...arguments); DemoComponent.eventLog.push("didReceiveAttrs"); } willDestroy() { + super.willDestroy(...arguments); DemoComponent.eventLog.push("willDestroy"); } } diff --git a/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs b/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs index c51f74e4b0b..3d1b8a2f675 100644 --- a/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs +++ b/app/assets/javascripts/discourse/tests/integration/helpers/raw-test.gjs @@ -40,6 +40,7 @@ module("Integration | Helper | raw", function (hooks) { willDestroy() { + super.willDestroy(...arguments); willDestroyCalled = true; } }