From 45818cc1aa0d205e178de1308f801b3ce540aedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Mon, 28 Sep 2020 16:26:20 +0000 Subject: [PATCH] [FIX] mail: fix tour to allow public or private channel selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit task-2313321 closes odoo/odoo#58838 X-original-commit: 07ef748c542cb20fdab4f0d9c02a87fb07bede3c Signed-off-by: Sébastien Theys (seb) Signed-off-by: Alexandre Kühn (aku) --- addons/mail/i18n/mail.pot | 7 +++++++ .../components/autocomplete_input/autocomplete_input.js | 1 - .../src/components/discuss_sidebar/discuss_sidebar.js | 7 +++++++ .../src/components/discuss_sidebar/discuss_sidebar.xml | 3 ++- addons/mail/static/src/components/message/message.scss | 8 ++++---- addons/mail/static/src/js/tours/mail.js | 9 ++++++--- addons/test_mail/tests/__init__.py | 1 + 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/addons/mail/i18n/mail.pot b/addons/mail/i18n/mail.pot index 18e8cedb4b4..9489e3bed9d 100644 --- a/addons/mail/i18n/mail.pot +++ b/addons/mail/i18n/mail.pot @@ -202,6 +202,13 @@ msgstr "" msgid "

Create a channel here.

" msgstr "" +#. module: mail +#. openerp-web +#: code:addons/mail/static/src/js/tours/mail.js:0 +#, python-format +msgid "

Create a public or private channel.

" +msgstr "" + #. module: mail #: model_terms:ir.ui.view,arch_db:mail.email_compose_message_wizard_form msgid "" diff --git a/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js b/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js index 1e383f7b307..e9bb5286ee2 100644 --- a/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js +++ b/addons/mail/static/src/components/autocomplete_input/autocomplete_input.js @@ -89,7 +89,6 @@ class AutocompleteInput extends Component { * @param {Object} ui */ _onAutocompleteSelect(ev, ui) { - ev.stopPropagation(); if (this.props.select) { this.props.select(ev, ui); } diff --git a/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.js b/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.js index 11737fa04dc..d5eaf72618d 100644 --- a/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.js +++ b/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.js @@ -54,6 +54,13 @@ class DiscussSidebar extends Component { return this.env.messaging && this.env.messaging.discuss; } + /** + * @returns {string} + */ + get FIND_OR_CREATE_CHANNEL() { + return this.env._t("Find or create a channel..."); + } + /** * @returns {mail.thread[]} */ diff --git a/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.xml b/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.xml index ac4ac02bd46..4f9c10e5de2 100644 --- a/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.xml +++ b/addons/mail/static/src/components/discuss_sidebar/discuss_sidebar.xml @@ -28,9 +28,10 @@
p:last-of-type { margin-bottom: 0; @@ -54,8 +54,8 @@ } .o_Message_core { + min-width: 0; // allows this flex child to shrink more than its content margin-inline-end: map-get($spacers, 3); - overflow: auto; } .o_Message_footer { diff --git a/addons/mail/static/src/js/tours/mail.js b/addons/mail/static/src/js/tours/mail.js index b37ed70751f..552df7ea0d5 100644 --- a/addons/mail/static/src/js/tours/mail.js +++ b/addons/mail/static/src/js/tours/mail.js @@ -22,9 +22,12 @@ tour.register('mail_tour', { actions.text("SomeChannel_" + t, this.$anchor); }, }, { - trigger: ".ui-autocomplete .ui-menu-item > a:contains(Create):has(.fa-lock)", - content: _t("

Create a private channel.

"), - position: 'bottom', + trigger: ".o_DiscussSidebar_newChannelAutocompleteSuggestions", + content: _t("

Create a public or private channel.

"), + position: 'right', + run() { + this.$consumeEventAnchors.find('li:first').click(); + }, }, { trigger: '.o_Discuss_thread .o_ComposerTextInput_textarea', content: _t("

Write a message to the members of the channel here.

You can notify someone with '@' or link another channel with '#'. Start your message with '/' to get the list of possible commands.

"), diff --git a/addons/test_mail/tests/__init__.py b/addons/test_mail/tests/__init__.py index 3aac76d3df9..02ebd701f5c 100644 --- a/addons/test_mail/tests/__init__.py +++ b/addons/test_mail/tests/__init__.py @@ -15,3 +15,4 @@ from . import test_message_management from . import test_message_post from . import test_message_track from . import test_performance +from . import test_ui