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 @@ - + - + - + - +