Begins implementaion of warning for less items than total due to sorting by custom metadata. Checks for undefined cases on orderByName decision.

This commit is contained in:
Mateus Machado Luna 2019-02-22 09:39:08 -03:00
parent c2db4b9a82
commit d2bbbb5008
3 changed files with 20 additions and 12 deletions

View File

@ -10,9 +10,10 @@
$i18n.get('info_showing_items') +
getFirstItem() +
$i18n.get('info_to') +
getLastItemNumber() +
$i18n.get('info_of') + totalItems + '.'
getLastItemNumber() +
$i18n.get('info_of')
}}
<span :class="{ 'has-text-warning': collectionTotalItems > totalItems }">{{ totalItems + '.' }}</span>
</div>
<div class="items-per-page">
<b-field
@ -94,6 +95,10 @@ export default {
},
totalPages(){
return Math.ceil(Number(this.totalItems)/Number(this.itemsPerPage));
},
collectionTotalItems() {
// console.log(this.getCollectionTotalItems().total_items// .status....)
return this.getCollectionTotalItems().total_items;
}
},
watch: {
@ -103,6 +108,9 @@ export default {
}
},
methods: {
...mapGetters('collection', [
'getCollectionTotalItems'
]),
...mapGetters('search', [
'getTotalItems',
'getPage',

View File

@ -897,9 +897,9 @@
for (let metadatum of this.sortingMetadata) {
if (
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && metadatum.metadata_type_object.core) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == metadatum.slug) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && (!metadatum.metadata_type_object || !metadatum.metadata_type_object.core)) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && (metadatum.metadata_type_object != undefined && metadatum.metadata_type_object.core)) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && (!metadatum.metadata_type_object || !metadatum.metadata_type_object.core)) && this.orderBy == metadatum.slug) ||
((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id)
)
return metadatum.name;

View File

@ -861,13 +861,13 @@
} else {
for (let metadatum of this.sortingMetadata) {
if (
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && metadatum.metadata_type_object.core) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && !metadatum.metadata_type_object.core) && this.orderBy == metadatum.slug) ||
((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id)
)
return metadatum.name;
if (
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug == 'creation_date' && (!metadatum.metadata_type_object || !metadatum.metadata_type_object.core)) && this.orderBy == 'date') ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && (metadatum.metadata_type_object != undefined && metadatum.metadata_type_object.core)) && this.orderBy == metadatum.metadata_type_object.related_mapped_prop) ||
((this.orderBy != 'meta_value' && this.orderBy != 'meta_value_num' && metadatum.slug != 'creation_date' && (!metadatum.metadata_type_object || !metadatum.metadata_type_object.core)) && this.orderBy == metadatum.slug) ||
((this.orderBy == 'meta_value' || this.orderBy == 'meta_value_num') && this.getMetaKey() == metadatum.id)
)
return metadatum.name;
}
}
}