From 57d51a40507feda9521a3d23b6c6d5ba93d43660 Mon Sep 17 00:00:00 2001 From: ryv-odoo Date: Mon, 5 Aug 2019 08:55:05 +0000 Subject: [PATCH 1/6] [FIX] website_rating: correctly take into account rating ratio in frontend PURPOSE Fix frontend rating and clean a bit module organization SPECIFICATIONS Currently when updating a review on slides, the rating value is divided by 2 on each update as the rating ratio is not taken into account. In this commit we correctly update the hidden input value during the start function using the rating ratio. LINKS Task 2057301 PR #35870 --- addons/website_rating/static/src/js/website_mail.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_rating/static/src/js/website_mail.js b/addons/website_rating/static/src/js/website_mail.js index 5b4f1b04f70..38c885f287c 100644 --- a/addons/website_rating/static/src/js/website_mail.js +++ b/addons/website_rating/static/src/js/website_mail.js @@ -67,7 +67,10 @@ PortalComposer.include({ // rating stars self.$input = self.$('input[name="rating_value"]'); self.$star_list = self.$('.stars').find('i'); - self.set("star_value", self.options.default_rating_value); // set the default value to trigger the display of star widget + + // set the default value to trigger the display of star widget and update the hidden input value. + self.set("star_value", self.options.default_rating_value); + self.$input.val(self.options.default_rating_value * STAR_RATING_RATIO); }); }, From 226e21c403a0bd7a44accfe7c24085585dffc85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 21 Aug 2019 09:11:38 +0000 Subject: [PATCH 2/6] [IMP] website mail: remove useless public channel data PURPOSE Fix frontend rating and clean a bit module organization SPECIFICATIONS Remove useless mail.channel data as it makes noise without any added value. LINKS Task 2057301 PR #35870 --- addons/website_mail/__manifest__.py | 1 - addons/website_mail/data/mail_channel_data.xml | 14 -------------- 2 files changed, 15 deletions(-) delete mode 100644 addons/website_mail/data/mail_channel_data.xml diff --git a/addons/website_mail/__manifest__.py b/addons/website_mail/__manifest__.py index 45571be05b3..a607382a998 100644 --- a/addons/website_mail/__manifest__.py +++ b/addons/website_mail/__manifest__.py @@ -13,7 +13,6 @@ It is responsible of comments moderation for published documents (forum, slides, 'depends': ['website', 'mail'], 'data': [ 'views/website_mail_templates.xml', - 'data/mail_channel_data.xml', 'security/website_mail_security.xml', ], 'qweb': [ diff --git a/addons/website_mail/data/mail_channel_data.xml b/addons/website_mail/data/mail_channel_data.xml deleted file mode 100644 index 785a7aefd77..00000000000 --- a/addons/website_mail/data/mail_channel_data.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Discussion Group - public - Public Discussion Group - - - - - - From 241453aaecfdd8e18aa3fe477cbc28c3f22601e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 21 Aug 2019 09:09:31 +0000 Subject: [PATCH 3/6] [MOV] website_mail: rename portal related files PURPOSE Fix frontend rating and clean a bit module organization SPECIFICATIONS In order to ease understanding of portal chatter dependencies let us name files according to guidelines. In this commit we rename a bit files in website mail to understand which widgets and portal parts are impacted by website mail bridge module. Assets are also moved in their own file to ease module discovering. LINKS Task 2057301 PR #35870 --- addons/website_mail/__manifest__.py | 4 +--- .../src/js/{website_mail.js => portal_chatter.js} | 2 +- .../src/xml/{website_mail.xml => portal_chatter.xml} | 0 addons/website_mail/views/assets.xml | 10 ++++++++++ addons/website_mail/views/website_mail_templates.xml | 9 --------- 5 files changed, 12 insertions(+), 13 deletions(-) rename addons/website_mail/static/src/js/{website_mail.js => portal_chatter.js} (81%) rename addons/website_mail/static/src/xml/{website_mail.xml => portal_chatter.xml} (100%) create mode 100644 addons/website_mail/views/assets.xml diff --git a/addons/website_mail/__manifest__.py b/addons/website_mail/__manifest__.py index a607382a998..fb4dc268da2 100644 --- a/addons/website_mail/__manifest__.py +++ b/addons/website_mail/__manifest__.py @@ -12,12 +12,10 @@ It is responsible of comments moderation for published documents (forum, slides, """, 'depends': ['website', 'mail'], 'data': [ + 'views/assets.xml', 'views/website_mail_templates.xml', 'security/website_mail_security.xml', ], - 'qweb': [ - 'static/src/xml/website_mail.xml' - ], 'installable': True, 'auto_install': True, } diff --git a/addons/website_mail/static/src/js/website_mail.js b/addons/website_mail/static/src/js/portal_chatter.js similarity index 81% rename from addons/website_mail/static/src/js/website_mail.js rename to addons/website_mail/static/src/js/portal_chatter.js index 473ed4b4128..923c17032fe 100644 --- a/addons/website_mail/static/src/js/website_mail.js +++ b/addons/website_mail/static/src/js/portal_chatter.js @@ -8,6 +8,6 @@ var portalChatter = require('portal.chatter'); */ portalChatter.PortalChatter.include({ xmlDependencies: (portalChatter.PortalChatter.prototype.xmlDependencies || []) - .concat(['/website_mail/static/src/xml/website_mail.xml']), + .concat(['/website_mail/static/src/xml/portal_chatter.xml']), }); }); diff --git a/addons/website_mail/static/src/xml/website_mail.xml b/addons/website_mail/static/src/xml/portal_chatter.xml similarity index 100% rename from addons/website_mail/static/src/xml/website_mail.xml rename to addons/website_mail/static/src/xml/portal_chatter.xml diff --git a/addons/website_mail/views/assets.xml b/addons/website_mail/views/assets.xml new file mode 100644 index 00000000000..30d581cf4a4 --- /dev/null +++ b/addons/website_mail/views/assets.xml @@ -0,0 +1,10 @@ + + + + diff --git a/addons/website_mail/views/website_mail_templates.xml b/addons/website_mail/views/website_mail_templates.xml index cf13c79bc04..856af90ca93 100644 --- a/addons/website_mail/views/website_mail_templates.xml +++ b/addons/website_mail/views/website_mail_templates.xml @@ -16,13 +16,4 @@ - - - From d6ac39c6c30dfc18c20f8e9d85c4b9592075199b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 21 Aug 2019 12:30:47 +0000 Subject: [PATCH 4/6] [IMP] website_rating: remove useless templates PURPOSE Fix frontend rating and clean a bit module organization SPECIFICATIONS Remove unused template to lessen noise in this module. LINKS Task 2057301 PR #35870 --- .../views/website_rating_templates.xml | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/addons/website_rating/views/website_rating_templates.xml b/addons/website_rating/views/website_rating_templates.xml index aedfb2f9631..2b7bfbcabd6 100644 --- a/addons/website_rating/views/website_rating_templates.xml +++ b/addons/website_rating/views/website_rating_templates.xml @@ -14,30 +14,6 @@ - - - @@ -37,57 +36,4 @@ - - - - -
-
- - - - - - ( ratings) - -
- -
- -