Better way of handling loading state to filters.

This commit is contained in:
mateuswetah 2020-06-29 14:54:30 -03:00
parent 76a2b65473
commit 4f2ec6f4e9
5 changed files with 4 additions and 19 deletions

View File

@ -184,9 +184,6 @@
this.prepareOptionsForTaxonomy(this.facetsFromItemSearch[facet]);
else
this.prepareOptionsForTaxonomy(Object.values(this.facetsFromItemSearch[facet]));
if (this.isUsingElasticSearch)
this.isLoadingOptions = false;
}
}
}

View File

@ -287,11 +287,11 @@
props: {
collectionId: String,
isRepositoryLevel: Boolean,
taxonomy: String
taxonomy: String,
isLoadingItems: Boolean
},
data() {
return {
isLoadingItems: true,
isLoadingFilters: false,
collapseAll: false,
taxonomyFiltersCollectionNames: {},
@ -375,11 +375,6 @@
*/
this.prepareFilters();
});
if (this.isUsingElasticSearch) {
this.$eventBusSearch.$on('isLoadingItems', isLoadingItems => {
this.isLoadingItems = isLoadingItems;
});
}
},
beforeDestroy() {
// Cancels previous collection name Request
@ -396,9 +391,6 @@
this.$eventBusSearch.$off('hasToPrepareMetadataAndFilters');
if (this.isUsingElasticSearch)
this.$eventBusSearch.$off('isLoadingItems');
},
methods: {
...mapGetters('search',[

View File

@ -133,9 +133,6 @@ export const dynamicFilterTypeMixin = {
for (const facet in this.facetsFromItemSearch) {
if (facet == this.filter.id) {
this.prepareOptionsForPlainText(this.facetsFromItemSearch[facet], search, valuesToIgnore, isInCheckboxModal);
if (this.isUsingElasticSearch)
this.isLoadingOptions = false;
}
}
resolve();
@ -213,9 +210,6 @@ export const dynamicFilterTypeMixin = {
for (const facet in this.facetsFromItemSearch) {
if (facet == this.filter.id) {
this.prepareOptionsForRelationship(this.facetsFromItemSearch[facet], search, valuesToIgnore, isInCheckboxModal);
if (this.isUsingElasticSearch)
this.isLoadingOptions = false;
}
}
resolve();

View File

@ -429,6 +429,7 @@
aria-role="dialog"
custom-class="tainacan-form filters-menu">
<filters-items-list
:is-loading-items="isLoadingItems"
autofocus="true"
tabindex="-1"
aria-modal

View File

@ -408,6 +408,7 @@
:custom-class="'tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '')"
:can-cancel="hideHideFiltersButton ? ['x', 'outside'] : ['x', 'escape', 'outside']">
<filters-items-list
:is-loading-items="isLoadingItems"
:autofocus="filtersAsModal"
:tabindex="filtersAsModal ? -1 : 0"
:aria-modal="filtersAsModal"