[IMP] web,*: search menus always visible
Part of task 2234547 Co-authored-by: Mohammed Shekha <msh@odoo.com> Co-authored-by: Aaron Bohy <aab@odoo.com>
This commit is contained in:
committed by
Aaron Bohy
co-authored by
Mohammed Shekha
Aaron Bohy
parent
470fa48686
commit
c80fa71adb
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -29,12 +29,10 @@
|
||||
t-ref="searchView"
|
||||
>
|
||||
<div t-if="props.withSearchBar" class="o_searchview" role="search" aria-autocomplete="list" >
|
||||
<i t-if="props.searchMenuTypes.length"
|
||||
t-attf-class="o_searchview_more fa fa-search-{{ state.displayDropdowns ? 'minus' : 'plus' }}"
|
||||
title="Advanced Search..."
|
||||
<i class="o_searchview_icon fa fa-search"
|
||||
title="Search..."
|
||||
role="img"
|
||||
aria-label="Advanced Search..."
|
||||
t-on-click.prevent="state.displayDropdowns = !state.displayDropdowns"
|
||||
aria-label="Search..."
|
||||
/>
|
||||
<SearchBar t-if="props.withSearchBar" fields="fields"/>
|
||||
</div>
|
||||
@@ -55,7 +53,7 @@
|
||||
role="search"
|
||||
t-ref="searchViewButtons"
|
||||
>
|
||||
<t t-if="props.withSearchBar and state.displayDropdowns">
|
||||
<t t-if="props.withSearchBar">
|
||||
<FilterMenu t-if="props.searchMenuTypes.includes('filter')"
|
||||
class="o_filter_menu"
|
||||
fields="fields"
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
|
||||
}
|
||||
.o_view_kanban_theme_preview_controller {
|
||||
.o_searchview_more, .o_control_panel > div:nth-child(2) {
|
||||
.o_control_panel > div:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user