Fixed initial filters
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-06-02 14:42:58 +02:00
parent a0767a6ea2
commit 16d7186829
5 changed files with 18 additions and 15 deletions

View File

@ -78,7 +78,7 @@ export default class Searchbar extends Component {
}
fetchStateFilter(autoLoad) {
let filter = null;
let filter = this.filter ? this.filter : null;
if (this.$state.is(this.searchState)) {
if (this.$params.q) {

View File

@ -51,8 +51,11 @@
</vn-date-picker>
</vn-horizontal>
<vn-horizontal>
<vn-one>
</vn-one>
<vn-check vn-one
triple-state="true"
label="For me"
ng-model="filter.mine">
</vn-check>
<vn-check
vn-one
triple-state="true"

View File

@ -1,3 +1,4 @@
Ink: Tinta
Origin: Origen
Producer: Productor
Producer: Productor
For me: Para mi

View File

@ -1,6 +1,7 @@
<vn-crud-model
vn-id="model"
url="TicketRequests/filter"
user-params="::$ctrl.filterParams"
limit="20"
data="requests"
order="shipped DESC, isOk ASC"
@ -9,16 +10,16 @@
<vn-portal slot="topbar">
<vn-searchbar
panel="vn-request-search-panel"
suggested-filter="$ctrl.filter.where"
suggested-filter="$ctrl.filterParams"
info="Search request by id or alias"
filter="$ctrl.filter"
filter="$ctrl.filterParams"
model="model"
auto-state="false">
</vn-searchbar>
</vn-portal>
<vn-data-viewer model="model">
<vn-card>
<vn-table model="model">
<vn-table model="model" auto-load="false">
<vn-thead>
<vn-tr>
<vn-th field="ticketFk" number>Ticket ID</vn-th>
@ -82,7 +83,7 @@
{{request.itemDescription}}
</span>
</vn-td>
<vn-td>{{$ctrl.getState(request.isOk)}} {{request.isOk}}</vn-td>
<vn-td>{{$ctrl.getState(request.isOk)}}</vn-td>
<vn-td>
<vn-icon
ng-if="request.response.length"

View File

@ -14,13 +14,11 @@ export default class Controller extends Section {
lastWeek.setHours(0, 0, 0, 0);
lastWeek.setDate(lastWeek.getDate() - 7);
this.filter = {
where: {
isOk: false,
mine: true,
from: lastWeek,
to: today
}
this.filterParams = {
isOk: null,
mine: true,
from: lastWeek,
to: today
};
}
}