Skip to content

Commit ea82b84

Browse files
Merge pull request #596 from crossroads/master
Jan2020 Release#3
2 parents 4cf2cb2 + 8b78340 commit ea82b84

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
11
import detail from "./detail";
2+
import _ from "lodash";
23

3-
export default detail.extend();
4+
export default detail.extend({
5+
autoLoad: true,
6+
/*
7+
* @type {Number}, perPage in response
8+
*/
9+
perPage: 25,
10+
ordersPkgLength: 0,
11+
sortProperties: ["id"],
12+
sortedGcRequests: Ember.computed.sort(
13+
"model.goodcityRequests",
14+
"sortProperties"
15+
),
16+
17+
actions: {
18+
loadOrdersPackages(pageNo) {
19+
const params = this.trimQuery(
20+
_.merge(
21+
{ order_id: this.get("orderId") },
22+
this.getPaginationQuery(pageNo)
23+
)
24+
);
25+
return this.get("store")
26+
.query("orders_package", params)
27+
.then(ordersPkgs => {
28+
this.set("ordersPkgLength", ordersPkgs.meta.orders_packages_count);
29+
return ordersPkgs;
30+
});
31+
}
32+
}
33+
});

app/controllers/orders/detail.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ import _ from "lodash";
77
const { getOwner } = Ember;
88

99
export default GoodcityController.extend(SearchMixin, {
10-
autoLoad: true,
11-
/*
12-
* @type {Number}, perPage in response
13-
*/
14-
perPage: 25,
15-
ordersPkgLength: 0,
1610
backLinkPath: "",
1711
displayAllItems: false,
1812
isMobileApp: config.cordova.enabled,
@@ -121,21 +115,6 @@ export default GoodcityController.extend(SearchMixin, {
121115
},
122116

123117
actions: {
124-
loadOrdersPackages(pageNo) {
125-
const params = this.trimQuery(
126-
_.merge(
127-
{ order_id: this.get("orderId") },
128-
this.getPaginationQuery(pageNo)
129-
)
130-
);
131-
return this.get("store")
132-
.query("orders_package", params)
133-
.then(ordersPkgs => {
134-
this.set("ordersPkgLength", ordersPkgs.meta.orders_packages_count);
135-
return ordersPkgs;
136-
});
137-
},
138-
139118
openSchedulePopup() {
140119
const scheduledAt = this.get("model.orderTransport.scheduledAt");
141120
try {

app/controllers/orders/requested_items.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/routes/orders/active_items.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import detail from "./detail";
33
export default detail.extend({
44
async setupController(controller, model = {}) {
55
await this._super(controller, model);
6+
controller.set("ordersPkgLength", 0);
67
controller.on();
78
},
89

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import detail from "./detail";
22

3-
export default detail.extend({});
3+
export default detail.extend({
4+
controllerName: "orders/active_items"
5+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stock",
3-
"version": "0.18.0",
3+
"version": "0.18.1",
44
"private": true,
55
"directories": {
66
"doc": "doc",

0 commit comments

Comments
 (0)