From efdc42604e779649e7a0d13d89aeefd01b10ebf6 Mon Sep 17 00:00:00 2001 From: Anton Date: Mon, 8 Jan 2024 18:33:28 +0100 Subject: [PATCH] Refactor filter component [SCI-9939] --- app/javascript/vue/shared/datatable/table.vue | 20 +-- .../vue/shared/filters/filter_dropdown.vue | 129 ++++++++++-------- .../shared/filters/inputs/checkbox_filter.vue | 31 +++-- .../filters/inputs/date_range_filter.vue | 57 ++++---- .../shared/filters/inputs/select_filter.vue | 53 +++---- .../vue/shared/filters/inputs/text_filter.vue | 30 ++-- .../vue/shared/general_dropdown.vue | 3 +- app/javascript/vue/shared/select_dropdown.vue | 4 +- app/services/lists/projects_service.rb | 8 +- 9 files changed, 181 insertions(+), 154 deletions(-) diff --git a/app/javascript/vue/shared/datatable/table.vue b/app/javascript/vue/shared/datatable/table.vue index f7f818571..45a98ddf0 100644 --- a/app/javascript/vue/shared/datatable/table.vue +++ b/app/javascript/vue/shared/datatable/table.vue @@ -29,7 +29,7 @@ -
- Loading +
+ Loading
{ + if (reload) { + if (this.gridApi) { + this.gridApi.setRowData([]); + } + this.rowData = []; + } this.selectedRows = []; if (this.gridApi) { this.gridApi.setRowData(this.formatData(response.data.data)); diff --git a/app/javascript/vue/shared/filters/filter_dropdown.vue b/app/javascript/vue/shared/filters/filter_dropdown.vue index c20972c24..b10336955 100644 --- a/app/javascript/vue/shared/filters/filter_dropdown.vue +++ b/app/javascript/vue/shared/filters/filter_dropdown.vue @@ -1,20 +1,34 @@ diff --git a/app/javascript/vue/shared/filters/inputs/checkbox_filter.vue b/app/javascript/vue/shared/filters/inputs/checkbox_filter.vue index f301031fc..00981cd9f 100644 --- a/app/javascript/vue/shared/filters/inputs/checkbox_filter.vue +++ b/app/javascript/vue/shared/filters/inputs/checkbox_filter.vue @@ -9,20 +9,21 @@ diff --git a/app/javascript/vue/shared/filters/inputs/date_range_filter.vue b/app/javascript/vue/shared/filters/inputs/date_range_filter.vue index d079b05f5..987decfb9 100644 --- a/app/javascript/vue/shared/filters/inputs/date_range_filter.vue +++ b/app/javascript/vue/shared/filters/inputs/date_range_filter.vue @@ -1,11 +1,14 @@