update i18n object to accept attributes descriptions

This commit is contained in:
Eduardo humberto 2018-03-22 11:03:38 -03:00
parent e07d2e16d7
commit 17d4122860
3 changed files with 12 additions and 2 deletions

View File

@ -153,7 +153,7 @@ class Admin {
'base_url' => $TAINACAN_BASE_URL
];
$settings['maps'] = [
$maps = [
'collections' => $Tainacan_Collections->get_map(),
'fields' => $Tainacan_Fields->get_map(),
'filters' => $Tainacan_Filters->get_map(),
@ -161,6 +161,12 @@ class Admin {
'taxonomies' => $Tainacan_Taxonomies->get_map(),
];
foreach( $maps as $type => $map ){
foreach ( $map as $field => $details){
$settings['i18n']['helpers_label'][$type][$field] = [ 'title' => $details['title'], 'description' => $details['description'] ];
}
}
wp_localize_script( 'tainacan-user-admin', 'tainacan_plugin', $settings );

View File

@ -159,7 +159,7 @@ export default {
this.$router.push(this.$routerHelper.getItemEditPath(this.collectionId, itemId));
},
showValue( metadata ){
if( metadata.value === false )
if( ! metadata || metadata.value === false )
return '';
if( Array.isArray( metadata.value ) ){

View File

@ -75,6 +75,10 @@
this.$emit('blur');
},
search(query){
if( this.selected.length > 0 && this.field.field.multiple === 'no'){
return '';
}
if (query !== '') {
this.loading = true;
this.options = [];