Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
amh-mw committed Jun 12, 2024
1 parent 1e0ed15 commit 1a2260d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 46 deletions.
10 changes: 5 additions & 5 deletions web_edit_user_filter/static/src/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
};

patch(
components.ControlPanelModelExtension,
components.ControlPanelModelExtension.prototype,
"web_edit_user_filter/static/src/js/backend.js",
{
_favoriteToIrFilter(favorite) {
Expand Down Expand Up @@ -46,7 +46,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
);

patch(
components.CustomFavoriteItem,
components.CustomFavoriteItem.prototype,
"web_edit_user_filter/static/src/js/backend.js",
{
// ---------------------------------------------------------------------
Expand Down Expand Up @@ -98,7 +98,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
}
);

patch(components.SearchBar, "web_edit_user_filter/static/src/js/backend.js", {
patch(components.SearchBar.prototype, "web_edit_user_filter/static/src/js/backend.js", {
mounted() {
var self = this;
this._super(...arguments);
Expand All @@ -120,7 +120,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
var selectedFacet = self.model.get("filters").filter(function (facet) {
return (
facet.type === facet_type &&
facet.groupId === facetId &&
facet.groupId == facetId &&
facet.isActive === true
);
});
Expand All @@ -131,7 +131,7 @@ odoo.define("web_edit_user_filter/static/src/js/backend.js", function (require)
var FavFacets = [];
var currentFacet = self.model.get(
"filters",
(f) => f.type === "favorite" && f.groupId === facetId
(f) => f.type === "favorite" && f.groupId == facetId
);
if (currentFacet[0].groupBys.length) {
_.each(currentFacet[0].groupBys, function (description) {
Expand Down
45 changes: 4 additions & 41 deletions web_edit_user_filter/static/src/xml/search_extended.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,13 @@
<templates id="template" xml:space="preserve">
<t
t-name="SearchExtender"
t-inherit="web.SearchBar"
t-inherit="web.Legacy.SearchBar"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div[hasclass('o_searchview_facet')]" position="replace">
<div
t-foreach="model.get('facets')"
t-as="facet"
t-key="facet_index"
tabindex="0"
class="o_searchview_facet"
role="img"
aria-label="search"
t-on-keydown="_onFacetKeydown(facet, facet_index)"
t-att-data-type="facet.type"
t-att-data-gp="facet.groupId"
>
<span
t-if="facet.icon"
t-attf-class="o_searchview_facet_label {{ facet.icon }}"
/>
<span t-else="" class="o_searchview_facet_label" t-esc="facet.title" />
<div class="o_facet_values">
<t
t-foreach="facet.values"
t-as="facetValue"
t-key="facetValue_index"
>
<span
t-if="!facetValue_first"
class="o_facet_values_sep"
t-esc="facet.separator"
/>
<span class="o_facet_value" t-esc="facetValue" />
</t>
</div>
<i
class="fa fa-sm fa-remove o_facet_remove"
role="img"
aria-label="Remove"
title="Remove"
t-on-click="_onFacetRemove(facet)"
/>
</div>
<xpath expr="//div[hasclass('o_searchview_facet')]" position="attributes">
<attribute name="t-att-data-type">facet.type</attribute>
<attribute name="t-att-data-gp">facet.groupId</attribute>
</xpath>
</t>
</templates>

0 comments on commit 1a2260d

Please sign in to comment.