From d5d93bdf054b5fbbfabc8466c8c067b7e1ae4bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Wed, 22 Sep 2021 08:37:37 +0000 Subject: [PATCH] [FIX] mail: remove webRTC component excessive getters X-original-commit: 9bf4b6c29207b97368f27098df3cfbe79e2b5f0f Part-of: odoo/odoo#77107 --- .../rtc_activity_notice.js | 13 +------ .../rtc_activity_notice.xml | 6 +-- .../rtc_call_viewer/rtc_call_viewer.js | 14 ------- .../rtc_call_viewer/rtc_call_viewer.xml | 4 +- .../rtc_configuration_menu.js | 28 +++----------- .../rtc_configuration_menu.xml | 22 +++++------ .../rtc_controller/rtc_controller.js | 14 ------- .../rtc_controller/rtc_controller.xml | 38 +++++++++---------- .../rtc_invitations/rtc_invitations.js | 15 +------- .../rtc_invitations/rtc_invitations.xml | 4 +- 10 files changed, 44 insertions(+), 114 deletions(-) diff --git a/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.js b/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.js index 404440e3069..a5c947bc88d 100644 --- a/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.js +++ b/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.js @@ -6,17 +6,6 @@ const { Component } = owl; export class RtcActivityNotice extends Component { - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - - /** - * @returns {mail.thread|undefined} - */ - get thread() { - return this.messaging && this.messaging.mailRtc.channel; - } - //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- @@ -26,7 +15,7 @@ export class RtcActivityNotice extends Component { * @param {MouseEvent} ev */ _onClick(ev) { - this.thread.open(); + this.messaging.mailRtc.channel.open(); } } diff --git a/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.xml b/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.xml index bdbcf29b983..23aa4cc6975 100644 --- a/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.xml +++ b/addons/mail/static/src/components/rtc_activity_notice/rtc_activity_notice.xml @@ -4,11 +4,11 @@
  • - - Open conference: + + Open conference:
    - + - - + +
    diff --git a/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.js b/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.js index 32324646162..aa05c9938a7 100644 --- a/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.js +++ b/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.js @@ -23,24 +23,6 @@ export class RtcConfigurationMenu extends Component { this.state.userDevices = await browser.navigator.mediaDevices.enumerateDevices(); } - //-------------------------------------------------------------------------- - // Getters / Setters - //-------------------------------------------------------------------------- - - /** - * @returns {mail.configuration_menu} - */ - get rtcConfigurationMenu() { - return this.messaging && this.messaging.userSetting.rtcConfigurationMenu; - } - - /** - * @returns {mail.user_setting} - */ - get userSetting() { - return this.messaging && this.messaging.userSetting; - } - //-------------------------------------------------------------------------- // Handlers //-------------------------------------------------------------------------- @@ -50,7 +32,7 @@ export class RtcConfigurationMenu extends Component { * @param {Event} ev */ _onChangeDelay(ev) { - this.rtcConfigurationMenu.onChangeDelay(ev.target.value); + this.messaging.rtcConfigurationMenu.onChangeDelay(ev.target.value); } /** @@ -58,7 +40,7 @@ export class RtcConfigurationMenu extends Component { * @param {Event} ev */ _onChangePushToTalk(ev) { - this.rtcConfigurationMenu.onChangePushToTalk(); + this.messaging.rtcConfigurationMenu.onChangePushToTalk(); } /** @@ -66,7 +48,7 @@ export class RtcConfigurationMenu extends Component { * @param {Event} ev */ _onChangeSelectAudioInput(ev) { - this.rtcConfigurationMenu.onChangeSelectAudioInput(ev.target.value); + this.messaging.rtcConfigurationMenu.onChangeSelectAudioInput(ev.target.value); } /** @@ -74,7 +56,7 @@ export class RtcConfigurationMenu extends Component { * @param {Event} ev */ _onChangeThreshold(ev) { - this.rtcConfigurationMenu.onChangeThreshold(ev.target.value); + this.messaging.rtcConfigurationMenu.onChangeThreshold(ev.target.value); } /** @@ -82,7 +64,7 @@ export class RtcConfigurationMenu extends Component { * @param {MouseEvent} ev */ _onClickRegisterKeyButton() { - this.rtcConfigurationMenu.onClickRegisterKeyButton(); + this.messaging.rtcConfigurationMenu.onClickRegisterKeyButton(); } } diff --git a/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.xml b/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.xml index da961426636..5cc1d2b9c5d 100644 --- a/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.xml +++ b/addons/mail/static/src/components/rtc_configuration_menu/rtc_configuration_menu.xml @@ -7,7 +7,7 @@