Merge branch 'develop' into continuousintegration
This commit is contained in:
commit
cd158d962f
|
@ -0,0 +1,123 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="columns is-multiline tnc-advanced-search-container">
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-for="searchField in totalSearchMetadata"
|
||||||
|
:key="searchField"
|
||||||
|
class="field column is-12 tainacan-form">
|
||||||
|
|
||||||
|
<b-field
|
||||||
|
class="columns"
|
||||||
|
grouped>
|
||||||
|
<b-field class="column is-one-fifth">
|
||||||
|
<b-select
|
||||||
|
@input="addToAdvancedSearchQuery">
|
||||||
|
<option
|
||||||
|
v-for="(metadata, key) in metadataList"
|
||||||
|
v-if="metadata.enabled"
|
||||||
|
:value="metadata.id"
|
||||||
|
:key="key"
|
||||||
|
>{{ metadata.name }}</option>
|
||||||
|
</b-select>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
|
<b-field class="column is-two-thirds">
|
||||||
|
<b-input
|
||||||
|
@input="addToAdvancedSearchQuery"/>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
|
<b-field class="column is-one-fifth">
|
||||||
|
<b-select
|
||||||
|
@input="addToAdvancedSearchQuery">
|
||||||
|
<option
|
||||||
|
v-for="(opt, key) in compare"
|
||||||
|
:value="key"
|
||||||
|
:key="key"
|
||||||
|
>{{ opt }}</option>
|
||||||
|
</b-select>
|
||||||
|
</b-field>
|
||||||
|
</b-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{'padding-left': '25px !important'}"
|
||||||
|
class="field column is-12">
|
||||||
|
|
||||||
|
<div class="is-inline">
|
||||||
|
<b-icon
|
||||||
|
icon="plus-circle"
|
||||||
|
size="is-small"
|
||||||
|
type="is-info"/>
|
||||||
|
<a
|
||||||
|
@click="addSearchMetadata"
|
||||||
|
class="is-info is-small">
|
||||||
|
Adicionar mais um campo de busca</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="column">
|
||||||
|
<div class="field is-grouped is-pulled-right">
|
||||||
|
<p class="control">
|
||||||
|
<button
|
||||||
|
@click="clearSearch"
|
||||||
|
class="button is-outlined">Limpar busca</button>
|
||||||
|
</p>
|
||||||
|
<p class="control">
|
||||||
|
<button
|
||||||
|
@click="searchAdvanced"
|
||||||
|
class="button is-secondary">Buscar</button>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<pre>{{ metadataIds }} {{ toCompare }}</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "AdvancedSearch",
|
||||||
|
props: {
|
||||||
|
metadataList: Array,
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
compare: {'=':'Igual', '!=':'Diferente', 'IN':'Contém', 'NOT IN':'Não Contém'},
|
||||||
|
totalSearchMetadata: 1,
|
||||||
|
advancedSearchQuery: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addSearchMetadata(){
|
||||||
|
this.totalSearchMetadata++;
|
||||||
|
},
|
||||||
|
clearSearch(){
|
||||||
|
this.totalSearchMetadata = 1;
|
||||||
|
},
|
||||||
|
searchAdvanced(){
|
||||||
|
|
||||||
|
},
|
||||||
|
addToAdvancedSearchQuery(optionValue){
|
||||||
|
console.log(optionValue);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
@import '../../scss/_variables.scss';
|
||||||
|
|
||||||
|
.tnc-advanced-search-container {
|
||||||
|
padding-top: 47px;
|
||||||
|
padding-right: $page-side-padding;
|
||||||
|
padding-left: $page-side-padding;
|
||||||
|
padding-top: 47px;
|
||||||
|
|
||||||
|
.column {
|
||||||
|
padding: 0 0.3rem 0.3rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -20,7 +20,7 @@
|
||||||
<div class="control has-icons-right is-small is-clearfix">
|
<div class="control has-icons-right is-small is-clearfix">
|
||||||
<input
|
<input
|
||||||
autocomplete="on"
|
autocomplete="on"
|
||||||
:placeholder="$i18n.get('instruction_search_repository')"
|
:placeholder="$i18n.get('instruction_search')"
|
||||||
class="input is-small"
|
class="input is-small"
|
||||||
type="search"
|
type="search"
|
||||||
v-model="searchTerm">
|
v-model="searchTerm">
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
<i class="mdi mdi-magnify" />
|
<i class="mdi mdi-magnify" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a href="">{{ $i18n.get('advanced_search') }}</a>
|
<a @click.prevent="openAdvancedSearchComponent">{{ $i18n.get('advanced_search') }}</a>
|
||||||
</span>
|
</span>
|
||||||
<a
|
<a
|
||||||
class="level-item"
|
class="level-item"
|
||||||
|
@ -50,6 +50,13 @@ export default {
|
||||||
searchTerm: ''
|
searchTerm: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
openAdvancedSearchComponent(){
|
||||||
|
console.log('Called here', this.$route.meta);
|
||||||
|
this.$set(this.$route.meta, 'openAdvancedSearch', !this.$route.meta.openAdvancedSearch);
|
||||||
|
console.log('Called here', this.$route.meta);
|
||||||
|
}
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
isMenuCompressed: false
|
isMenuCompressed: false
|
||||||
}
|
}
|
||||||
|
@ -105,7 +112,7 @@ export default {
|
||||||
color: $tertiary;
|
color: $tertiary;
|
||||||
}
|
}
|
||||||
.search-area {
|
.search-area {
|
||||||
display: none;//display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 36px;
|
margin-right: 36px;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ const routes = [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{ path: '/items', name: 'ItemsPage', component: ItemsPage, meta: {title: i18nGet('title_items_page'), icon: 'file-multiple'} },
|
{ path: '/items', name: 'ItemsPage', component: ItemsPage, meta: {title: i18nGet('title_items_page'), icon: 'file-multiple', openAdvancedSearch: false} },
|
||||||
{ path: '/items/new', name: 'ItemCreationForm', component: ItemEditionForm, meta: {title: i18nGet('title_create_item'), icon: 'file-multiple'} },
|
{ path: '/items/new', name: 'ItemCreationForm', component: ItemEditionForm, meta: {title: i18nGet('title_create_item'), icon: 'file-multiple'} },
|
||||||
|
|
||||||
{ path: '/filters', name: 'FiltersPage', component: FiltersPage, meta: {title: i18nGet('title_repository_filters_page'), icon: 'filter'} },
|
{ path: '/filters', name: 'FiltersPage', component: FiltersPage, meta: {title: i18nGet('title_repository_filters_page'), icon: 'filter'} },
|
||||||
|
|
|
@ -44,7 +44,9 @@
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</b-field>
|
</b-field>
|
||||||
<!-- <a class="is-size-7 is-secondary is-pulled-right">Busca avançada</a> -->
|
<a
|
||||||
|
@click.prevent="openAdvancedSearchComponent"
|
||||||
|
class="is-size-7 is-secondary is-pulled-right">{{ $i18n.get('advanced_search') }}</a>
|
||||||
|
|
||||||
<h3 class="has-text-weight-semibold">{{ $i18n.get('filters') }}</h3>
|
<h3 class="has-text-weight-semibold">{{ $i18n.get('filters') }}</h3>
|
||||||
<a
|
<a
|
||||||
|
@ -241,8 +243,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ADVANCED SEARCH
|
<!-- ADVANCED SEARCH -->
|
||||||
<advanced-search /> -->
|
<advanced-search
|
||||||
|
v-if="openAdvancedSearch"
|
||||||
|
:metadata-list="fields" />
|
||||||
|
|
||||||
<!-- --------------- -->
|
<!-- --------------- -->
|
||||||
|
|
||||||
|
@ -332,7 +336,7 @@
|
||||||
import ItemsList from '../../components/lists/items-list.vue';
|
import ItemsList from '../../components/lists/items-list.vue';
|
||||||
import FiltersItemsList from '../../components/search/filters-items-list.vue';
|
import FiltersItemsList from '../../components/search/filters-items-list.vue';
|
||||||
import Pagination from '../../components/search/pagination.vue'
|
import Pagination from '../../components/search/pagination.vue'
|
||||||
// import AdvancedSearch from '../../components/advanced-search/advanced-search.vue';
|
import AdvancedSearch from '../../components/advanced-search/advanced-search.vue';
|
||||||
import { mapActions, mapGetters } from 'vuex';
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -361,6 +365,10 @@
|
||||||
enabledViewModes: Object // Used only on theme
|
enabledViewModes: Object // Used only on theme
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
openAdvancedSearch(){
|
||||||
|
console.log('Called here', this.$route.meta);
|
||||||
|
return this.$route.meta.openAdvancedSearch;
|
||||||
|
},
|
||||||
items() {
|
items() {
|
||||||
return this.getItems();
|
return this.getItems();
|
||||||
},
|
},
|
||||||
|
@ -396,7 +404,7 @@
|
||||||
ItemsList,
|
ItemsList,
|
||||||
FiltersItemsList,
|
FiltersItemsList,
|
||||||
Pagination,
|
Pagination,
|
||||||
// AdvancedSearch,
|
AdvancedSearch,
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
tableFields() {
|
tableFields() {
|
||||||
|
@ -428,6 +436,11 @@
|
||||||
'getViewMode',
|
'getViewMode',
|
||||||
'getTotalItems'
|
'getTotalItems'
|
||||||
]),
|
]),
|
||||||
|
openAdvancedSearchComponent(){
|
||||||
|
console.log('Called here', this.$route.meta);
|
||||||
|
this.$set(this.$route.meta, 'openAdvancedSearch', !this.$route.meta.openAdvancedSearch);
|
||||||
|
console.log('Called here', this.$route.meta);
|
||||||
|
},
|
||||||
updateSearch() {
|
updateSearch() {
|
||||||
this.$eventBusSearch.setSearchQuery(this.futureSearchQuery);
|
this.$eventBusSearch.setSearchQuery(this.futureSearchQuery);
|
||||||
},
|
},
|
||||||
|
|
|
@ -327,7 +327,7 @@ class REST_Filters_Controller extends REST_Controller {
|
||||||
$item_arr['enabled'] = $item->get_enabled_for_collection();
|
$item_arr['enabled'] = $item->get_enabled_for_collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
$item_arr['filter_type_object'] = $item->get_filter_type_object()->_toArray();
|
$item_arr['filter_type_object'] = $item->get_filter_type_object() ? $item->get_filter_type_object()->_toArray() : $item->get_filter_type_object();
|
||||||
|
|
||||||
return $item_arr;
|
return $item_arr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div v-if="type === 'date'">
|
<div v-if="type === 'date'">
|
||||||
<b-datepicker
|
<b-datepicker
|
||||||
:placeholder="$i18n.get('label_selectbox_init')"
|
:placeholder="$i18n.get('label_selectbox_init')"
|
||||||
:class="{'has-content': date_init !== undefined && date_init !== ''}"
|
:class="{'has-content': date_init != undefined && date_init != ''}"
|
||||||
v-model="date_init"
|
v-model="date_init"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
@focus="isTouched = true"
|
@focus="isTouched = true"
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
icon="calendar-today"/>
|
icon="calendar-today"/>
|
||||||
<b-datepicker
|
<b-datepicker
|
||||||
:placeholder="$i18n.get('label_selectbox_init')"
|
:placeholder="$i18n.get('label_selectbox_init')"
|
||||||
:class="{'has-content': date_end !== undefined && date_end !== ''}"
|
:class="{'has-content': date_end != undefined && date_end != ''}"
|
||||||
v-model="date_end"
|
v-model="date_end"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
@input="validate_values()"
|
@input="validate_values()"
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
class="columns"
|
class="columns"
|
||||||
v-else>
|
v-else>
|
||||||
<b-input
|
<b-input
|
||||||
:class="{'has-content': value_init !== undefined && value_init !== ''}"
|
:class="{'has-content': value_init != undefined && value_init != ''}"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
type="number"
|
type="number"
|
||||||
step="any"
|
step="any"
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
class="column"
|
class="column"
|
||||||
v-model="value_init"/>
|
v-model="value_init"/>
|
||||||
<b-input
|
<b-input
|
||||||
:class="{'has-content': value_end !== undefined && value_end !== ''}"
|
:class="{'has-content': value_end != undefined && value_end != ''}"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
type="number"
|
type="number"
|
||||||
step="any"
|
step="any"
|
||||||
|
|
|
@ -264,7 +264,7 @@ abstract class Importer {
|
||||||
*/
|
*/
|
||||||
public function fetch_from_remote( $url ){
|
public function fetch_from_remote( $url ){
|
||||||
$tmp = wp_remote_get( $url );
|
$tmp = wp_remote_get( $url );
|
||||||
if( isset( $tmp['body'] ) ){
|
if( !is_wp_error($tmp) && isset( $tmp['body'] ) ){
|
||||||
$file = fopen( $this->get_id().'.txt', 'w' );
|
$file = fopen( $this->get_id().'.txt', 'w' );
|
||||||
fwrite( $file, $tmp['body'] );
|
fwrite( $file, $tmp['body'] );
|
||||||
fclose( $file );
|
fclose( $file );
|
||||||
|
|
Loading…
Reference in New Issue