Skip to content

Commit

Permalink
Merge pull request #527 from magento-fearless-kiwis/develop
Browse files Browse the repository at this point in the history
 [FearlessKiwis] Sprint 64: Bug fixes
  • Loading branch information
He, Joan(johe) committed Apr 11, 2016
2 parents 052e789 + a559d23 commit 4e1a1bc
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/code/Magento/Quote/Model/QuoteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public function getActiveForCustomer($customerId, array $sharedStoreIds = [])
public function save(\Magento\Quote\Api\Data\CartInterface $quote)
{
if ($quote->getId()) {
$currentQuote = $this->get($quote->getId());
$currentQuote = $this->get($quote->getId(), [$quote->getStoreId()]);
$currentQuote->setStoreId($quote->getStoreId());
// This part has to be refactored
if ($quote->getBillingAddress()) {
$currentQuote->setBillingAddress($quote->getBillingAddress());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
<ul class="note-list">
<?php foreach ($_entity->getCommentsCollection(true) as $_comment): ?>
<li>
<span class="note-list-date"><?php /* @escapeNotVerified */ echo $block->formatDate($_comment->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-time"><?php /* @escapeNotVerified */ echo $block->formatTime($_comment->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-date"><?php /* @noEscape */ echo $block->formatDate($_comment->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-time"><?php /* @noEscape */ echo $block->formatTime($_comment->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-customer">
<?php /* @escapeNotVerified */ echo __('Customer') ?>
<?php if ($_comment->getIsCustomerNotified()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<ul class="note-list">
<?php foreach ($block->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
<li class="note-list-item">
<span class="note-list-date"><?php /* @escapeNotVerified */ echo $block->formatDate($_item->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-time"><?php /* @escapeNotVerified */ echo $block->formatTime($_item->getCreatedAtDate(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-date"><?php /* @noEscape */ echo $block->formatDate($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-time"><?php /* @noEscape */ echo $block->formatTime($_item->getCreatedAt(), \IntlDateFormatter::MEDIUM) ?></span>
<span class="note-list-status"><?php /* @escapeNotVerified */ echo $_item->getStatusLabel() ?></span>
<span class="note-list-customer">
<?php /* @escapeNotVerified */ echo __('Customer') ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
*/

define([
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select'
], function (uiRegistry, select) {
], function (_, uiRegistry, select) {
'use strict';

return select.extend({
Expand All @@ -20,6 +21,34 @@ define([
if (this.value() != this.displayOnlyForCouponType) {
uiRegistry.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation').checked(false);
}

this.enableDisableFields();
},

/**
* Enable/disable fields on Coupons tab
*/
enableDisableFields: function () {
var selector,
isUseAutoGenerationChecked,
couponType,
disableAuto;

selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
'[id=sales-rule-form-tab-coupons] button';
isUseAutoGenerationChecked = uiRegistry
.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')
.checked();
couponType = uiRegistry
.get('sales_rule_form.sales_rule_form.rule_information.coupon_type')
.value();
disableAuto = couponType === 3 || isUseAutoGenerationChecked;
_.each(
document.querySelectorAll(selector),
function (element) {
element.disabled = !disableAuto;
}
);
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,33 @@ define([
},

/*eslint-enable no-unused-vars*/
/*eslint-disable lines-around-comment*/

/**
* Enable/disable fields on Coupons tab
*/
enableDisableFields: function () {
var selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
'[id=sales-rule-form-tab-coupons] button',
isUseAutoGenerationChecked = !uiRegistry
var selector,
isUseAutoGenerationChecked,
couponType,
disableAuto;

selector = '[id=sales-rule-form-tab-coupons] input, [id=sales-rule-form-tab-coupons] select, ' +
'[id=sales-rule-form-tab-coupons] button';
isUseAutoGenerationChecked = uiRegistry
.get('sales_rule_form.sales_rule_form.rule_information.use_auto_generation')
.checked();

couponType = uiRegistry
.get('sales_rule_form.sales_rule_form.rule_information.coupon_type')
.value();
/**
* \Magento\Rule\Model\AbstractModel::COUPON_TYPE_AUTO
*/
disableAuto = couponType === 3 || isUseAutoGenerationChecked;
_.each(
document.querySelectorAll(selector),
function (element) {
element.disabled = isUseAutoGenerationChecked;
element.disabled = !disableAuto;
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<strategy>xpath</strategy>
<fields>
<conditions_serialized>
<selector>#sales_rule_formrule_conditions_fieldset_</selector>
<selector>.fieldset[id^="sales_rule_formrule_conditions_fieldset_"]</selector>
<input>conditions</input>
</conditions_serialized>
</fields>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class Curl extends Conditions implements SalesRuleInterface
*/
protected $mappingData = [
'is_active' => [
'Active' => 1,
'Inactive' => 0,
'Yes' => 1,
'No' => 0,
],
'coupon_type' => [
'No Coupon' => 1,
Expand Down

0 comments on commit 4e1a1bc

Please sign in to comment.