From 68ef0cd276a5390a84f630d92f3385edf878ad2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 28 Mar 2022 14:07:59 +0000 Subject: [PATCH] [IMP] mail: remove ComposerSuggestionComponent/is getters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-2793280 closes odoo/odoo#87735 Signed-off-by: Alexandre Kühn (aku) --- .../composer_suggestion.js | 24 ++++--------------- .../composer_suggestion.xml | 8 +++---- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/addons/mail/static/src/components/composer_suggestion/composer_suggestion.js b/addons/mail/static/src/components/composer_suggestion/composer_suggestion.js index 3a803f395f8..fad357f3d4f 100644 --- a/addons/mail/static/src/components/composer_suggestion/composer_suggestion.js +++ b/addons/mail/static/src/components/composer_suggestion/composer_suggestion.js @@ -34,22 +34,6 @@ export class ComposerSuggestion extends Component { return this.messaging && this.messaging.models['ComposerView'].get(this.props.composerViewLocalId); } - get isCannedResponse() { - return this.props.modelName === "CannedResponse"; - } - - get isChannel() { - return this.props.modelName === "Thread"; - } - - get isCommand() { - return this.props.modelName === "ChannelCommand"; - } - - get isPartner() { - return this.props.modelName === "Partner"; - } - get record() { return this.messaging && this.messaging.models[this.props.modelName].get(this.props.recordLocalId); } @@ -61,16 +45,16 @@ export class ComposerSuggestion extends Component { * @returns {string} */ title() { - if (this.isCannedResponse) { + if (this.composerSuggestion.cannedResponse) { return _.str.sprintf("%s: %s", this.record.source, this.record.substitution); } - if (this.isChannel) { + if (this.composerSuggestion.thread) { return this.record.name; } - if (this.isCommand) { + if (this.composerSuggestion.channelCommand) { return _.str.sprintf("%s: %s", this.record.name, this.record.help); } - if (this.isPartner) { + if (this.composerSuggestion.partner) { if (this.record.email) { return _.str.sprintf("%s (%s)", this.record.nameOrDisplayName, this.record.email); } diff --git a/addons/mail/static/src/components/composer_suggestion/composer_suggestion.xml b/addons/mail/static/src/components/composer_suggestion/composer_suggestion.xml index 03890b557ee..7da4adc27ed 100644 --- a/addons/mail/static/src/components/composer_suggestion/composer_suggestion.xml +++ b/addons/mail/static/src/components/composer_suggestion/composer_suggestion.xml @@ -4,18 +4,18 @@ - + - + - + - +