Skip to content

Commit 2644cac

Browse files
committed
Merge remote-tracking branch 'main/develop' into MAGETWO-40172
2 parents de7db51 + 79fa1ec commit 2644cac

File tree

13 files changed

+164
-35
lines changed

13 files changed

+164
-35
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
define([
77
'jquery',
88
'mage/template',
9-
'jquery/ui'
9+
'jquery/ui',
10+
'baseImage'
1011
], function ($, mageTemplate) {
1112
'use strict';
1213

app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<?php
1111
$element = $block->getElement();
1212
$fieldId = ($element->getHtmlContainerId()) ? ' id="' . $element->getHtmlContainerId() . '"' : '';
13-
$fieldClass = "field field-{$element->getId()} {$element->getCssClass()}";
13+
$fieldClass = "field admin__field field-{$element->getId()} {$element->getCssClass()}";
1414
$fieldClass .= ($element->getRequired()) ? ' required' : '';
1515
$fieldAttributes = $fieldId . ' class="' . $fieldClass . '" ' . $block->getUiId('form-field', $element->getId());
1616
?>
1717

1818
<div<?php /* @escapeNotVerified */ echo $fieldAttributes ?>>
1919
<?php echo $element->getLabelHtml() ?>
20-
<div class="control">
20+
<div class="control admin__field-control">
2121
<div class="rule-tree">
2222
<div class="rule-tree-wrapper">
2323
<?php echo $block->getInputHtml() ?>

app/code/Magento/Checkout/view/frontend/web/js/action/select-billing-address.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ define(
88
'jquery',
99
'../model/quote'
1010
],
11-
function($, quote) {
12-
"use strict";
13-
return function(billingAddress) {
11+
function ($, quote) {
12+
'use strict';
13+
14+
return function (billingAddress) {
1415
var address = null;
16+
1517
if (quote.shippingAddress() && billingAddress.getCacheKey() == quote.shippingAddress().getCacheKey()) {
1618
address = $.extend({}, billingAddress);
1719
address.saveInAddressBook = false;
18-
if (quote.shippingAddress().saveInAddressBook || quote.shippingAddress().save_in_address_book) {
19-
address.saveInAddressBook = true;
20-
quote.shippingAddress().saveInAddressBook = false;
21-
}
2220
} else {
2321
address = billingAddress;
2422
}

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-save-processor/default.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,47 @@
66
define(
77
[
88
'ko',
9-
'jquery',
109
'Magento_Checkout/js/model/quote',
1110
'Magento_Checkout/js/model/resource-url-manager',
1211
'mage/storage',
1312
'Magento_Checkout/js/model/payment-service',
1413
'Magento_Checkout/js/model/payment/method-converter',
1514
'Magento_Checkout/js/model/error-processor',
16-
'Magento_Checkout/js/model/full-screen-loader'
15+
'Magento_Checkout/js/model/full-screen-loader',
16+
'Magento_Checkout/js/action/select-billing-address'
1717
],
1818
function (
1919
ko,
20-
$,
2120
quote,
2221
resourceUrlManager,
2322
storage,
2423
paymentService,
2524
methodConverter,
2625
errorProcessor,
27-
fullScreenLoader
26+
fullScreenLoader,
27+
selectBillingAddressAction
2828
) {
2929
'use strict';
30+
3031
return {
31-
saveShippingInformation: function() {
32-
var billingAddress = quote.billingAddress();
33-
if (!billingAddress) {
34-
billingAddress = $.extend({}, quote.shippingAddress());
35-
quote.billingAddress(billingAddress);
36-
quote.shippingAddress().sameAsBilling = 1;
32+
saveShippingInformation: function () {
33+
var payload;
34+
35+
if (!quote.billingAddress()) {
36+
selectBillingAddressAction(quote.shippingAddress());
3737
}
38-
var payload = {
38+
39+
payload = {
3940
addressInformation: {
4041
shipping_address: quote.shippingAddress(),
41-
billing_address: billingAddress,
42+
billing_address: quote.billingAddress(),
4243
shipping_method_code: quote.shippingMethod().method_code,
4344
shipping_carrier_code: quote.shippingMethod().carrier_code
4445
}
4546
};
4647

4748
fullScreenLoader.startLoader();
49+
4850
return storage.post(
4951
resourceUrlManager.getUrlForSetShippingInformation(quote),
5052
JSON.stringify(payload)

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
192192
$customerModel->setRpToken(null);
193193
$customerModel->setRpTokenCreatedAt(null);
194194
}
195-
196-
$this->customerResourceModel->save($customerModel);
195+
$customerModel->save();
197196
$this->customerRegistry->push($customerModel);
198197
$customerId = $customerModel->getId();
199198

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public function testSave()
268268
'setRpTokenCreatedAt',
269269
'getDataModel',
270270
'setPasswordHash',
271+
'save',
271272
],
272273
[],
273274
'',
@@ -402,9 +403,8 @@ public function testSave()
402403
$customerModel->expects($this->atLeastOnce())
403404
->method('getId')
404405
->willReturn($customerId);
405-
$this->customerResourceModel->expects($this->once())
406-
->method('save')
407-
->with($customerModel);
406+
$customerModel->expects($this->once())
407+
->method('save');
408408
$this->customerRegistry->expects($this->once())
409409
->method('push')
410410
->with($customerModel);
@@ -486,6 +486,7 @@ public function testSaveWithPasswordHash()
486486
'setRpTokenCreatedAt',
487487
'getDataModel',
488488
'setPasswordHash',
489+
'save',
489490
],
490491
[],
491492
'',
@@ -579,9 +580,8 @@ public function testSaveWithPasswordHash()
579580
$customerModel->expects($this->atLeastOnce())
580581
->method('getId')
581582
->willReturn($customerId);
582-
$this->customerResourceModel->expects($this->once())
583-
->method('save')
584-
->with($customerModel);
583+
$customerModel->expects($this->once())
584+
->method('save');
585585
$this->customerRegistry->expects($this->once())
586586
->method('push')
587587
->with($customerModel);

app/code/Magento/CustomerImportExport/Model/Import/Address.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ protected function _prepareDataForUpdate(array $rowData)
543543
}
544544

545545
// let's try to find region ID
546+
$entityRow['region_id'] = null;
546547
if (!empty($rowData[self::COLUMN_REGION])) {
547548
$countryNormalized = strtolower($rowData[self::COLUMN_COUNTRY_ID]);
548549
$regionNormalized = strtolower($rowData[self::COLUMN_REGION]);

app/code/Magento/Tax/etc/config.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<defaults>
2727
<country>US</country>
2828
<region>0</region>
29-
<postcode>*</postcode>
3029
</defaults>
3130
<display>
3231
<type>1</type>
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
// /**
2+
// * Copyright © 2015 Magento. All rights reserved.
3+
// * See COPYING.txt for license details.
4+
// */
5+
6+
//
7+
// Rule tree component
8+
// _____________________________________________
9+
10+
.rule-tree-wrapper {
11+
line-height: 28px;
12+
}
13+
14+
.rule-tree {
15+
.admin__field-control & {
16+
padding-top: .3rem;
17+
}
18+
ul {
19+
list-style: none;
20+
padding-left: 16px;
21+
border-left: dotted 1px #888;
22+
}
23+
li {
24+
margin: 0 0 10px;
25+
}
26+
.x-tree ul {
27+
padding-left: 0 !important;
28+
border-left: none !important;
29+
}
30+
}
31+
32+
.rule-tree .fieldset {
33+
min-width: 0; // Fixed Chrome fieldset issue
34+
}
35+
36+
@-moz-document url-prefix() { // Fixed Firefox fieldset issue
37+
.rule-tree .fieldset {
38+
display: table-cell;
39+
}
40+
}
41+
42+
.rule-param .label {
43+
color: #000;
44+
float: none;
45+
text-align: left;
46+
padding: 0;
47+
vertical-align: baseline;
48+
width: auto;
49+
}
50+
51+
.rule-param .label-disabled {
52+
color: #eee;
53+
cursor: default;
54+
text-decoration: none;
55+
}
56+
57+
.rule-chooser,
58+
.rule-param .element,
59+
.rule-param-edit .label {
60+
display: none;
61+
}
62+
63+
.rule-chooser .field-row {
64+
.lib-clearfix();
65+
display: block;
66+
margin-bottom: 17px;
67+
.input-text {
68+
margin-top: 5px;
69+
}
70+
.ui-datepicker-trigger {
71+
margin-left: 5px;
72+
margin-top:-2px;
73+
}
74+
}
75+
76+
.rule-param input,
77+
.rule-param select {
78+
width: auto !important;
79+
margin: 0;
80+
min-width: 170px;
81+
}
82+
83+
.rule-param-edit .element {
84+
display: inline;
85+
}
86+
87+
.rule-param-edit .element .addafter {
88+
padding-left: 5px;
89+
}
90+
91+
[class^="rule-param-"] img,
92+
.rule-chooser-trigger img {
93+
vertical-align: middle;
94+
}
95+
96+
.rule-chooser {
97+
border: solid 1px #CCC;
98+
margin: 20px;
99+
padding: 15px 10px 5px;
100+
overflow: auto;
101+
}
102+
103+
.rule-param-wait {
104+
background: url(../mui/images/ajax-loader-small.gif) no-repeat left center;
105+
padding-left: 20px;
106+
}

app/design/adminhtml/Magento/backend/web/css/styles.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
// ToDo UI: Temporary. Should be changed
5252
@import 'source/components/_calendar-temp.less';
53+
@import 'source/components/_rules-temp.less';
5354

5455
//
5556
// Media queries collector

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductPage.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ protected function verifyPrice()
4242
{
4343
$priceBlock = $this->productView->getPriceBlock();
4444
$formPrice = $priceBlock->isOldPriceVisible() ? $priceBlock->getOldPrice() : $priceBlock->getPrice();
45-
$priceData = $this->product->getDataFieldConfig('price')['source']->getPriceData();
46-
$fixturePrice = number_format($priceData['category_price'], 2, '.', '');
45+
$fixturePrice = $this->getLowestConfigurablePrice();
4746

4847
if ($fixturePrice != $formPrice) {
4948
return "Displayed product price on product page(front-end) not equals passed from fixture. "
@@ -97,4 +96,24 @@ protected function verifyAttributes()
9796
$errors = $this->verifyData($configurableOptions, $formOptions, true, false);
9897
return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');
9998
}
99+
100+
/**
101+
* Returns lowest possible price of configurable product.
102+
*
103+
* @return string
104+
*/
105+
protected function getLowestConfigurablePrice()
106+
{
107+
$price = null;
108+
$configurableOptions = $this->product->getConfigurableAttributesData();
109+
110+
foreach ($configurableOptions['matrix'] as $option) {
111+
$price = $price === null ? $option['price'] : $price;
112+
if ($price > $option['price']) {
113+
$price = $option['price'];
114+
}
115+
}
116+
117+
return $price;
118+
}
100119
}

dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ public function selectItems(array $items, $isSortable = true)
297297
$this->waitLoader();
298298
$selectItem = $this->getRow($item)->find($this->selectItem);
299299
do {
300-
if ($selectItem->isVisible() && !$selectItem->isSelected()) {
301-
$selectItem->click();
300+
if ($selectItem->isVisible()) {
301+
if (!$selectItem->isSelected()) {
302+
$selectItem->click();
303+
}
302304
break;
303305
}
304306
} while ($this->nextPage());

dev/tests/integration/testsuite/Magento/CustomerImportExport/Model/Import/_files/address_import_update.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
"admin","[email protected]",1,,,"US",,"Katy","Parker","T.",19107,,,,"1079 Rocky Road",,"215-629-9720",,,,,,,1
33
"admin","[email protected]",3,"Phoenix",,"US",,"Brad","Brown","H.",85034,,"Arizona",4,"4225 Martha Street",,"928-707-1577",,,,,,1,
44
"admin","[email protected]",,"Tallahassee",,"US",,"William ","Compton","M.",32301,,"Florida",18,"1973 Drainer Avenue",,"850-590-7403",,,,,,,
5+
"admin","[email protected]",,"Tallahassee",,"UA",,"An ","Compton","M.",32301,,,18,"1973 Drainer Avenue",,"850-590-7403",,,,,,,

0 commit comments

Comments
 (0)