Several replacements of filter_in_repository by default.

This commit is contained in:
Mateus Machado Luna 2019-10-01 10:18:48 -03:00
parent 7f79e64887
commit 4e5371ce60
14 changed files with 21 additions and 21 deletions

View File

@ -647,7 +647,7 @@
<span class="icon has-text-gray3">&nbsp;<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">&nbsp;<i class="tainacan-icon tainacan-icon-20px tainacan-icon-filters"/></span>`;
case 'Tainacan\\Entities\\Term':
return `${ this.$i18n.get('term') }

View File

@ -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}`
}

View File

@ -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;
}

View File

@ -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)

View File

@ -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;
}

View File

@ -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)

View File

@ -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}&`;

View File

@ -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)

View File

@ -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;
}

View File

@ -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';
}

View File

@ -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`;

View File

@ -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;
}

View File

@ -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') {

View File

@ -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 });