From b88ecba36f36c073087c237dcd9f359bed622f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 26 Oct 2023 14:54:20 +0200 Subject: [PATCH] [IMP] mail: improve label of button to toggle style of email message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, when a message is of type email, the button to toggle between adjusted content style with webclient theme and the original email style was labelled "Show Original Email" and "Don't show original Email". This label is confusing, as it gives the impression that this button opens a new screen or removes a UI element. This button only alters the visual of the message, that is the style, so the label should be better worded to tell that. This commit rename the label to "Show Original/Custom Format", so that it's clearer what this button actually does. closes odoo/odoo#139901 Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/core/common/message.js | 14 ++++---------- addons/mail/static/src/core/common/message.scss | 2 +- addons/mail/static/src/core/common/message.xml | 5 ++++- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/addons/mail/static/src/core/common/message.js b/addons/mail/static/src/core/common/message.js index 54b3722a351..ca1a0187464 100644 --- a/addons/mail/static/src/core/common/message.js +++ b/addons/mail/static/src/core/common/message.js @@ -86,7 +86,7 @@ export class Message extends Component { "messageSearch?", "className?", "showDates?", - "isFirstMessage?" + "isFirstMessage?", ]; static template = "mail.Message"; @@ -102,7 +102,7 @@ export class Message extends Component { isHovered: false, isClicked: false, expandOptions: false, - originalEmail: false, + originalFormat: false, emailHeaderOpen: false, showTranslation: false, }); @@ -137,13 +137,13 @@ export class Message extends Component { if (!this.shadowRoot) { return; } - if (this.state.originalEmail) { + if (this.state.originalFormat) { this.shadowRoot.removeChild(this.shadowStyle); } else { this.shadowRoot.insertBefore(this.shadowStyle, this.shadowRoot.firstChild); } }, - () => [this.state.originalEmail] + () => [this.state.originalFormat] ); onPatched(() => { if (this.props.highlighted && this.root.el) { @@ -387,12 +387,6 @@ export class Message extends Component { }); } - get originalEmailText() { - return this.state.originalEmail - ? _t("Don't show Original Email") - : _t("Show Original Email"); - } - /** * @param {MouseEvent} ev */ diff --git a/addons/mail/static/src/core/common/message.scss b/addons/mail/static/src/core/common/message.scss index 62b3e207383..8f8242901df 100644 --- a/addons/mail/static/src/core/common/message.scss +++ b/addons/mail/static/src/core/common/message.scss @@ -59,7 +59,7 @@ z-index: $o-mail-NavigableList-zIndex; } -.o-mail-Message-originalEmailText { +.o-mail-Message-originalFormat { line-height: 1; &:hover { diff --git a/addons/mail/static/src/core/common/message.xml b/addons/mail/static/src/core/common/message.xml index 2095c5a4c3f..8b8f72d401a 100644 --- a/addons/mail/static/src/core/common/message.xml +++ b/addons/mail/static/src/core/common/message.xml @@ -90,7 +90,10 @@ }" t-ref="body"> - Subject: