feat(editor): Add workflow filters to querystring (#7456)

fixes:
https://linear.app/n8n/issue/ADO-1222/feature-save-filters-in-workflows
This commit is contained in:
Ricardo Espinoza
2023-11-08 08:42:53 -05:00
committed by GitHub
parent 8171ad4fa8
commit afd637b5ea
7 changed files with 228 additions and 4 deletions

View File

@@ -107,7 +107,7 @@
<div v-if="showFiltersDropdown" v-show="hasFilters" class="mt-xs">
<n8n-info-tip :bold="false">
{{ i18n.baseText(`${resourceKey}.filters.active`) }}
<n8n-link @click="resetFilters" size="small">
<n8n-link data-test-id="workflows-filter-reset" @click="resetFilters" size="small">
{{ i18n.baseText(`${resourceKey}.filters.active.reset`) }}
</n8n-link>
</n8n-info-tip>
@@ -392,6 +392,19 @@ export default defineComponent({
this.loading = false;
await this.$nextTick();
this.focusSearchInput();
if (this.hasAppliedFilters()) {
this.hasFilters = true;
}
},
hasAppliedFilters(): boolean {
return !!this.filterKeys.find(
(key) =>
key !== 'search' &&
(Array.isArray(this.filters[key])
? this.filters[key].length > 0
: this.filters[key] !== ''),
);
},
setCurrentPage(page: number) {
this.currentPage = page;