Skip to content

Commit 4e1a1bc

Browse files
author
He, Joan(johe)
committed
Merge pull request #527 from magento-fearless-kiwis/develop
[FearlessKiwis] Sprint 64: Bug fixes
2 parents 052e789 + a559d23 commit 4e1a1bc

File tree

7 files changed

+56
-14
lines changed

7 files changed

+56
-14
lines changed

app/code/Magento/Quote/Model/QuoteRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public function getActiveForCustomer($customerId, array $sharedStoreIds = [])
150150
public function save(\Magento\Quote\Api\Data\CartInterface $quote)
151151
{
152152
if ($quote->getId()) {
153-
$currentQuote = $this->get($quote->getId());
153+
$currentQuote = $this->get($quote->getId(), [$quote->getStoreId()]);
154+
$currentQuote->setStoreId($quote->getStoreId());
154155
// This part has to be refactored
155156
if ($quote->getBillingAddress()) {
156157
$currentQuote->setBillingAddress($quote->getBillingAddress());

app/code/Magento/Sales/view/adminhtml/templates/order/comments/view.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
<ul class="note-list">
5454
<?php foreach ($_entity->getCommentsCollection(true) as $_comment): ?>
5555
<li>
56-
<span class="note-list-date"><?php /* @escapeNotVerified */ echo $block->formatDate($_comment->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
57-
<span class="note-list-time"><?php /* @escapeNotVerified */ echo $block->formatTime($_comment->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
56+
<span class="note-list-date"><?php /* @noEscape */ echo $block->formatDate($_comment->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
57+
<span class="note-list-time"><?php /* @noEscape */ echo $block->formatTime($_comment->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
5858
<span class="note-list-customer">
5959
<?php /* @escapeNotVerified */ echo __('Customer') ?>
6060
<?php if ($_comment->getIsCustomerNotified()): ?>

app/code/Magento/Sales/view/adminhtml/templates/order/view/history.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<ul class="note-list">
7373
<?php foreach ($block->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
7474
<li class="note-list-item">
75-
<span class="note-list-date"><?php /* @escapeNotVerified */ echo $block->formatDate($_item->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
76-
<span class="note-list-time"><?php /* @escapeNotVerified */ echo $block->formatTime($_item->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
75+
<span class="note-list-date"><?php /* @noEscape */ echo $block->formatDate($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
76+
<span class="note-list-time"><?php /* @noEscape */ echo $block->formatTime($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
7777
<span class="note-list-status"><?php /* @escapeNotVerified */ echo $_item->getStatusLabel() ?></span>
7878
<span class="note-list-customer">
7979
<?php /* @escapeNotVerified */ echo __('Customer') ?>

app/code/Magento/SalesRule/view/base/web/js/form/element/coupon-type.js

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
*/
55

66
define([
7+
'underscore',
78
'uiRegistry',
89
'Magento_Ui/js/form/element/select'
9-
], function (uiRegistry, select) {
10+
], function (_, uiRegistry, select) {
1011
'use strict';
1112

1213
return select.extend({
@@ -20,6 +21,34 @@ define([
2021
if (this.value() != this.displayOnlyForCouponType) {
2122
uiRegistry.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation').checked(false);
2223
}
24+
25+
this.enableDisableFields();
26+
},
27+
28+
/**
29+
* Enable/disable fields on Coupons tab
30+
*/
31+
enableDisableFields: function () {
32+
var selector,
33+
isUseAutoGenerationChecked,
34+
couponType,
35+
disableAuto;
36+
37+
selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
38+
'[id=sales-rule-form-tab-coupons] button';
39+
isUseAutoGenerationChecked = uiRegistry
40+
.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')
41+
.checked();
42+
couponType = uiRegistry
43+
.get('sales_rule_form.sales_rule_form.rule_information.coupon_type')
44+
.value();
45+
disableAuto = couponType === 3 || isUseAutoGenerationChecked;
46+
_.each(
47+
document.querySelectorAll(selector),
48+
function (element) {
49+
element.disabled = !disableAuto;
50+
}
51+
);
2352
}
2453
});
2554
});

app/code/Magento/SalesRule/view/base/web/js/form/element/manage-coupon-codes.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,33 @@ define([
3939
},
4040

4141
/*eslint-enable no-unused-vars*/
42+
/*eslint-disable lines-around-comment*/
4243

4344
/**
4445
* Enable/disable fields on Coupons tab
4546
*/
4647
enableDisableFields: function () {
47-
var selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
48-
'[id=sales-rule-form-tab-coupons] button',
49-
isUseAutoGenerationChecked = !uiRegistry
48+
var selector,
49+
isUseAutoGenerationChecked,
50+
couponType,
51+
disableAuto;
52+
53+
selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
54+
'[id=sales-rule-form-tab-coupons] button';
55+
isUseAutoGenerationChecked = uiRegistry
5056
.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')
5157
.checked();
52-
58+
couponType = uiRegistry
59+
.get('sales_rule_form.sales_rule_form.rule_information.coupon_type')
60+
.value();
61+
/**
62+
* \Magento\Rule\Model\AbstractModel::COUPON_TYPE_AUTO
63+
*/
64+
disableAuto = couponType === 3 || isUseAutoGenerationChecked;
5365
_.each(
5466
document.querySelectorAll(selector),
5567
function (element) {
56-
element.disabled = isUseAutoGenerationChecked;
68+
element.disabled = !disableAuto;
5769
}
5870
);
5971
}

dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/PromoQuoteForm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<strategy>xpath</strategy>
4545
<fields>
4646
<conditions_serialized>
47-
<selector>#sales_rule_formrule_conditions_fieldset_</selector>
47+
<selector>.fieldset[id^="sales_rule_formrule_conditions_fieldset_"]</selector>
4848
<input>conditions</input>
4949
</conditions_serialized>
5050
</fields>

dev/tests/functional/tests/app/Magento/SalesRule/Test/Handler/SalesRule/Curl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class Curl extends Conditions implements SalesRuleInterface
102102
*/
103103
protected $mappingData = [
104104
'is_active' => [
105-
'Active' => 1,
106-
'Inactive' => 0,
105+
'Yes' => 1,
106+
'No' => 0,
107107
],
108108
'coupon_type' => [
109109
'No Coupon' => 1,

0 commit comments

Comments
 (0)