From 560e6ed4fd83986df64603aa263b87b054f7b1a9 Mon Sep 17 00:00:00 2001 From: "Thomas Josse (thjo)" Date: Wed, 5 Jul 2023 11:09:31 +0200 Subject: [PATCH] [IMP] mail: adds new props and buttons to handle comment Threads This commit adds new optional props to the Message and Thread Components: closeThread, openThread, avatarPlaceholder and showDates. * `closeThread` is a function that enables the user to close an active comment thread. * `openThread` is a function that reopens a previously closed thread. * `avatarPlaceholder` is a boolean that will add an avatar placeholder (fa-user icon) when needed. For example when using Knowledge via the portal. * `showDates` enables us to hide the dates showed inside the Thread component, it may not be useful for certain comment threads. We also added a button inside the actionBox in the Message Component and it is only rendered if we are on the first message of the thread. The button can trigger either of the new function props depending on what is provided to the component. task-3317056 closes odoo/odoo#127380 Related: odoo/enterprise#41951 Signed-off-by: Thibault Delavallee (tde) --- addons/mail/static/src/core/common/composer.js | 6 +++++- addons/mail/static/src/core/common/composer.xml | 2 +- addons/mail/static/src/core/common/message.js | 3 +++ addons/mail/static/src/core/common/message.xml | 6 +++--- addons/mail/static/src/core/common/thread.js | 8 ++++++++ addons/mail/static/src/core/common/thread.xml | 13 ++++++++----- addons/mail/static/src/views/web/composer_patch.js | 2 +- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/addons/mail/static/src/core/common/composer.js b/addons/mail/static/src/core/common/composer.js index 91d68d0e075..f2bd6cbb62b 100644 --- a/addons/mail/static/src/core/common/composer.js +++ b/addons/mail/static/src/core/common/composer.js @@ -58,6 +58,8 @@ export class Composer extends Component { mode: "normal", className: "", sidebar: true, + showFullComposer: true, + allowUpload: true }; static props = [ "composer", @@ -73,6 +75,8 @@ export class Composer extends Component { "className?", "sidebar?", "type?", + "showFullComposer?", + "allowUpload?" ]; static template = "mail.Composer"; @@ -233,7 +237,7 @@ export class Composer extends Component { } get allowUpload() { - return true; + return this.props.allowUpload; } get message() { diff --git a/addons/mail/static/src/core/common/composer.xml b/addons/mail/static/src/core/common/composer.xml index a63f9339813..34baf398fac 100644 --- a/addons/mail/static/src/core/common/composer.xml +++ b/addons/mail/static/src/core/common/composer.xml @@ -78,7 +78,7 @@ -