Fixes ternary operator causing wrong concatenation of fetch_only attributes for creation+date and author_name.

This commit is contained in:
Mateus Machado Luna 2019-02-01 16:45:49 -02:00
parent 2655c0256d
commit cf102d0f31
2 changed files with 6 additions and 5 deletions

View File

@ -1044,13 +1044,13 @@
let authorNameMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'author_name');
let descriptionMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.metadata_type_object != undefined ? metadatum.metadata_type_object.related_mapped_prop == 'description' : false);
// Updates Search
this.$eventBusSearch.addFetchOnly(
thumbnailMetadatum != undefined && thumbnailMetadatum.display ? 'thumbnail' : null +','+
creationDateMetadatum != undefined && creationDateMetadatum.display ? 'creation_date' : null +','+
authorNameMetadatum != undefined && authorNameMetadatum.display ? 'author_name': null +','+
(this.isRepositoryLevel ? 'title' : null) +','+
((thumbnailMetadatum != undefined && thumbnailMetadatum.display) ? 'thumbnail' : null) + ',' +
((creationDateMetadatum != undefined && creationDateMetadatum.display) ? 'creation_date' : null) + ',' +
((authorNameMetadatum != undefined && authorNameMetadatum.display) ? 'author_name': null) + ',' +
(this.isRepositoryLevel ? 'title' : null) + ',' +
(this.isRepositoryLevel && descriptionMetadatum.display ? 'description' : null), false, fetchOnlyMetadatumIds.toString());
// Closes dropdown

View File

@ -189,6 +189,7 @@ export default {
}
},
addFetchOnly( metadatum, ignorePrefs, metadatumIDs ){
this.$store.dispatch('search/add_fetch_only', metadatum );
this.$store.dispatch('search/add_fetch_only_meta', metadatumIDs);
this.updateURLQueries();