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

View File

@ -59,23 +59,23 @@
</span>
</div>
<vn-label-value
label="Closing"
label="Closing"
value="{{::row.hour | date:'HH:mm'}}">
</vn-label-value>
<vn-label-value
label="Traveling days"
label="Traveling days"
value="{{::row.travelingDays}}">
</vn-label-value>
<vn-label-value
label="Price"
label="Price"
value="{{::row.price | currency:'EUR':2}}">
</vn-label-value>
<vn-label-value
label="Bonus"
label="Bonus"
value="{{::row.bonus | currency:'EUR':2}}">
</vn-label-value>
<vn-label-value
label="Max m³"
label="Max m³"
value="{{::row.m3Max}}">
</vn-label-value>
</vn-item-section>
@ -97,7 +97,7 @@
vn-bind="+"
fixed-bottom-right>
</vn-float-button>
<vn-dialog
<vn-dialog
vn-id="includeDialog"
on-response="$ctrl.onIncludeResponse($response)"
message="{{$ctrl.isNew ? 'Add event' : 'Edit event'}}">
@ -193,15 +193,15 @@
</button>
</tpl-buttons>
</vn-dialog>
<vn-confirm
<vn-confirm
vn-id="confirm"
message="This item will be deleted"
question="Are you sure you want to continue?">
</vn-confirm>
<vn-dialog
<vn-dialog
vn-id="excludeDialog"
on-response="$ctrl.onExcludeResponse($response)"
message="{{$ctrl.isNew ? 'Exclusion' : 'Edit exclusion'}}"
message="{{$ctrl.isNew ? 'Add exclusion' : 'Edit exclusion'}}"
on-open="$ctrl.onSearch($params)"
on-close="$ctrl.resetExclusions()">
<tpl-body>
@ -220,7 +220,7 @@
<vn-radio
ng-model="$ctrl.excludeSelected.type"
label="Specific locations"
on-change="$ctrl.onSearch($params)"
on-change="$ctrl.onSearch($params)"
val="specificLocations">
</vn-radio>
</vn-vertical>
@ -248,7 +248,7 @@
ng-model="item.checked"
ng-click="$event.preventDefault()"
on-change="$ctrl.onItemCheck(item.id, value)"
label="{{::item.name}}">
label="{{::item.name}}">
</vn-check>
</vn-treeview>
</div>

View File

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