From fca6805aca495a052c640ff8e145dd519a01e119 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 1 Dec 2022 15:32:22 +0100 Subject: [PATCH] UX: removes silence from chat message actions (#19282) --- .../discourse/components/chat-message.js | 23 ------------------- .../test/javascripts/acceptance/chat-test.js | 20 ---------------- 2 files changed, 43 deletions(-) diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-message.js b/plugins/chat/assets/javascripts/discourse/components/chat-message.js index 52908dd15d..27d951316a 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-message.js +++ b/plugins/chat/assets/javascripts/discourse/components/chat-message.js @@ -213,14 +213,6 @@ export default Component.extend({ }); } - if (this.showSilenceButton) { - buttons.push({ - id: "silence", - name: I18n.t("chat.silence"), - icon: "microphone-slash", - }); - } - if (this.showDeleteButton) { buttons.push({ id: "deleteMessage", @@ -256,7 +248,6 @@ export default Component.extend({ edit: this.edit, selectMessage: this.selectMessage, flag: this.flag, - silence: this.silence, deleteMessage: this.deleteMessage, restore: this.restore, rebakeMessage: this.rebakeMessage, @@ -393,15 +384,6 @@ export default Component.extend({ ); }, - @discourseComputed("message") - showSilenceButton(message) { - return ( - this.currentUser?.staff && - this.currentUser?.id !== message.user?.id && - !message.chat_webhook_event - ); - }, - @discourseComputed("message") canManageDeletion(message) { return this.currentUser?.id === message.user?.id @@ -693,11 +675,6 @@ export default Component.extend({ } }, - @action - silence() { - this.adminTools.showSilenceModal(EmberObject.create(this.message.user)); - }, - @action expand() { this.message.set("expanded", true); diff --git a/plugins/chat/test/javascripts/acceptance/chat-test.js b/plugins/chat/test/javascripts/acceptance/chat-test.js index ee1093255f..a578bed813 100644 --- a/plugins/chat/test/javascripts/acceptance/chat-test.js +++ b/plugins/chat/test/javascripts/acceptance/chat-test.js @@ -236,21 +236,6 @@ acceptance("Discourse Chat - without unread", function (needs) { currentUserDropdown.rowByValue("rebakeMessage").exists(), "it shows the rebake button" ); - - assert.notOk( - currentUserDropdown.rowByValue("silence").exists(), - "it hides the silence button" - ); - - const notCurrentUserDropdown = selectKit( - ".chat-message-actions-container[data-id='175'] .more-buttons" - ); - await triggerEvent(".chat-message-container[data-id='175']", "mouseenter"); - await notCurrentUserDropdown.expand(); - assert.ok( - notCurrentUserDropdown.rowByValue("silence").exists(), - "it shows the silence button" - ); }); test("Message controls are present and correct for permissions", async function (assert) { @@ -288,11 +273,6 @@ acceptance("Discourse Chat - without unread", function (needs) { "it hides the flag button" ); - assert.notOk( - currentUserDropdown.rowByValue("silence").exists(), - "it hides the silence button" - ); - assert.ok( currentUserDropdown.rowByValue("deleteMessage").exists(), "it shows the delete button"