From c80fa71adbb2410b4ed5328f9093502969ff02bb Mon Sep 17 00:00:00 2001 From: pka-odoo Date: Mon, 4 May 2020 09:05:51 +0000 Subject: [PATCH] [IMP] web,*: search menus always visible Part of task 2234547 Co-authored-by: Mohammed Shekha Co-authored-by: Aaron Bohy --- addons/mail/static/tests/discuss_tests.js | 16 ++++------------ .../static/src/js/control_panel/control_panel.js | 5 +---- addons/web/static/src/scss/search_view.scss | 10 ---------- .../web/static/src/scss/search_view_extra.scss | 2 +- addons/web/static/src/xml/base.xml | 10 ++++------ .../website/static/src/scss/website.backend.scss | 2 +- 6 files changed, 11 insertions(+), 34 deletions(-) diff --git a/addons/mail/static/tests/discuss_tests.js b/addons/mail/static/tests/discuss_tests.js index 7ef73123e4d..d04caf6c881 100644 --- a/addons/mail/static/tests/discuss_tests.js +++ b/addons/mail/static/tests/discuss_tests.js @@ -248,7 +248,7 @@ QUnit.test('messaging initially ready', async function (assert) { }); QUnit.test('searchview options visibility', async function (assert) { - assert.expect(5); + assert.expect(2); var discuss = await createDiscuss({ id: 1, @@ -258,18 +258,10 @@ QUnit.test('searchview options visibility', async function (assert) { services: this.services, }); - assert.containsOnce(discuss, '.o_control_panel .o_search_options', - "should have search options"); - assert.hasClass(discuss.$('.o_control_panel .o_searchview_more.fa'), 'fa-search-minus', - "should have a button to toggle search options"); - + assert.hasClass(discuss.$('.o_control_panel .o_searchview_icon.fa'), 'fa-search', + "should have a search icon"); assert.isVisible(discuss.$('.o_control_panel .o_search_options'), - "search options should be visible by default"); - await testUtils.dom.click(discuss.$('.o_control_panel .o_searchview_more.fa')); - assert.hasClass(discuss.$('.o_control_panel .o_searchview_more.fa'), 'fa-search-plus', - "should have a button to toggle search options"); - assert.isNotVisible(discuss.$('.o_control_panel .o_search_options'), - "search options should be hidden after clicking on search option toggler"); + "search options should always be visible"); discuss.destroy(); }); diff --git a/addons/web/static/src/js/control_panel/control_panel.js b/addons/web/static/src/js/control_panel/control_panel.js index fee26c3779d..5d42cfc2fbe 100644 --- a/addons/web/static/src/js/control_panel/control_panel.js +++ b/addons/web/static/src/js/control_panel/control_panel.js @@ -13,7 +13,7 @@ odoo.define('web.ControlPanel', function (require) { const { useModel } = require('web.model'); const { Component, hooks } = owl; - const { useRef, useState, useSubEnv } = hooks; + const { useRef, useSubEnv } = hooks; /** * TODO: remove this whole mechanism as soon as `cp_content` is completely removed. @@ -116,9 +116,6 @@ odoo.define('web.ControlPanel', function (require) { if (this.env.controlPanelModel) { this.model = useModel('controlPanelModel'); } - this.state = useState({ - displayDropdowns: true, - }); // Reference hooks this.contentRefs = { diff --git a/addons/web/static/src/scss/search_view.scss b/addons/web/static/src/scss/search_view.scss index 8dd4d3e400e..88900e6127f 100644 --- a/addons/web/static/src/scss/search_view.scss +++ b/addons/web/static/src/scss/search_view.scss @@ -3,11 +3,6 @@ padding: 0 20px 1px 0; position: relative; - .o_searchview_more { - cursor: pointer; - font-size: 16px; - } - .o_searchview_input_container { display: flex; flex-flow: row wrap; @@ -55,11 +50,6 @@ width: 75px; } - .o_searchview_more { - cursor: pointer; - font-size: 16px; - } - .o_searchview_autocomplete { width: 100%; @include o-position-absolute(100%, $left: auto); diff --git a/addons/web/static/src/scss/search_view_extra.scss b/addons/web/static/src/scss/search_view_extra.scss index 11107f2ad02..2530f060c08 100644 --- a/addons/web/static/src/scss/search_view_extra.scss +++ b/addons/web/static/src/scss/search_view_extra.scss @@ -24,7 +24,7 @@ border: none; padding: 4px 0 0 0; } - .o_searchview_more { + .o_searchview_icon { @include o-position-absolute($top: 6px, $right: 5px); } .o_searchview_autocomplete li.o_selection_focus { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 9d59017cee7..62370e8f9f4 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -29,12 +29,10 @@ t-ref="searchView" > @@ -55,7 +53,7 @@ role="search" t-ref="searchViewButtons" > - + div:nth-child(2) { + .o_control_panel > div:nth-child(2) { display: none; } }