From 85e5070064d519229e0fe270372ed08f0d214615 Mon Sep 17 00:00:00 2001 From: Denis Mudarisov Date: Tue, 22 Dec 2020 10:11:51 +0500 Subject: [PATCH] :rainbow: pre-commit --- .github/workflows/DINAR-PORT.yml | 8 ++--- mail_to/doc/changelog.rst | 2 +- mail_to/static/src/js/mail_to.js | 51 +++++++++++++-------------- mail_to/static/src/js/test_mail_to.js | 2 +- mail_to/static/src/xml/recipient.xml | 24 +++++++------ 5 files changed, 45 insertions(+), 42 deletions(-) diff --git a/.github/workflows/DINAR-PORT.yml b/.github/workflows/DINAR-PORT.yml index 2bbd3e7..88486e7 100644 --- a/.github/workflows/DINAR-PORT.yml +++ b/.github/workflows/DINAR-PORT.yml @@ -96,7 +96,7 @@ jobs: --no-commit \ 2> $LOG_FILE || true cat $LOG_FILE - + # remove colors sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE # escape character @@ -104,9 +104,9 @@ jobs: body=$(cat $LOG_FILE) body="${body//'%'/'%25'}" body="${body//$'\n'/'%0A'}" - body="${body//$'\r'/'%0D'}" + body="${body//$'\r'/'%0D'}" echo "MIGRATOR_LOGS=$body" >> $GITHUB_ENV - + git add -A git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator @@ -137,7 +137,7 @@ jobs: number: ${{ steps.cpr.outputs.pull-request-number }} comment: | [Migrator](https://github.com/OCA/odoo-module-migrator/)'s logs: - + ``` ${{ env.MIGRATOR_LOGS }} ``` diff --git a/mail_to/doc/changelog.rst b/mail_to/doc/changelog.rst index 2aa1cf0..6b97eb6 100644 --- a/mail_to/doc/changelog.rst +++ b/mail_to/doc/changelog.rst @@ -1,7 +1,7 @@ `1.1.2` ------- -- **Fix** if open the pop-up chat window and reload the page, then an error might occur randomly +- **Fix:** if open the pop-up chat window and reload the page, then an error might occur randomly `1.1.1` ------- diff --git a/mail_to/static/src/js/mail_to.js b/mail_to/static/src/js/mail_to.js index 01befa3..caeca64 100644 --- a/mail_to/static/src/js/mail_to.js +++ b/mail_to/static/src/js/mail_to.js @@ -4,40 +4,39 @@ * Copyright 2019 Artem Rafailov * Copyright 2020 Denis Mudarisov * License MIT (https://opensource.org/licenses/MIT). */ -odoo.define("mail_to.MailTo", function(require) { +odoo.define("mail_to.MailTo", function (require) { "use strict"; var chat_manager = require("mail_base.base").chat_manager; - chat_manager.is_ready = chat_manager.is_ready.then(function(){ - - var make_message_super = chat_manager.make_message; - chat_manager.make_message = function(data) { - var msg = make_message_super.call(this, data); - msg.partner_ids = data.partner_ids; - msg.channel_names = data.channel_names; - msg.recipients = (data.partner_ids || []).concat(data.channel_names); - if (!msg.partner_ids && !msg.channel_names) { - return msg; - } + chat_manager.is_ready = chat_manager.is_ready.then(function () { + var make_message_super = chat_manager.make_message; + chat_manager.make_message = function (data) { + var msg = make_message_super.call(this, data); + msg.partner_ids = data.partner_ids; + msg.channel_names = data.channel_names; + msg.recipients = (data.partner_ids || []).concat(data.channel_names); + if (!msg.partner_ids && !msg.channel_names) { + return msg; + } - var more_recipients = ""; - // Value which define more recipients - msg.more_recipients_value = 4; - for (var i = 0; i < msg.recipients.length; i++) { - if (i >= msg.more_recipients_value) { - // Append names - more_recipients += msg.recipients[i][1]; - // Separate them with semicolon - if (i < msg.recipients.length - 1) { - more_recipients += "; "; + var more_recipients = ""; + // Value which define more recipients + msg.more_recipients_value = 4; + for (var i = 0; i < msg.recipients.length; i++) { + if (i >= msg.more_recipients_value) { + // Append names + more_recipients += msg.recipients[i][1]; + // Separate them with semicolon + if (i < msg.recipients.length - 1) { + more_recipients += "; "; + } } } - } - msg.more_recipients = more_recipients; - return msg; - }; + msg.more_recipients = more_recipients; + return msg; + }; }); return chat_manager; diff --git a/mail_to/static/src/js/test_mail_to.js b/mail_to/static/src/js/test_mail_to.js index 95db0a8..9c164df 100644 --- a/mail_to/static/src/js/test_mail_to.js +++ b/mail_to/static/src/js/test_mail_to.js @@ -1,6 +1,6 @@ /* Copyright 2018 Artem Rafailov License MIT (https://opensource.org/licenses/MIT).*/ -odoo.define("mail_to.tour", function(require) { +odoo.define("mail_to.tour", function (require) { "use strict"; var tour = require("web_tour.tour"); diff --git a/mail_to/static/src/xml/recipient.xml b/mail_to/static/src/xml/recipient.xml index feccf3c..fab8882 100644 --- a/mail_to/static/src/xml/recipient.xml +++ b/mail_to/static/src/xml/recipient.xml @@ -8,8 +8,8 @@ - To: - To: + To: + To: - ; + ; ; + > + ; + @@ -35,9 +37,9 @@ class="recipient_link" > - ; + + ; + @@ -46,10 +48,12 @@ t-if="message.recipients.length > message.more_recipients_value" > - and more - + /> + more +