Skip to content

Commit e9107e2

Browse files
authored
Merge pull request #792 from crossroads/release-split-quantity
[Release] Stock v0.19.6
2 parents 0d533d3 + 5735a2a commit e9107e2

File tree

7 files changed

+52
-35
lines changed

7 files changed

+52
-35
lines changed

app/components/quantity-chooser.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export default Ember.Component.extend(AsyncMixin, {
6868

6969
this.resetValue();
7070
this.set("displayChooseQtyOverlay", false);
71+
this.sendAction("toggleShowExtendedFooterMenu");
72+
7173
}
7274
}
7375
});

app/styles/_custom.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ h2{
2424
}
2525

2626
.split-quantity {
27-
color: #fff !important;
28-
font-size: 0.9rem !important;
29-
@media #{$small-only} {
30-
font-size: 0.72rem !important;
27+
text-align: center;
28+
flex-direction: column;
29+
display: flex;
30+
width: 100%;
31+
32+
#icon{
33+
margin-bottom: 0.3rem;
3134
}
3235
}
3336

app/templates/components/quantity-chooser.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<span {{action 'resetValueAndToggleOverlay'}} class="split-quantity">
2-
<i aria-hidden="true">{{fa-icon 'clone'}}</i>
1+
<div {{action 'resetValueAndToggleOverlay'}} class="split-quantity">
2+
<i aria-hidden="true" id="icon">{{fa-icon 'clone'}}</i>
33
{{t "split_quantity.title"}}
4-
</span>
4+
</div>
55

