Improvements on advanced search component

This commit is contained in:
weryques 2018-07-20 15:43:53 -03:00
parent 7d1f934795
commit 7711f002b6
9 changed files with 22 additions and 16 deletions

View File

@ -129,7 +129,11 @@
icon="plus-circle"
size="is-small"
type="is-secondary"/>
{{ $i18n.get('add_another_search_criterion') }}</a>
{{ searchCriteria.length &lt;= 0 ?
$i18n.get('add_one_search_criterion') :
$i18n.get('add_another_search_criterion')
}}
</a>
</div>
<!-- Tags -->
@ -173,7 +177,10 @@
v-show="!advancedSearchResults"
class="column">
<div class="field is-grouped is-pulled-right">
<p class="control">
<p
v-if="Object.keys(this.advancedSearchQuery.taxquery).length > 0 ||
Object.keys(this.advancedSearchQuery.metaquery).length > 0"
class="control">
<button
@click="clearSearch"
class="button is-outlined">{{ $i18n.get('clear_search') }}</button>
@ -600,7 +607,7 @@
margin-left: -5px !important;
}
tainacan-input-disabled {
.tainacan-input-disabled {
background-color: $gray;
}
}

View File

@ -14,7 +14,7 @@
</label>
<div
class="block overflow-at">
class="block">
<div
v-for="(collection, key) in collections"
:key="key"
@ -87,11 +87,3 @@
}
}
</script>
<style scoped>
.overflow-at {
overflow: auto;
max-height: 125px;
}
</style>

View File

@ -381,7 +381,7 @@
</p>
<p class="control">
<a @click="openAdvancedSearch = false">
{{ $i18n.get('exit') }}
{{ $i18n.get('back') }}
</a>
</p>
</div>

View File

@ -14,6 +14,7 @@
.tag {
background-color: white;
margin-bottom: 0 !important;
margin-right: 4px !important;
max-width: calc(100% - 21px);
justify-content: flex-start;
overflow: hidden;

View File

@ -58,10 +58,10 @@ return apply_filters( 'tainacan-admin-i18n', [
'split' => __( 'Split', 'tainacan' ),
'unified' => __( 'Unified', 'tainacan' ),
'add_another_search_criterion' => __( 'Add another search criterion', 'tainacan' ),
'add_one_search_criterion' => __( 'Add one search criterion', 'tainacan' ),
'clear_search' => __( 'Clear search', 'tainacan' ),
'run' => __( 'Run', 'tainacan' ),
'edit_search' => __( 'Edit search', 'tainacan' ),
'exit' => __( 'Exit', 'tainacan' ),
// Wordpress Status
'publish' => __( 'Publish', 'tainacan' ),

View File

@ -45,7 +45,7 @@ class CSV extends Importer {
$processedItem = [];
$headers = $this->get_source_metadata();
$this->add_log('Proccessing item index ' . $index . ' in collection ' . $collection_id['id'] );
$this->add_log('Proccessing item index ' . $index . ' in collection ' . $collection_definition['id'] );
// search the index in the file and get values
$file = new \SplFileObject( $this->tmp_file, 'r' );
$file->setFlags(\SplFileObject::SKIP_EMPTY);

View File

@ -1,6 +1,8 @@
import axios from '../../../axios/axios';
export const fetchMetadata = ({commit}, {collectionId, isRepositoryLevel, isContextEdit, includeDisabled}) => {
commit('cleanMetadata');
return new Promise((resolve, reject) => {
let endpoint = '';
if (!isRepositoryLevel)

View File

@ -22,3 +22,7 @@ export const setMetadatumTypes = (state, metadatumTypes) => {
export const setMetadatumMappers = (state, metadatumMappers) => {
state.metadatumMappers = metadatumMappers;
}
export const cleanMetadata = (state) => {
state.metadata = [];
}

View File

@ -40,7 +40,7 @@ function tainacan_create_bd_process_db() {
if(empty($column_exists)) {
$wpdb->query("
ALTER TABLE {$wpdb->prefix}tnc_bg_process
ADD name text NOT NULL,
ADD name text NOT NULL
");
}