From fc01f72271a65611d699733a76be02a678bc33ab Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Mon, 1 Apr 2019 04:52:28 +0000 Subject: [PATCH] [FIX] web: remove comfiguration panel without page refresh - This issue occurs after the upgrading latest bootstrap library While there is an action with data-toggle="collapse" on anchor tag and also any parent function which returns false, it will prevent the click event from bubbling to parent elements. Hence, It will not call the click event in bootstrap library, and configuration panel will not be removed unless you refresh the page - so, removed return statement as no need to return anything from the event function. Related to Issue: 1943483 --- .../src/js/views/abstract_controller.js | 1 - .../tests/views/abstract_view_banner_tests.js | 38 ++++++++++++++++--- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 53afb4a1fbd..0bd156516fa 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -479,7 +479,6 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { additional_context: _.extend({}, data.context) }); } - return false; }, /** * FIXME: this logic should be rethought diff --git a/addons/web/static/tests/views/abstract_view_banner_tests.js b/addons/web/static/tests/views/abstract_view_banner_tests.js index 21532ed60d9..c9d750f47b6 100644 --- a/addons/web/static/tests/views/abstract_view_banner_tests.js +++ b/addons/web/static/tests/views/abstract_view_banner_tests.js @@ -40,13 +40,33 @@ QUnit.module('Views', { QUnit.test("The banner should be fetched from the route", function (assert) { var done = assert.async(); - assert.expect(5); + assert.expect(6); - var banner_html = - '
' + - '' + - '
' + - '
'; + var banner_html =` + +
+
+ + + +
+
+ +
Here is the banner
+
+
`; createAsyncView({ View: TestView, @@ -73,6 +93,12 @@ QUnit.module('Views', { var $banner_link = $('link[href$="' + test_css_url + '"]', $banner); assert.strictEqual($banner_link.length, 0, "The stylesheet should have been removed from the banner."); + + testUtils.dom.click(view.$('.o_onboarding_btn_close')); // click on close to remove banner + testUtils.dom.click(view.$('.o_technical_modal .btn-primary:contains("Remove")')); // click on button remove from techinal modal + assert.strictEqual(view.$('.o_onboarding_container.show').length, 0, + "Banner should be removed from the view"); + view.destroy(); done(); });