summaryrefslogtreecommitdiff
path: root/addons/website_links/static/src/js
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2019-02-28 14:19:22 +0000
committerRomain Derie <rde@odoo.com>2019-03-18 13:54:11 +0000
commitd0cd971afb518f449ab6c60cef33e6fe0b7ea1f9 (patch)
tree8dd47189803e53b5bdee0f3ef86691bcc6c95cab /addons/website_links/static/src/js
parentfd97b5b12a5c0ed9525f11efef98c37a6c302017 (diff)
[FIX] website_links: fix remaining bugs and restore skipped test
This commit is following c78da8a80 that fixed website_links module. We had to merge it with a skipped test as there was an error only appearing with Docker (on runbot or on local with Docker). This commit fix that test error and some other remaining bugs not found during the first fix: 1. Fix the test error by adding a step to show recently used links. Indeed the bug was that newest links would return inconsistent order as both 2 links created during the steps have the same creation date. On runbot it would click on the wrong link, the one which has 0 clicks. Then JS would crash (see error bellow). 2. `websiteLinksCharts` JS animation class would execute all the `start` method code even if there was no `_totalClicks`. JS would then crash as `beginDate` would not be set correctly. Before the refactoring all that code would be skipped as surrounded by an if/else condition. 3. BS3 to BS4 broke the nav-tabs layout to switch between 'Newest, Most Clicked and Recently Used. `mt16` needed to be removed. Closes #31829
Diffstat (limited to 'addons/website_links/static/src/js')
-rw-r--r--addons/website_links/static/src/js/test_ui_flow.js6
-rw-r--r--addons/website_links/static/src/js/website_links_charts.js1
2 files changed, 6 insertions, 1 deletions
diff --git a/addons/website_links/static/src/js/test_ui_flow.js b/addons/website_links/static/src/js/test_ui_flow.js
index 4d8c7def0f9..584fc38c65d 100644
--- a/addons/website_links/static/src/js/test_ui_flow.js
+++ b/addons/website_links/static/src/js/test_ui_flow.js
@@ -53,8 +53,12 @@ tour.register('website_links_tour', {
},
// 3. Check that counter got incremented and charts are correctly displayed
{
+ content: "filter recently used links",
+ trigger: '#filter-recently-used-links',
+ },
+ {
content: "visit link stats page",
- trigger: '#o_website_links_recent_links a:containsExact("Stats"):first()',
+ trigger: '#o_website_links_recent_links a:containsExact("Stats"):first',
},
{
content: "check click number and ensure graphs are initialized",
diff --git a/addons/website_links/static/src/js/website_links_charts.js b/addons/website_links/static/src/js/website_links_charts.js
index bd2e3ba2747..64da6aa6388 100644
--- a/addons/website_links/static/src/js/website_links_charts.js
+++ b/addons/website_links/static/src/js/website_links_charts.js
@@ -183,6 +183,7 @@ sAnimations.registry.websiteLinksCharts = sAnimations.Class.extend({
$('#all_time_charts').prepend(_t("There is no data to show"));
$('#last_month_charts').prepend(_t("There is no data to show"));
$('#last_week_charts').prepend(_t("There is no data to show"));
+ return;
}
var formattedClicksByDay = {};