From 80af1c3d6582bea9577e87c2fd982a3e2bf6e57a Mon Sep 17 00:00:00 2001 From: thsh-odoo Date: Fri, 9 Jun 2023 10:59:32 +0000 Subject: [PATCH] [FIX] mail: add more menu for rtc buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit revert the changes from this PR https://github.com/odoo/odoo/pull/127377 Before this commit: Chat window shows all 7 rtc buttons due to this the alignment of the button is not set because there are way too many buttons. After this commit: This commit fixes the issue by showing only 5 buttons Mute,Deafen,Video,More, Close call and other 3 buttons will moved in expandable More menu. The testcases were changed accordingly. Task-3346085 closes odoo/odoo#129360 X-original-commit: 909fb073eada42ff22c4ef4b20b44dc5536b250e Signed-off-by: Alexandre Kühn (aku) --- .../static/src/discuss/call/common/call.xml | 2 +- .../discuss/call/common/call_action_list.js | 42 ++++++++++ .../discuss/call/common/call_action_list.xml | 78 ++++++------------- .../static/tests/discuss/call/call_tests.js | 16 ++-- 4 files changed, 76 insertions(+), 62 deletions(-) diff --git a/addons/mail/static/src/discuss/call/common/call.xml b/addons/mail/static/src/discuss/call/common/call.xml index 7b294a1b16b..7d721effc0c 100644 --- a/addons/mail/static/src/discuss/call/common/call.xml +++ b/addons/mail/static/src/discuss/call/common/call.xml @@ -25,7 +25,7 @@
-
+
diff --git a/addons/mail/static/src/discuss/call/common/call_action_list.js b/addons/mail/static/src/discuss/call/common/call_action_list.js index 290dc50dd88..6104ec148d1 100644 --- a/addons/mail/static/src/discuss/call/common/call_action_list.js +++ b/addons/mail/static/src/discuss/call/common/call_action_list.js @@ -5,8 +5,12 @@ import { useRtc } from "@mail/discuss/call/common/rtc_hook"; import { Component } from "@odoo/owl"; import { isMobileOS } from "@web/core/browser/feature_detection"; +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { _t } from "@web/core/l10n/translation"; export class CallActionList extends Component { + static components = { Dropdown, DropdownItem }; static props = ["thread", "fullscreen", "compact?"]; static template = "discuss.CallActionList"; @@ -14,6 +18,44 @@ export class CallActionList extends Component { this.rtc = useRtc(); } + get MORE() { + return _t("More"); + } + + get moreActions() { + const acts = []; + acts.push({ + id: "raiseHand", + name: !this.rtc.state?.selfSession.raisingHand ? _t("Raise Hand") : _t("Lower Hand"), + icon: "fa fa-fw fa-hand-paper-o", + onSelect: (ev) => this.onClickRaiseHand(ev), + }); + if (isMobileOS) { + acts.push({ + id: "shareScreen", + name: !this.rtc.state.sendScreen ? _t("Share Screen") : _t("Stop Sharing Screen"), + icon: "fa fa-fw fa-desktop", + onSelect: () => this.rtc.toggleVideo("screen"), + }); + } + if (!this.props.fullscreen.isActive) { + acts.push({ + id: "fullScreen", + name: _t("Enter Full Screen"), + icon: "fa fa-fw fa-arrows-alt", + onSelect: () => this.props.fullscreen.enter(), + }); + } else { + acts.push({ + id: "exitFullScreen", + name: _t("Exit Full Screen"), + icon: "fa fa-fw fa-compress", + onSelect: () => this.props.fullscreen.exit(), + }); + } + return acts; + } + get isOfActiveCall() { return Boolean(this.props.thread.id === this.rtc.state?.channel?.id); } diff --git a/addons/mail/static/src/discuss/call/common/call_action_list.xml b/addons/mail/static/src/discuss/call/common/call_action_list.xml index 5e675ae7ff4..d7b2248e31e 100644 --- a/addons/mail/static/src/discuss/call/common/call_action_list.xml +++ b/addons/mail/static/src/discuss/call/common/call_action_list.xml @@ -7,8 +7,8 @@ Unmute Mute - Undeafen Deafen -
- Lower hand - Raise hand - Stop camera Turn camera on - - Stop screen sharing - Share screen - - - + + +
+ +
+
+ + + + + + +
-