Fixes repository level request for relationship type filters. Passes false repository level to fiter items list when in term items list.
This commit is contained in:
parent
af60b15b90
commit
e8bdc94c85
|
@ -412,7 +412,7 @@
|
|||
let collectionTarget = ( this.metadatum_object && this.metadatum_object.metadata_type_options.collection_id ) ?
|
||||
this.metadatum_object.metadata_type_options.collection_id : this.collection_id;
|
||||
|
||||
promise = this.getValuesRelationship( collectionTarget, this.optionName, [], offset, this.maxNumOptionsCheckboxList, true);
|
||||
promise = this.getValuesRelationship( collectionTarget, this.optionName, this.isRepositoryLevel, [], offset, this.maxNumOptionsCheckboxList, true);
|
||||
|
||||
promise.request
|
||||
.then(() => {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
:key="filterIndex"
|
||||
:filter="filter"
|
||||
:open="collapsed"
|
||||
:is-repository-level="isRepositoryLevel"/>
|
||||
:is-repository-level="false"/>
|
||||
<p
|
||||
class="has-text-gray is-size-7"
|
||||
v-if="taxonomyFilter.length <= 0">
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
if ( this.type === 'Tainacan\\Metadata_Types\\Relationship' ) {
|
||||
let collectionTarget = ( this.metadatum_object && this.metadatum_object.metadata_type_options.collection_id ) ?
|
||||
this.metadatum_object.metadata_type_options.collection_id : this.collection_id;
|
||||
promise = this.getValuesRelationship( collectionTarget, query );
|
||||
promise = this.getValuesRelationship( collectionTarget, query, this.isRepositoryLevel );
|
||||
|
||||
} else {
|
||||
promise = this.getValuesPlainText( this.metadatum, query, this.isRepositoryLevel );
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
let collectionTarget = ( this.metadatum_object && this.metadatum_object.metadata_type_options.collection_id ) ?
|
||||
this.metadatum_object.metadata_type_options.collection_id : this.collection_id;
|
||||
|
||||
promise = this.getValuesRelationship( collectionTarget, null, [], 0, this.filter.max_options, false, '1');
|
||||
promise = this.getValuesRelationship( collectionTarget, null, this.isRepositoryLevel, [], 0, this.filter.max_options, false, '1');
|
||||
promise.request
|
||||
.then(() => {
|
||||
if(this.options.length > this.filter.max_options){
|
||||
|
|
|
@ -41,16 +41,16 @@ export const filter_type_mixin = {
|
|||
}
|
||||
let query_items = { 'current_query': currentQuery };
|
||||
|
||||
let url = `/collection/${this.collection}/facets/${metadatumId}?getSelected=${getSelected}&`;
|
||||
|
||||
let url = '';
|
||||
if (isRepositoryLevel)
|
||||
url = `/facets/${metadatumId}?getSelected=${getSelected}&`;
|
||||
else
|
||||
url = `/collection/${this.collection}/facets/${metadatumId}?getSelected=${getSelected}&`;
|
||||
|
||||
if(offset != undefined && number != undefined){
|
||||
url += `offset=${offset}&number=${number}&`;
|
||||
}
|
||||
|
||||
if(isRepositoryLevel){
|
||||
url = `/facets/${metadatumId}?`;
|
||||
}
|
||||
|
||||
if(search && offset != undefined && number != undefined){
|
||||
url += `search=${search}&` + qs.stringify(query_items);
|
||||
} else if(search){
|
||||
|
@ -139,7 +139,7 @@ export const filter_type_mixin = {
|
|||
source: source
|
||||
});
|
||||
},
|
||||
getValuesRelationship(collectionTarget, search, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0') {
|
||||
getValuesRelationship(collectionTarget, search, isRepositoryLevel, valuesToIgnore, offset, number, isInCheckboxModal, getSelected = '0') {
|
||||
|
||||
const source = axios.CancelToken.source();
|
||||
|
||||
|
@ -151,8 +151,13 @@ export const filter_type_mixin = {
|
|||
}
|
||||
}
|
||||
let query_items = { 'current_query': currentQuery };
|
||||
let url = '/collection/' + this.filter.collection_id + '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
|
||||
|
||||
let url = '';
|
||||
if (isRepositoryLevel)
|
||||
url = '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
|
||||
else
|
||||
url = '/collection/' + this.filter.collection_id + '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
|
||||
|
||||
if(offset != undefined && number != undefined){
|
||||
url += `offset=${offset}&number=${number}`;
|
||||
} else {
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
if ( this.type === 'Tainacan\\Metadata_Types\\Relationship' ) {
|
||||
let collectionTarget = ( this.metadatum_object && this.metadatum_object.metadata_type_options.collection_id ) ?
|
||||
this.metadatum_object.metadata_type_options.collection_id : this.collection_id;
|
||||
promise = this.getValuesRelationship( collectionTarget, query, valuesToIgnore );
|
||||
promise = this.getValuesRelationship( collectionTarget, query, this.isRepositoryLevel, valuesToIgnore );
|
||||
|
||||
} else {
|
||||
promise = this.getValuesPlainText( this.metadatum, query, this.isRepositoryLevel, valuesToIgnore );
|
||||
|
|
|
@ -98,11 +98,12 @@
|
|||
this.isLoading = true;
|
||||
let query_items = { 'current_query': this.query };
|
||||
|
||||
let route = `/collection/${this.collection}/facets/${this.metadatum}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
|
||||
if(this.collection == 'filter_in_repository'){
|
||||
let route = '';
|
||||
|
||||
if(this.collection == 'filter_in_repository')
|
||||
route = `/facets/${this.metadatum}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
}
|
||||
else
|
||||
route = `/collection/${this.collection}/facets/${this.metadatum}?getSelected=1&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items);
|
||||
|
||||
this.options = [];
|
||||
|
||||
|
@ -193,11 +194,12 @@
|
|||
|
||||
} else {
|
||||
|
||||
let route = '/collection/'+ this.collection +'/facets/' + this.metadatum +`?term_id=${selected}&fetch_only[0]=name&fetch_only[1]=id`;
|
||||
|
||||
if(this.collection == 'filter_in_repository'){
|
||||
route = '/facets/' + this.metadatum +`?term_id=${selected}&fetch_only[0]=name&fetch_only[1]=id`
|
||||
}
|
||||
let route = '';
|
||||
|
||||
if(this.collection == 'filter_in_repository')
|
||||
route = '/facets/' + this.metadatum +`?term_id=${selected}&fetch_only[0]=name&fetch_only[1]=id`;
|
||||
else
|
||||
route = '/collection/'+ this.collection +'/facets/' + this.metadatum +`?term_id=${selected}&fetch_only[0]=name&fetch_only[1]=id`;
|
||||
|
||||
axios.get(route)
|
||||
.then( res => {
|
||||
|
|
Loading…
Reference in New Issue