Merge pull request 'fixes #4682-searchbar_filter' (!1164) from 4682-searchbar_filter into dev
gitea/salix/pipeline/head There was a failure building this commit Details

Reviewed-on: #1164
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Vicent Llopis 2022-11-24 12:44:19 +00:00
commit 9517063853
3 changed files with 18 additions and 12 deletions

View File

@ -26,6 +26,7 @@ export default class Searchbar extends Component {
this.autoState = true; this.autoState = true;
this.separateIndex = true; this.separateIndex = true;
this.entityState = 'card.summary'; this.entityState = 'card.summary';
this.isIndex = false;
this.deregisterCallback = this.$transitions.onSuccess( this.deregisterCallback = this.$transitions.onSuccess(
{}, transition => this.onStateChange(transition)); {}, transition => this.onStateChange(transition));
@ -102,6 +103,9 @@ export default class Searchbar extends Component {
filter = {}; filter = {};
} }
let stateParts = this.$state.current.name.split('.');
this.isIndex = stateParts[1] == 'index';
this.doSearch(filter, 'state'); this.doSearch(filter, 'state');
} }
@ -198,7 +202,7 @@ export default class Searchbar extends Component {
} }
doSearch(filter, source) { doSearch(filter, source) {
if (filter === this.filter && source != 'state') return; if (filter === this.filter && !this.isIndex) return;
let promise = this.onSearch({$params: filter}); let promise = this.onSearch({$params: filter});
promise = promise || this.$q.resolve(); promise = promise || this.$q.resolve();
promise.then(data => this.onFilter(filter, source, data)); promise.then(data => this.onFilter(filter, source, data));

View File

@ -201,7 +201,7 @@
<vn-dialog <vn-dialog
vn-id="excludeDialog" vn-id="excludeDialog"
on-response="$ctrl.onExcludeResponse($response)" on-response="$ctrl.onExcludeResponse($response)"
message="{{$ctrl.isNew ? 'Exclusion' : 'Edit exclusion'}}" message="{{$ctrl.isNew ? 'Add exclusion' : 'Edit exclusion'}}"
on-open="$ctrl.onSearch($params)" on-open="$ctrl.onSearch($params)"
on-close="$ctrl.resetExclusions()"> on-close="$ctrl.resetExclusions()">
<tpl-body> <tpl-body>

View File

@ -8,3 +8,5 @@ All: Todo
Specific locations: Localizaciones concretas Specific locations: Localizaciones concretas
Locations where it is not distributed: Localizaciones en las que no se reparte Locations where it is not distributed: Localizaciones en las que no se reparte
You must select a location: Debes seleccionar una localización You must select a location: Debes seleccionar una localización
Add exclusion: Añadir exclusión
Edit exclusion: Editar exclusión