Prevents placeholder of no item found to appear on repository items list right before loading finishes.

This commit is contained in:
Mateus Machado Luna 2019-03-22 11:44:53 -03:00
parent 9b0d22e2a3
commit fbfc090f89
3 changed files with 11 additions and 7 deletions

View File

@ -506,7 +506,7 @@
<button <button
class="button is-white" class="button is-white"
:aria-label="$i18n.get('label_urls')" :aria-label="$i18n.get('label_urls')"
:disabled="this.totalItems == undefined || this.totalItems <= 0" :disabled="totalItems == undefined || totalItems <= 0"
@click="openExposersModal()"> @click="openExposersModal()">
<span class="gray-icon"> <span class="gray-icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/> <i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/>
@ -700,7 +700,7 @@
<!-- Empty Placeholder (only used in Admin) --> <!-- Empty Placeholder (only used in Admin) -->
<section <section
v-if="!isOnTheme && !isLoadingItems && totalItems <= 0" v-if="!isOnTheme && !isLoadingItems && totalItems == 0"
class="section"> class="section">
<div class="content has-text-grey has-text-centered"> <div class="content has-text-grey has-text-centered">
<p> <p>
@ -1396,7 +1396,7 @@
}); });
this.$eventBusSearch.$on('hasToPrepareMetadataAndFilters', (to) => { this.$eventBusSearch.$on('hasToPrepareMetadataAndFilters', (to) => {
/* This condition is to prevent a incorrect fetch by filter or metadata when we coming from items /* This condition is to prevent an incorrect fetch by filter or metadata when we coming from items
* at collection level to items page at repository level * at collection level to items page at repository level
*/ */

View File

@ -492,7 +492,7 @@
<button <button
class="button is-white" class="button is-white"
:aria-label="$i18n.get('label_urls')" :aria-label="$i18n.get('label_urls')"
:disabled="this.totalItems == undefined || this.totalItems <= 0" :disabled="totalItems == undefined || totalItems <= 0"
@click="openExposersModal()"> @click="openExposersModal()">
<span class="gray-icon"> <span class="gray-icon">
<i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/> <i class="tainacan-icon tainacan-icon-20px tainacan-icon-url"/>
@ -679,7 +679,7 @@
<!-- Empty Placeholder (only used in Admin) --> <!-- Empty Placeholder (only used in Admin) -->
<section <section
v-if="!isOnTheme && !isLoadingItems && totalItems <= 0" v-if="!isOnTheme && !isLoadingItems && totalItems == 0"
class="section"> class="section">
<div class="content has-text-grey has-text-centered"> <div class="content has-text-grey has-text-centered">
<p> <p>
@ -1356,7 +1356,7 @@
}); });
this.$eventBusSearch.$on('hasToPrepareMetadataAndFilters', (to) => { this.$eventBusSearch.$on('hasToPrepareMetadataAndFilters', (to) => {
/* This condition is to prevent a incorrect fetch by filter or metadata when we come from items /* This condition is to prevent an incorrect fetch by filter or metadata when we come from items
* at collection level to items page at repository level * at collection level to items page at repository level
*/ */

View File

@ -272,6 +272,9 @@ export default {
this.$store.dispatch('search/setStatus', status); this.$store.dispatch('search/setStatus', status);
this.updateURLQueries(); this.updateURLQueries();
}, },
setTotalItems(totalItems) {
this.$store.dispatch('search/setTotalItems', totalItems);
},
setSearchQuery(searchQuery) { setSearchQuery(searchQuery) {
this.$store.dispatch('search/setSearchQuery', searchQuery); this.$store.dispatch('search/setSearchQuery', searchQuery);
this.updateURLQueries(); this.updateURLQueries();
@ -351,6 +354,7 @@ export default {
}, },
setCollectionId(collectionId) { setCollectionId(collectionId) {
this.setTotalItems(null);
this.collectionId = collectionId; this.collectionId = collectionId;
}, },
setTerm(termId, taxonomy) { setTerm(termId, taxonomy) {