Sfoglia il codice sorgente

fix: always show list filters and add confirmation when deleting filters (backport #18343) (#18348)

* feat: auto-show list filters and add confirmation when deleting filters

(cherry picked from commit 683db938e3)

* fix(UX): always show saved filters

(cherry picked from commit f063194e20)

Co-authored-by: Rohan Bansal <rohan@parsimony.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
version-14
mergify[bot] 2 anni fa
committed by GitHub
parent
commit
372dc2a51d
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 13 aggiunte e 5 eliminazioni
  1. +13
    -5
      frappe/public/js/frappe/list/list_filter.js

+ 13
- 5
frappe/public/js/frappe/list/list_filter.js Vedi File

@@ -25,6 +25,7 @@ export default class ListFilter {
this.$saved_filters = this.wrapper.find(".saved-filters").hide();
this.$saved_filters_preview = this.wrapper.find(".saved-filters-preview");
this.saved_filters_hidden = true;
this.toggle_saved_filters(true);

this.filter_input = frappe.ui.form.make_control({
df: {
@@ -102,11 +103,18 @@ export default class ListFilter {
bind_remove_filter() {
this.wrapper.on("click", ".filter-pill .remove", (e) => {
const $li = $(e.currentTarget).closest(".filter-pill");
const name = $li.attr("data-name");
const applied_filters = this.get_filters_values(name);
$li.remove();
this.remove_filter(name).then(() => this.refresh());
this.list_view.filter_area.remove_filters(applied_filters);
const filter_label = $li.text().trim();

frappe.confirm(
__("Are you sure you want to remove the {0} filter?", [filter_label.bold()]),
() => {
const name = $li.attr("data-name");
const applied_filters = this.get_filters_values(name);
$li.remove();
this.remove_filter(name).then(() => this.refresh());
this.list_view.filter_area.remove_filters(applied_filters);
}
);
});
}



Caricamento…
Annulla
Salva