Skip to content

Commit 5a0c668

Browse files
committed
Merge branch 'develop' into MAGETWO-51586
2 parents de8421d + adc1c6e commit 5a0c668

File tree

26 files changed

+213
-84
lines changed

26 files changed

+213
-84
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ protected function createNewCategoryModal(array $meta)
104104
'config' => [
105105
'isTemplate' => false,
106106
'componentType' => 'modal',
107-
'dataScope' => 'data.new_category',
108107
'options' => [
109108
'title' => __('New Category'),
110109
],
@@ -193,7 +192,6 @@ protected function customizeCategoriesField(array $meta)
193192
'levelsVisibility' => '1',
194193
'elementTmpl' => 'ui/grid/filters/elements/ui-select',
195194
'options' => $this->getCategoriesTree(),
196-
'scopeLabel' => null,
197195
'listens' => [
198196
'index=create_category:responseData' => 'setParsed',
199197
'newOption' => 'toggleOptionSelected'

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,12 @@ protected function customizeNewDateRangeField(array $meta)
259259
if ($fromFieldPath && $toFieldPath) {
260260
$fromContainerPath = $this->arrayManager->slicePath($fromFieldPath, 0, -2);
261261
$toContainerPath = $this->arrayManager->slicePath($toFieldPath, 0, -2);
262-
$scopeLabel = $this->arrayManager->get($fromFieldPath . self::META_CONFIG_PATH . '/scopeLabel', $meta);
263262

264263
$meta = $this->arrayManager->merge(
265264
$fromFieldPath . self::META_CONFIG_PATH,
266265
$meta,
267266
[
268267
'label' => __('Set Product as New From'),
269-
'scopeLabel' => null,
270268
'additionalClasses' => 'admin__field-date',
271269
]
272270
);
@@ -287,7 +285,6 @@ protected function customizeNewDateRangeField(array $meta)
287285
'additionalClasses' => 'admin__control-grouped-date',
288286
'breakLine' => false,
289287
'component' => 'Magento_Ui/js/form/components/group',
290-
'scopeLabel' => $scopeLabel,
291288
]
292289
);
293290
$meta = $this->arrayManager->set(

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/ScheduleDesignUpdate.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ protected function customizeDateRangeField(array $meta)
6868
$toFieldPath = $this->arrayManager->findPath(self::CODE_CUSTOM_DESIGN_TO, $meta, null, 'children');
6969
$fromContainerPath = $this->arrayManager->slicePath($fromFieldPath, 0, -2);
7070
$toContainerPath = $this->arrayManager->slicePath($toFieldPath, 0, -2);
71-
$scopeLabel = $this->arrayManager->get($fromFieldPath . self::META_CONFIG_PATH . '/scopeLabel', $meta);
7271

7372
$meta = $this->arrayManager->merge(
7473
$fromFieldPath . self::META_CONFIG_PATH,
7574
$meta,
7675
[
7776
'label' => __('Schedule Update From'),
78-
'scopeLabel' => null,
7977
'additionalClasses' => 'admin__field-date',
8078
]
8179
);
@@ -96,7 +94,6 @@ protected function customizeDateRangeField(array $meta)
9694
'additionalClasses' => 'admin__control-grouped-date',
9795
'breakLine' => false,
9896
'component' => 'Magento_Ui/js/form/components/group',
99-
'scopeLabel' => $scopeLabel,
10097
]
10198
);
10299
$meta = $this->arrayManager->set(

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,11 @@
552552
<field name="custom_design_from">
553553
<argument name="data" xsi:type="array">
554554
<item name="config" xsi:type="array">
555+
<item name="label" xsi:type="string" translate="true">Schedule Update From</item>
555556
<item name="additionalClasses" xsi:type="string">admin__field-date</item>
556557
<item name="sortOrder" xsi:type="number">230</item>
557558
<item name="dataType" xsi:type="string">string</item>
558559
<item name="formElement" xsi:type="string">date</item>
559-
<item name="scopeLabel" xsi:type="string"/>
560560
<item name="imports" xsi:type="array">
561561
<item name="disabled" xsi:type="string">ns = ${ $.ns }, index = custom_use_parent_settings :checked</item>
562562
</item>

app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ private function prepareMeta()
176176
'visible' => '1',
177177
'require' => '0',
178178
'additionalClasses' => 'admin__field-small',
179+
'label' => __('Quantity'),
180+
'scopeLabel' => '[GLOBAL]',
179181
'dataScope' => 'qty',
180182
'validation' => [
181183
'validate-number' => true,

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@
5050
<field name="manage_stock">
5151
<argument name="data" xsi:type="array">
5252
<item name="config" xsi:type="array">
53+
<item name="label" xsi:type="string" translate="true">Manage Stock</item>
5354
<item name="formElement" xsi:type="string">select</item>
5455
<item name="rawOptions" xsi:type="boolean">true</item>
5556
<item name="dataScope" xsi:type="string">manage_stock</item>
57+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
5658
<item name="value" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
5759
</item>
5860
<item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Yesno</item>
@@ -122,8 +124,10 @@
122124
<field name="min_qty">
123125
<argument name="data" xsi:type="array">
124126
<item name="config" xsi:type="array">
127+
<item name="label" xsi:type="string" translate="true">Out-of-Stock Threshold</item>
125128
<item name="formElement" xsi:type="string">input</item>
126129
<item name="dataScope" xsi:type="string">min_qty</item>
130+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
127131
<item name="validation" xsi:type="array">
128132
<item name="validate-number" xsi:type="boolean">true</item>
129133
</item>
@@ -171,9 +175,11 @@
171175
<field name="min_sale_qty">
172176
<argument name="data" xsi:type="array">
173177
<item name="config" xsi:type="array">
178+
<item name="label" xsi:type="string" translate="true">Minimum Qty Allowed in Shopping Cart</item>
174179
<item name="component" xsi:type="string">Magento_CatalogInventory/js/components/qty-validator-changer</item>
175180
<item name="formElement" xsi:type="string">input</item>
176181
<item name="dataScope" xsi:type="string">min_sale_qty</item>
182+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
177183
<item name="validation" xsi:type="array">
178184
<item name="validate-number" xsi:type="boolean">true</item>
179185
<item name="validate-digits" xsi:type="boolean">true</item>
@@ -225,8 +231,10 @@
225231
<field name="max_sale_qty">
226232
<argument name="data" xsi:type="array">
227233
<item name="config" xsi:type="array">
234+
<item name="label" xsi:type="string" translate="true">Maximum Qty Allowed in Shopping Cart</item>
228235
<item name="formElement" xsi:type="string">input</item>
229236
<item name="dataScope" xsi:type="string">max_sale_qty</item>
237+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
230238
<item name="validation" xsi:type="array">
231239
<item name="validate-number" xsi:type="boolean">true</item>
232240
</item>
@@ -314,9 +322,11 @@
314322
<field name="backorders">
315323
<argument name="data" xsi:type="array">
316324
<item name="config" xsi:type="array">
325+
<item name="label" xsi:type="string" translate="true">Backorders</item>
317326
<item name="formElement" xsi:type="string">select</item>
318327
<item name="rawOptions" xsi:type="boolean">true</item>
319328
<item name="dataScope" xsi:type="string">backorders</item>
329+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
320330
<item name="value" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
321331
</item>
322332
<item name="options" xsi:type="object">Magento\CatalogInventory\Model\Source\Backorders</item>
@@ -353,7 +363,7 @@
353363
<item name="config" xsi:type="array">
354364
<item name="formElement" xsi:type="string">container</item>
355365
<item name="component" xsi:type="string">Magento_Ui/js/form/components/group</item>
356-
<item name="label" xsi:type="string" translate="true">Use deferred Stock update</item>
366+
<item name="label" xsi:type="string" translate="true">Use Deferred Stock Update</item>
357367
<item name="dataScope" xsi:type="string">stock_data</item>
358368
<item name="sortOrder" xsi:type="number">850</item>
359369
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
@@ -362,6 +372,8 @@
362372
<field name="deferred_stock_update">
363373
<argument name="data" xsi:type="array">
364374
<item name="config" xsi:type="array">
375+
<item name="label" xsi:type="string" translate="true">Use Deferred Stock Update</item>
376+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
365377
<item name="formElement" xsi:type="string">select</item>
366378
<item name="rawOptions" xsi:type="boolean">true</item>
367379
<item name="dataScope" xsi:type="string">deferred_stock_update</item>
@@ -413,7 +425,9 @@
413425
<field name="notify_stock_qty">
414426
<argument name="data" xsi:type="array">
415427
<item name="config" xsi:type="array">
428+
<item name="label" xsi:type="string" translate="true">Notify for Quantity Below</item>
416429
<item name="formElement" xsi:type="string">input</item>
430+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
417431
<item name="dataScope" xsi:type="string">notify_stock_qty</item>
418432
<item name="validation" xsi:type="array">
419433
<item name="validate-number" xsi:type="boolean">true</item>
@@ -462,8 +476,10 @@
462476
<field name="enable_qty_increments">
463477
<argument name="data" xsi:type="array">
464478
<item name="config" xsi:type="array">
479+
<item name="label" xsi:type="string" translate="true">Enable Qty Increments</item>
465480
<item name="formElement" xsi:type="string">select</item>
466481
<item name="rawOptions" xsi:type="boolean">true</item>
482+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
467483
<item name="dataScope" xsi:type="string">enable_qty_increments</item>
468484
<item name="value" xsi:type="object">Magento\CatalogInventory\Model\Source\StockConfiguration</item>
469485
</item>
@@ -513,9 +529,11 @@
513529
<field name="qty_increments">
514530
<argument name="data" xsi:type="array">
515531
<item name="config" xsi:type="array">
532+
<item name="label" xsi:type="string" translate="true">Qty Increments</item>
516533
<item name="component" xsi:type="string">Magento_CatalogInventory/js/components/qty-validator-changer</item>
517534
<item name="formElement" xsi:type="string">input</item>
518535
<item name="dataScope" xsi:type="string">qty_increments</item>
536+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
519537
<item name="validation" xsi:type="array">
520538
<item name="validate-number" xsi:type="boolean">true</item>
521539
<item name="validate-digits" xsi:type="boolean">true</item>
@@ -570,6 +588,8 @@
570588
<field name="is_in_stock">
571589
<argument name="data" xsi:type="array">
572590
<item name="config" xsi:type="array">
591+
<item name="label" xsi:type="string" translate="true">Stock Status</item>
592+
<item name="scopeLabel" xsi:type="string">[GLOBAL]</item>
573593
<item name="formElement" xsi:type="string">select</item>
574594
<item name="dataScope" xsi:type="string">is_in_stock</item>
575595
<item name="value" xsi:type="number">1</item>

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ define(
1111
'../model/address-converter',
1212
'../action/select-shipping-address',
1313
'./postcode-validator',
14-
'mage/translate'
14+
'mage/translate',
15+
'uiRegistry'
1516
],
16-
function ($, ko, shippingRatesValidationRules, addressConverter, selectShippingAddress, postcodeValidator, $t) {
17+
function (
18+
$,
19+
ko,
20+
shippingRatesValidationRules,
21+
addressConverter,
22+
selectShippingAddress,
23+
postcodeValidator,
24+
$t,
25+
uiRegistry
26+
) {
1727
'use strict';
1828

1929
var checkoutConfig = window.checkoutConfig,
@@ -45,26 +55,52 @@ define(
4555
});
4656
},
4757

58+
/**
59+
* Perform postponed binding for fieldset elements
60+
*
61+
* @param {String} formPath
62+
*/
63+
initFields: function (formPath) {
64+
var self = this,
65+
elements = shippingRatesValidationRules.getObservableFields();
66+
67+
$.each(elements, function (index, field) {
68+
uiRegistry.async(formPath + '.' + field)(self.doElementBinding.bind(self));
69+
});
70+
},
71+
72+
/**
73+
* Bind shipping rates request to form element
74+
*
75+
* @param {Object} element
76+
* @param {Boolean} force
77+
* @param {Number} delay
78+
*/
79+
doElementBinding: function (element, force, delay) {
80+
var observableFields = shippingRatesValidationRules.getObservableFields();
81+
82+
if (element && (observableFields.indexOf(element.index) !== -1 || force)) {
83+
if (element.index !== 'postcode') {
84+
this.bindHandler(element, delay);
85+
}
86+
}
87+
88+
if (element.index === 'postcode') {
89+
this.bindHandler(element, delay);
90+
postcodeElement = element;
91+
}
92+
},
93+
4894
/**
4995
* @param {*} elements
5096
* @param {Boolean} force
5197
* @param {Number} delay
5298
*/
5399
bindChangeHandlers: function (elements, force, delay) {
54-
var self = this,
55-
observableFields = shippingRatesValidationRules.getObservableFields();
100+
var self = this;
56101

57102
$.each(elements, function (index, elem) {
58-
if (elem && (observableFields.indexOf(elem.index) !== -1 || force)) {
59-
if (elem.index !== 'postcode') {
60-
self.bindHandler(elem, delay);
61-
}
62-
}
63-
64-
if (elem.index === 'postcode') {
65-
self.bindHandler(elem, delay);
66-
postcodeElement = elem;
67-
}
103+
self.doElementBinding(elem, force, delay);
68104
});
69105
},
70106

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ define(
7575
*/
7676
initialize: function () {
7777
var self = this,
78-
hasNewAddress;
78+
hasNewAddress,
79+
fieldsetName = 'checkout.steps.shipping-step.shippingAddress.shipping-address-fieldset';
7980

8081
this._super();
82+
shippingRatesValidator.initFields(fieldsetName);
8183

8284
if (!quote.isVirtual()) {
8385
stepNavigator.registerStep(
@@ -130,15 +132,6 @@ define(
130132
//load data from server for shipping step
131133
},
132134

133-
/**
134-
* @param {Object} element
135-
*/
136-
initElement: function (element) {
137-
if (element.index === 'shipping-address-fieldset') {
138-
shippingRatesValidator.bindChangeHandlers(element.elems(), false);
139-
}
140-
},
141-
142135
/**
143136
* @return {*}
144137
*/

app/code/Magento/CheckoutAgreements/Model/Checkout/Plugin/Validation.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Validation
3232
* @param \Magento\Checkout\Api\AgreementsValidatorInterface $agreementsValidator
3333
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfiguration
3434
* @param \Magento\CheckoutAgreements\Api\CheckoutAgreementsRepositoryInterface $checkoutAgreementsRepository
35-
* @codeCoverageIgnore
3635
*/
3736
public function __construct(
3837
\Magento\Checkout\Api\AgreementsValidatorInterface $agreementsValidator,
@@ -48,15 +47,15 @@ public function __construct(
4847
* @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject
4948
* @param int $cartId
5049
* @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod
51-
* @param \Magento\Quote\Api\Data\AddressInterface $billingAddress
50+
* @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress
5251
* @return void
5352
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5453
*/
5554
public function beforeSavePaymentInformationAndPlaceOrder(
5655
\Magento\Checkout\Api\PaymentInformationManagementInterface $subject,
5756
$cartId,
5857
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
59-
\Magento\Quote\Api\Data\AddressInterface $billingAddress
58+
\Magento\Quote\Api\Data\AddressInterface $billingAddress = null
6059
) {
6160
if ($this->isAgreementEnabled()) {
6261
$this->validateAgreements($paymentMethod->getExtensionAttributes()->getAgreementIds());
@@ -67,15 +66,15 @@ public function beforeSavePaymentInformationAndPlaceOrder(
6766
* @param \Magento\Checkout\Api\PaymentInformationManagementInterface $subject
6867
* @param int $cartId
6968
* @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod
70-
* @param \Magento\Quote\Api\Data\AddressInterface $billingAddress
69+
* @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress
7170
* @return void
7271
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7372
*/
7473
public function beforeSavePaymentInformation(
7574
\Magento\Checkout\Api\PaymentInformationManagementInterface $subject,
7675
$cartId,
7776
\Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
78-
\Magento\Quote\Api\Data\AddressInterface $billingAddress
77+
\Magento\Quote\Api\Data\AddressInterface $billingAddress = null
7978
) {
8079
if ($this->isAgreementEnabled()) {
8180
$this->validateAgreements($paymentMethod->getExtensionAttributes()->getAgreementIds());

0 commit comments

Comments
 (0)