66
{{#message-box isVisible=displayChooseQtyOverlay classNames="popupOverlay split-popup"}}
77
<div class="split-item-header">{{t "split_quantity.header"}}</div>

app/templates/items/detail/_tabs.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838
<div class="subtab">
3939
<div class="icon-holder">{{fa-icon (if model.allowWebPublish 'eye' 'eye-slash') size="lg"}}</div>
40-
<div class="text-holder"> {{ model.availableQuantity }} </div>
40+
<div class="inventory-holder"> {{ model.availableQuantity }} </div>
4141
</div>
4242
</div>
4343
</div>

app/templates/items/sticky_footer.hbs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
</li>
3434
{{/if}}
3535
{{/each}}
36+
{{#if (is-greater item.availableQuantity 1)}}
37+
<li class="menu ">
38+
{{quantity-chooser item=item toggleShowExtendedFooterMenu=(toggle this "showExtendedFooterMenu") }}
39+
</li>
40+
{{/if}}
3641
</ul>
3742
</div>
3843
</div>
@@ -77,4 +82,5 @@
7782
<i>{{fa-icon 'bars'}}</i> {{t "items.action_label"}}
7883
</li>
7984
{{/if}}
80-
{{/sticky-footer}}
85+
{{/sticky-footer}}
86+

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.19.5",
3+
"version": "0.19.6",
44
"private": true,
55
"directories": {
66
"doc": "doc",

tests/acceptance/split-quantity-of-items-test.js

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
// $.mockjaxSettings.matchInRegistrationOrder = false;
5656
// mocks.push(
5757
// $.mockjax({
58-
// url: "/api/v1/auth/current_user_profil*",
58+
// url: "/api/v1/auth/current_user_profile*",
5959
// responseText: data
6060
// }),
6161
// $.mockjax({
62-
// url: "/api/v1/orders/summar*",
62+
// url: "/api/v1/orders/summary*",
6363
// responseText: {
6464
// submitted: 14,
6565
// awaiting_dispatch: 1,
@@ -109,15 +109,18 @@
109109
// });
110110
// mocks.push(
111111
// $.mockjax({
112-
// url: `/items/${updatedPkg.id}/split_ite*`,
112+
// url: `/items/${updatedPkg.id}/split_item*`,
113113
// type: "PUT",
114114
// status: 200,
115115
// responseText: updatedPkg
116116
// })
117117
// );
118118
// visit("/");
119119
// andThen(function() {
120-
// visit(`/items/${updatedPkg.id}`);
120+
// visit(`/items/${updatedPkg.id}/publishing`);
121+
// });
122+
// andThen(function() {
123+
// click(".small-block-grid-4 li:last");
121124
// });
122125
// andThen(function() {
123126
// click(".split-quantity");
@@ -129,12 +132,7 @@
129132
// click(".split-item-btn");
130133
// });
131134
// andThen(function() {
132-
// assert.equal(
133-
// +Ember.$(".item-quantity")
134-
// .text()
135-
// .trim(),
136-
// 18
137-
// );
135+
// assert.equal($(".inventory-holder").text(), 18);
138136
// });
139137
// });
140138

@@ -163,7 +161,7 @@
163161
// });
164162
// mocks.push(
165163
// $.mockjax({
166-
// url: `/items/${updatedPkg.id}/split_ite*`,
164+
// url: `/items/${updatedPkg.id}/split_item*`,
167165
// type: "PUT",
168166
// status: 200,
169167
// responseText: updatedPkg
@@ -175,6 +173,9 @@
175173
// visit(`/items/${updatedPkg.id}`);
176174
// });
177175
// andThen(function() {
176+
// click(".small-block-grid-4 li:last");
177+
// });
178+
// andThen(function() {
178179
// click(".split-quantity");
179180
// });
180181
// andThen(function() {
@@ -215,7 +216,7 @@
215216
// });
216217
// mocks.push(
217218
// $.mockjax({
218-
// url: `/items/${updatedPkg.id}/split_ite*`,
219+
// url: `/items/${updatedPkg.id}/split_item*`,
219220
// type: "PUT",
220221
// status: 200,
221222
// responseText: updatedPkg
@@ -227,6 +228,9 @@
227228
// visit(`/items/${updatedPkg.id}`);
228229
// });
229230
// andThen(function() {
231+
// click(".small-block-grid-4 li:last");
232+
// });
233+
// andThen(function() {
230234
// click(".split-quantity");
231235
// });
232236
// andThen(function() {
@@ -267,7 +271,7 @@
267271
// });
268272
// mocks.push(
269273
// $.mockjax({
270-
// url: `/items/${updatedPkg.id}/split_ite*`,
274+
// url: `/items/${updatedPkg.id}/split_item*`,
271275
// type: "PUT",
272276
// status: 200,
273277
// responseText: updatedPkg
@@ -279,6 +283,9 @@
279283
// visit(`/items/${updatedPkg.id}`);
280284
// });
281285
// andThen(function() {
286+
// click(".small-block-grid-4 li:last");
287+
// });
288+
// andThen(function() {
282289
// click(".split-quantity");
283290
// });
284291
// andThen(function() {
@@ -323,7 +330,7 @@
323330
// });
324331
// mocks.push(
325332
// $.mockjax({
326-
// url: `/items/${updatedPkg.id}/split_ite*`,
333+
// url: `/items/${updatedPkg.id}/split_item*`,
327334
// type: "PUT",
328335
// status: 200,
329336
// responseText: updatedPkg
@@ -334,6 +341,9 @@
334341
// visit(`/items/${updatedPkg.id}`);
335342
// });
336343
// andThen(function() {
344+
// click(".small-block-grid-4 li:last");
345+
// });
346+
// andThen(function() {
337347
// click(".split-quantity");
338348
// });
339349
// andThen(function() {
@@ -378,15 +388,18 @@
378388
// });
379389
// mocks.push(
380390
// $.mockjax({
381-
// url: `/items/${updatedPkg.id}/split_ite*`,
391+
// url: `/items/${updatedPkg.id}/split_item*`,
382392
// type: "PUT",
383393
// status: 200,
384394
// responseText: updatedPkg
385395
// })
386396
// );
387397
// visit("/");
388398
// andThen(function() {
389-
// visit(`/items/${updatedPkg.id}`);
399+
// visit(`/items/${updatedPkg.id}/publishing`);
400+
// });
401+
// andThen(function() {
402+
// click(".small-block-grid-4 li:last");
390403
// });
391404
// andThen(function() {
392405
// click(".split-quantity");
@@ -398,13 +411,6 @@
398411
// click(".dont-split-btn");
399412
// });
400413
// andThen(function() {
401-
// assert.equal(
402-
// +Ember.$(".item-quantity")
403-
// .text()
404-
// .trim(),
405-
// 20
406-
// );
414+
// assert.equal($(".inventory-holder").text(), 20);
407415
// });
408-
// });
409-
410-
//Commented for now and wll be updated once split button is added in action field
416+
// });

0 commit comments

Comments
 (0)