Adjustments to metadata by value alert. Ref. #278.

This commit is contained in:
Mateus Machado Luna 2019-07-18 11:38:24 -03:00
parent 12b917a273
commit e1fee7c367
2 changed files with 13 additions and 2 deletions

View File

@ -708,7 +708,13 @@
!showLoading &&
((openAdvancedSearch && advancedSearchResults) || !openAdvancedSearch)"
class="metadata-alert">
<p class="text">{{ $i18n.getWithVariables('info_sorting_by_metadata_value_%s', [orderByName]) }}</p>
<p class="text">
{{
totalItems > 0 ?
$i18n.getWithVariables('info_sorting_by_metadata_value_%s', [orderByName]) :
$i18n.getWithVariables('info_sorting_by_metadata_value_%s_empty_list', [orderByName])
}}
</p>
<div>
<button
@click="openMetatadaSortingWarningDialog({ offerCheckbox: false })"
@ -916,7 +922,7 @@
},
computed: {
isSortingByCustomMetadata() {
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date');
return (this.orderBy != undefined && this.orderBy != '' && this.orderBy != 'title' && this.orderBy != 'date');
},
repositoryTotalItems(){
let collections = this.getCollections();
@ -1019,6 +1025,10 @@
} else {
this.$eventBusSearch.clearAllFilters();
}
},
orderBy() {
if (this.isSortingByCustomMetadata)
this.hasAnOpenAlert = true;
}
},
methods: {

View File

@ -626,6 +626,7 @@ return apply_filters( 'tainacan-admin-i18n', [
'info_tainacan_api' => __('Tainacan API on JSON format.', 'tainacan'),
'info_items_hidden_due_sorting' => __('When ordering by metadata value, items that have no value for the chosen metadata will not be listed. This list may have less elements than the total existing for current search criteria.', 'tainacan'),
'info_sorting_by_metadata_value_%s' => __('Showing only items that have value for metadata %s.'),
'info_sorting_by_metadata_value_%s_empty_list' => __('No item found, but only items with values for metadata %s are shown. Try sorting by other metatada.'),
// Tainacan Metadatum Types
'tainacan-text' => __( 'Text', 'tainacan' ),