Skip to content

Commit

Permalink
[BI-1191] germplasm filters: fix filters debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris T committed Jun 21, 2022
1 parent 8e5f7fb commit 132bb68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/components/tables/expandableTable/ExpandableTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
v-bind:loading="loading"
:row-class="calculateRowClass"
backend-filtering
:debounce-search="searchDebounce != null ? searchDebounce : 1000"
v-bind:debounce-search="searchDebounce"
v-on:filters-change="cloneFilters"
>

<slot></slot>
Expand Down Expand Up @@ -225,5 +226,10 @@ export default class ExpandableTable extends Mixins(ValidationMixin) {
this.cancelEdit(row);
this.openDetail = [];
}

// A patch so if we're listening the filters, we can still debounce
cloneFilters(event: any) {
this.$emit('search', JSON.parse(JSON.stringify(event)));
}
}
</script>
8 changes: 2 additions & 6 deletions src/views/germplasm/GermplasmTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
v-on:paginate-toggle-all="paginationController.toggleShowAll()"
v-on:paginate-page-size="paginationController.updatePageSize($event)"
v-on:sort="paginationController.updateSort($event)"
v-on:filters-change="searchColumn"
v-bind:search-debounce="750"
v-on:search="filters = $event"
v-bind:search-debounce="400"
>
<b-table-column field="accessionNumber" label="GID" v-slot="props" :th-attrs="(column) => ({scope:'col'})" searchable>
<GermplasmLink
Expand Down Expand Up @@ -139,9 +139,5 @@ export default class GermplasmTable extends Vue {
}
}
async searchColumn(filters: any) {
this.filters = filters;
}
}
</script>

0 comments on commit 132bb68

Please sign in to comment.