From 24127af83f6a4e73228bb6a9ebe09e18033117d1 Mon Sep 17 00:00:00 2001 From: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Date: Fri, 11 Feb 2022 11:42:31 +0100 Subject: [PATCH] Fix dropdown behavior for repository filters [SCI-6491] (#3842) Co-authored-by: Anton --- app/javascript/packs/vue/repository_filter.js | 8 +++++-- .../vue/repository_filter/container.vue | 24 +++++++++++++++---- .../repositories/_repository_filters.html.erb | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/javascript/packs/vue/repository_filter.js b/app/javascript/packs/vue/repository_filter.js index d9d1c5781..4646bb8c1 100644 --- a/app/javascript/packs/vue/repository_filter.js +++ b/app/javascript/packs/vue/repository_filter.js @@ -75,7 +75,8 @@ window.initRepositoryFilter = () => { const repositoryFilterContainer = new Vue({ el: '#filterContainer', data: () => ({ - filters: DEFAULT_FILTERS, + filters: [], + defaultFilters: DEFAULT_FILTERS, columns: [], my_modules: [], canManageFilters: $('#filterContainer').data('can-manage-filters'), @@ -121,7 +122,6 @@ window.initRepositoryFilter = () => { $('#modalSaveRepositoryTableFilter').data('repositoryTableFilterId', null); $('#saveRepositoryFilters').addClass('hidden'); $('#overwriteFilterLink').addClass('hidden'); - this.reloadDataTable(); }, reloadDataTable() { this.dataTableElement.DataTable().ajax.reload(); @@ -150,5 +150,9 @@ window.initRepositoryFilter = () => { e.stopPropagation(); }); + $('#filtersDropdownButton').on('show.bs.dropdown', () => { + $('#filtersColumnsDropdown, #savedFiltersContainer').removeClass('open'); + }); + window.repositoryFilterObject = repositoryFilterContainer; }; diff --git a/app/javascript/vue/repository_filter/container.vue b/app/javascript/vue/repository_filter/container.vue index f4ade3152..f9a2225af 100644 --- a/app/javascript/vue/repository_filter/container.vue +++ b/app/javascript/vue/repository_filter/container.vue @@ -1,5 +1,5 @@