From e6355395831128f98c425c35370b40121a503758 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 7 Oct 2024 15:05:36 -0400 Subject: [PATCH] DEV: update core extension of UserCardContents (#37) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should fix tests, they were failing with this error: Attempted to register a view with an id already in use: user-card... Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com> --- .../discourse/components/user-card-static.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/javascripts/discourse/components/user-card-static.js b/javascripts/discourse/components/user-card-static.js index 83e5e24..b92fcc9 100644 --- a/javascripts/discourse/components/user-card-static.js +++ b/javascripts/discourse/components/user-card-static.js @@ -1,20 +1,20 @@ import { action } from "@ember/object"; import UserCardContents from "discourse/components/user-card-contents"; -export default UserCardContents.extend({ - layoutName: "components/user-card-contents", - elementId: null, +export default class UserCardStaticContents extends UserCardContents { + layoutName = "components/user-card-contents"; + elementId = null; // Overriding functions which cause the user card to show/hide based on mouse/keyboard events: - cleanUp() {}, + cleanUp() {} // eslint-disable-next-line ember/require-super-in-lifecycle-hooks - didInsertElement() {}, + didInsertElement() {} // eslint-disable-next-line ember/require-super-in-lifecycle-hooks - willDestroyElement() {}, - keyUp() {}, + willDestroyElement() {} + keyUp() {} // need to override this to work with the loading slider @action handleShowUser() { return; - }, -}); + } +}