mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] web_filter_header_button: show groupBy filters
Now we can configure group filters to show up along the other filters so users can easily access those as well. TT49232
This commit is contained in:
@@ -14,6 +14,11 @@
|
|||||||
name="context"
|
name="context"
|
||||||
>{'shown_in_panel': {'icon': 'fa-toggle-off', 'hotkey': 'u'}}</attribute>
|
>{'shown_in_panel': {'icon': 'fa-toggle-off', 'hotkey': 'u'}}</attribute>
|
||||||
</filter>
|
</filter>
|
||||||
|
<filter name="state" position="attributes">
|
||||||
|
<attribute
|
||||||
|
name="context"
|
||||||
|
>{'group_by':'state', 'shown_in_panel': {'icon': 'fa-th-list', 'hotkey': 's'}}</attribute>
|
||||||
|
</filter>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -32,5 +32,17 @@ patch(
|
|||||||
}
|
}
|
||||||
return preFilter;
|
return preFilter;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Allow groupBy filters to show up as buttons
|
||||||
|
* @override
|
||||||
|
* @param {Object} filter
|
||||||
|
* @param {Object} attrs
|
||||||
|
*/
|
||||||
|
_extractAttributes(filter, attrs) {
|
||||||
|
this._super(...arguments);
|
||||||
|
if (filter.type === "groupBy" && attrs.context.shown_in_panel) {
|
||||||
|
filter.context = attrs.context;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ export class FilterButton extends Component {
|
|||||||
favorite: {
|
favorite: {
|
||||||
color: "warning",
|
color: "warning",
|
||||||
},
|
},
|
||||||
|
groupBy: {
|
||||||
|
color: "info",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
return mapping[filter.type];
|
return mapping[filter.type];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user