diff --git a/addons/mail/static/src/web/chatter.js b/addons/mail/static/src/web/chatter.js index b278b7e64ae..685aedbcd3d 100644 --- a/addons/mail/static/src/web/chatter.js +++ b/addons/mail/static/src/web/chatter.js @@ -8,6 +8,7 @@ import { Composer } from "../composer/composer"; import { Activity } from "@mail/web/activity/activity"; import { Component, + markup, onMounted, onPatched, onWillStart, @@ -24,6 +25,7 @@ import { useAttachmentUploader } from "@mail/attachments/attachment_uploader_hoo import { useHover, useScrollPosition } from "@mail/utils/hooks"; import { FollowerSubtypeDialog } from "./follower_subtype_dialog"; import { _t } from "@web/core/l10n/translation"; +import { escape, sprintf } from "@web/core/utils/strings"; import { SuggestedRecipientsList } from "./suggested_recipient_list"; /** @@ -177,6 +179,24 @@ export class Chatter extends Component { return this.state.thread?.attachments ?? []; } + /** + * @returns {string} + */ + get toFollowersText() { + const threadName = this.state.thread.displayName || this.state.thread.name; + const toFollowersText = threadName + ? sprintf( + _t( + 'To: Followers of "%(thread name)s".' + ), + { "thread name": escape(threadName) } + ) + : _t( + 'To: Followers of this document.' + ); + return markup(toFollowersText); + } + /** * @param {number} threadId * @param {['activities'|'followers'|'attachments'|'messages'|'suggestedRecipients']} requestList diff --git a/addons/mail/static/src/web/chatter.xml b/addons/mail/static/src/web/chatter.xml index 110bce5e43b..afa376ff750 100644 --- a/addons/mail/static/src/web/chatter.xml +++ b/addons/mail/static/src/web/chatter.xml @@ -74,17 +74,7 @@ -
- To: Followers of - - - "" - - - this document - - -
+
Send a message to followers... Log an internal note...