Several replacements of filter_in_repository by default.
This commit is contained in:
parent
7f79e64887
commit
4e5371ce60
|
@ -647,7 +647,7 @@
|
|||
<span class="icon has-text-gray3"> <i class="tainacan-icon tainacan-icon-20px tainacan-icon-metadata"/></span>`;
|
||||
case 'Tainacan\\Entities\\Filter':
|
||||
return `${ this.$i18n.get('filter') }
|
||||
<a href="${ this.adminFullURL + (this.activity.object.collection_id == 'default' || this.activity.object.collection_id == 'filter_in_repository' ? this.$routerHelper.getFilterEditPath(this.activity.object_id) : this.$routerHelper.getCollectionFilterEditPath(this.activity.object.collection_id, this.activity.object_id)) }">${ this.activity.object.name }</a>
|
||||
<a href="${ this.adminFullURL + (this.activity.object.collection_id == 'default' ? this.$routerHelper.getFilterEditPath(this.activity.object_id) : this.$routerHelper.getCollectionFilterEditPath(this.activity.object.collection_id, this.activity.object_id)) }">${ this.activity.object.name }</a>
|
||||
<span class="icon has-text-gray3"> <i class="tainacan-icon tainacan-icon-20px tainacan-icon-filters"/></span>`;
|
||||
case 'Tainacan\\Entities\\Term':
|
||||
return `${ this.$i18n.get('term') }
|
||||
|
|
|
@ -488,7 +488,7 @@
|
|||
|
||||
let route = `/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`;
|
||||
|
||||
if(this.collection_id == 'default' || this.collection_id == 'filter_in_repository'){
|
||||
if(this.collection_id == 'default'){
|
||||
route = `/facets/${this.metadatum_id}${query}`
|
||||
}
|
||||
|
||||
|
@ -611,7 +611,7 @@
|
|||
|
||||
let route = `/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`;
|
||||
|
||||
if(this.collection_id == 'default' || this.collection_id == 'filter_in_repository'){
|
||||
if (this.collection_id == 'default'){
|
||||
route = `/facets/${this.metadatum_id}${query}`
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@
|
|||
|
||||
let route = `/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`;
|
||||
|
||||
if(this.collection_id == 'default' || this.collection_id == 'filter_in_repository'){
|
||||
if (this.collection_id == 'default'){
|
||||
route = `/facets/${this.metadatum_id}${query}`
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if(this.isRepositoryLevel || this.collection == 'filter_in_repository'){
|
||||
if(this.isRepositoryLevel || this.collection == 'default'){
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
let route = '/collection/' + this.collection + '/metadata/' + this.metadatum +'?nopaging=1';
|
||||
|
||||
if (this.isRepositoryLevel || this.collection == 'filter_in_repository')
|
||||
if (this.isRepositoryLevel || this.collection == 'default')
|
||||
route = '/metadata?nopaging=1';
|
||||
|
||||
axios.get(route)
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if(this.isRepositoryLevel || this.collection == 'filter_in_repository'){
|
||||
if(this.isRepositoryLevel || this.collection == 'default'){
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if (this.isRepositoryLevel || this.collection == 'filter_in_repository')
|
||||
if (this.isRepositoryLevel || this.collection == 'default')
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
|
||||
axios.get(in_route)
|
||||
|
|
|
@ -51,7 +51,7 @@ export const filter_type_mixin = {
|
|||
let query_items = { 'current_query': currentQuery };
|
||||
|
||||
let url = '';
|
||||
if (isRepositoryLevel || this.filter.collection_id == 'filter_in_repository')
|
||||
if (isRepositoryLevel || this.filter.collection_id == 'default')
|
||||
url = `/facets/${metadatumId}?getSelected=${getSelected}&`;
|
||||
else
|
||||
url = `/collection/${this.collection}/facets/${metadatumId}?getSelected=${getSelected}&`;
|
||||
|
@ -130,7 +130,7 @@ export const filter_type_mixin = {
|
|||
let query_items = { 'current_query': currentQuery };
|
||||
|
||||
let url = '';
|
||||
if (isRepositoryLevel || this.filter.collection_id == 'filter_in_repository')
|
||||
if (isRepositoryLevel || this.filter.collection_id == 'default')
|
||||
url = '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
|
||||
else
|
||||
url = '/collection/' + this.filter.collection_id + '/facets/' + this.filter.metadatum.metadatum_id + `?getSelected=${getSelected}&`;
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if (this.isRepositoryLevel || this.collection == 'filter_in_repository')
|
||||
if (this.isRepositoryLevel || this.collection == 'default')
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
|
||||
axios.get(in_route)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if(this.isRepositoryLevel || this.collection == 'filter_in_repository'){
|
||||
if(this.isRepositoryLevel || this.collection == 'default'){
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if(this.isRepositoryLevel || this.collection == 'filter_in_repository'){
|
||||
if(this.isRepositoryLevel || this.collection == 'default'){
|
||||
in_route = '/metadata/'+ this.metadatum + '?nopaging=1';
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
|
||||
let route = '';
|
||||
|
||||
if(this.collection == 'filter_in_repository')
|
||||
if (this.collection == 'default')
|
||||
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);
|
||||
|
@ -224,7 +224,7 @@
|
|||
|
||||
// let route = '';
|
||||
|
||||
// if (this.collection == 'filter_in_repository')
|
||||
// if (this.collection == 'default')
|
||||
// route = '/facets/' + this.metadatum +`?term_id=${selected}&fetch_only=name,id`;
|
||||
// else
|
||||
// route = '/collection/'+ this.collection +'/facets/' + this.metadatum +`?term_id=${selected}&fetch_only=name,id`;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
let in_route = '/collection/' + this.collection + '/metadata/' + this.metadatum;
|
||||
|
||||
if(this.isRepositoryLevel || this.collection == 'filter_in_repository'){
|
||||
if(this.isRepositoryLevel || this.collection == 'default'){
|
||||
in_route = '/metadata/'+ this.metadatum;
|
||||
}
|
||||
|
||||
|
|
|
@ -533,7 +533,7 @@ class Logs extends Repository {
|
|||
}
|
||||
} elseif ( $entity instanceof Entities\Filter ) {
|
||||
|
||||
if ( 'filter_in_repository' == $collection_id ) {
|
||||
if ( 'default' == $collection_id ) {
|
||||
if ($this->current_action == 'update') {
|
||||
$log->set_title( sprintf( __( 'Filter "%1$s" was updated in repository level', 'tainacan'), $entity->get_name() ) );
|
||||
} elseif ($this->current_action == 'create') {
|
||||
|
|
|
@ -192,10 +192,10 @@ export const fetchRepositoryCollectionFilters = ({ dispatch, commit } ) => {
|
|||
axios.all(promises).then((results) => {
|
||||
for (let resp of results) {
|
||||
let repositoryFilters = resp.filter.filter((filter) => {
|
||||
return (filter.collection_id == 'default' || filter.collection_id == 'filter_in_repository')
|
||||
return (filter.collection_id == 'default')
|
||||
});
|
||||
let collectionFilters = resp.filter.filter((filter) => {
|
||||
return (filter.collection_id != 'default' && filter.collection_id != 'filter_in_repository')
|
||||
return (filter.collection_id != 'default')
|
||||
});
|
||||
commit('setRepositoryCollectionFilters', { collectionName: resp.collectionId, repositoryCollectionFilters: collectionFilters });
|
||||
commit('setRepositoryCollectionFilters', { collectionName: undefined, repositoryCollectionFilters: repositoryFilters });
|
||||
|
@ -240,10 +240,10 @@ export const fetchTaxonomyFilters = ({ dispatch, commit }, taxonomyId ) => {
|
|||
axios.tainacan.get(endpoint)
|
||||
.then((resp) => {
|
||||
let repositoryFilters = resp.data.filter((filter) => {
|
||||
return (filter.collection_id == 'default' || filter.collection_id == 'filter_in_repository') && filter.metadatum.metadata_type_object.options.taxonomy_id != taxonomyId
|
||||
return (filter.collection_id == 'default') && filter.metadatum.metadata_type_object.options.taxonomy_id != taxonomyId
|
||||
});
|
||||
let collectionFilters = resp.data.filter((filter) => {
|
||||
return (filter.collection_id != 'default' && filter.collection_id != 'filter_in_repository') && filter.metadatum.metadata_type_object.options.taxonomy_id != taxonomyId
|
||||
return (filter.collection_id != 'default') && filter.metadatum.metadata_type_object.options.taxonomy_id != taxonomyId
|
||||
});
|
||||
commit('setTaxonomyFiltersForCollection', { collectionName: collectionId, taxonomyFilters: collectionFilters });
|
||||
commit('setTaxonomyFiltersForCollection', { collectionName: undefined, taxonomyFilters: repositoryFilters });
|
||||
|
|
Loading…
Reference in New Issue