Skip to content

Commit 27c7763

Browse files
Merge pull request #162 from magento-south/PR-Vanilla-Bugs
[Vanilla] Bugfixes
2 parents f262529 + 7b04b5c commit 27c7763

File tree

12 files changed

+34
-16
lines changed

12 files changed

+34
-16
lines changed

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePanel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ protected function getBundleOptions()
303303
'data' => [
304304
'config' => [
305305
'componentType' => 'fieldset',
306+
'collapsible' => true,
306307
'label' => '',
307308
'opened' => true,
308309
],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ protected function getOptionsGridConfig($sortOrder)
386386
'data' => [
387387
'config' => [
388388
'componentType' => Fieldset::NAME,
389+
'collapsible' => true,
389390
'label' => null,
390391
'sortOrder' => 10,
391392
'opened' => true,

app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- ko text: currentBillingAddress().prefix --><!-- /ko --> <!-- ko text: currentBillingAddress().firstname --><!-- /ko -->
99
<!-- ko text: currentBillingAddress().lastname --><!-- /ko --> <!-- ko text: currentBillingAddress().suffix --><!-- /ko --><br/>
1010
<!-- ko text: currentBillingAddress().street --><!-- /ko --><br/>
11-
<!-- ko text: currentBillingAddress().city --><!-- /ko -->, <!-- ko text: currentBillingAddress().region --><!-- /ko --> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/>
11+
<!-- ko text: currentBillingAddress().city --><!-- /ko -->, <span data-bind="html: currentBillingAddress().region"></span> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/>
1212
<!-- ko text: getCountryName(currentBillingAddress().countryId) --><!-- /ko --><br/>
1313
<!-- ko if: (currentBillingAddress().telephone) -->
1414
<a data-bind="text: currentBillingAddress().telephone, attr: {'href': 'tel:' + currentBillingAddress().telephone}"></a>

app/code/Magento/Checkout/view/frontend/web/template/shipping-address/address-renderer/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
99
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
1010
<!-- ko text: address().street --><!-- /ko --><br/>
11-
<!-- ko text: address().city --><!-- /ko -->, <!-- ko text: address().region --><!-- /ko --> <!-- ko text: address().postcode --><!-- /ko --><br/>
11+
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>
1212
<!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/>
1313
<!-- ko if: (address().telephone) -->
1414
<a data-bind="text: address().telephone, attr: {'href': 'tel:' + address().telephone}"></a>

app/code/Magento/Checkout/view/frontend/web/template/shipping-information/address-renderer/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
99
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
1010
<!-- ko text: address().street --><!-- /ko --><br/>
11-
<!-- ko text: address().city --><!-- /ko -->, <!-- ko text: address().region --><!-- /ko --> <!-- ko text: address().postcode --><!-- /ko --><br/>
11+
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>
1212
<!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/>
1313
<!-- ko if: (address().telephone) -->
1414
<a data-bind="text: address().telephone, attr: {'href': 'tel:' + address().telephone}"></a>

app/code/Magento/Payment/view/adminhtml/web/transparent.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ define([
9191
} else {
9292
this._processErrors(response);
9393
}
94+
},
95+
complete: function () {
96+
$('body').trigger('processStop');
9497
}
9598
});
9699
},

app/code/Magento/Theme/view/base/requirejs-config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ var config = {
5757
"jquery/jstree/jquery.jstree": {
5858
"mage/backend/jstree-mixin": true
5959
}
60+
},
61+
"text": {
62+
"headers": {
63+
"X-Requested-With": "XMLHttpRequest"
64+
}
6065
}
6166
}
6267
};

app/code/Magento/Ui/view/base/web/js/form/element/abstract.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ define([
106106

107107
this._super();
108108

109-
scope = this.dataScope;
110-
name = scope.split('.').slice(1);
109+
scope = this.dataScope;
110+
name = scope.split('.').slice(1);
111111

112112
valueUpdate = this.showFallbackReset ? 'afterkeydown' : this.valueUpdate;
113113

@@ -264,7 +264,7 @@ define([
264264
* @returns {Abstract} Chainable.
265265
*/
266266
setValidation: function (rule, options) {
267-
var rules = utils.copy(this.validation),
267+
var rules = utils.copy(this.validation),
268268
changed;
269269

270270
if (_.isObject(rule)) {
@@ -306,7 +306,7 @@ define([
306306
*
307307
* @returns {Boolean}
308308
*/
309-
hasService: function() {
309+
hasService: function () {
310310
return this.service && this.service.template;
311311
},
312312

@@ -379,8 +379,8 @@ define([
379379
* @returns {Object} Validate information.
380380
*/
381381
validate: function () {
382-
var value = this.value(),
383-
result = validator(this.validation, value, this.validationParams),
382+
var value = this.value(),
383+
result = validator(this.validation, value, this.validationParams),
384384
message = !this.disabled() && this.visible() ? result.message : '',
385385
isValid = this.disabled() || !this.visible() || result.passed;
386386

@@ -412,6 +412,7 @@ define([
412412
*/
413413
restoreToDefault: function () {
414414
this.value(this.default);
415+
this.focused(true);
415416
},
416417

417418
/**
@@ -433,7 +434,7 @@ define([
433434
/**
434435
* Callback when value is changed by user
435436
*/
436-
userChanges: function() {
437+
userChanges: function () {
437438
this.valueChangedByUser = true;
438439
}
439440
});

app/code/Magento/Ui/view/base/web/js/form/form.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ define([
155155
additionalInvalid: false,
156156
selectorPrefix: '.page-content',
157157
messagesClass: 'messages',
158+
errorClass: '.admin__field._error',
158159
eventPrefix: '.${ $.index }',
159160
ajaxSave: false,
160161
ajaxSaveType: 'default',
@@ -247,11 +248,16 @@ define([
247248
* @param {Object} data
248249
*/
249250
save: function (redirect, data) {
251+
var scrollTop;
252+
250253
this.validate();
251254

252255
if (!this.additionalInvalid && !this.source.get('params.invalid')) {
253256
this.setAdditionalData(data)
254257
.submit(redirect);
258+
} else {
259+
scrollTop = $(this.errorClass).offset().top - window.innerHeight / 2;
260+
window.scrollTo(0, scrollTop);
255261
}
256262
},
257263

app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/collapsible.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
<td css="$parents[1].setClasses(elem)" if="elem.template">
3434
<div class="fieldset-wrapper admin__collapsible-block-wrapper"
3535
collapsible="openClass: '_show', closeOnOuter: false, opened: elem.opened()">
36-
<div class="fieldset-wrapper-title" toggleCollapsible>
36+
<div class="fieldset-wrapper-title">
3737

38-
<div class="admin__collapsible-title" data-role="collapsible-title">
38+
<div class="admin__collapsible-title" data-role="collapsible-title" click="elem.toggleOpened">
3939
<render args="name: $parents[1].dndConfig.template, data: $parents[1].dnd"
4040
if="$parents[1].dndConfig.enabled" />
4141

@@ -53,7 +53,7 @@
5353
</div>
5454

5555
<div class="admin__collapsible-content"
56-
css="{_show: $collapsible.opened()}"
56+
css="{_show: $data.opened()}"
5757
data-role="collapsible-content"
5858
template="elem.template"></div>
5959
</div>

lib/web/mage/requirejs/text.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ define(['module'], function (module) {
8989
header,
9090
errorHandler = fail || Function();
9191

92+
xhr.open('GET', url);
93+
9294
/*eslint-disable max-depth */
9395
if ('setRequestHeader' in xhr && headers) {
9496
for (header in headers) {
@@ -127,7 +129,6 @@ define(['module'], function (module) {
127129
}
128130
};
129131

130-
xhr.open('GET', url);
131132
xhr.send();
132133
}
133134

lib/web/mage/utils/misc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,12 @@ define([
171171
config.response.status(undefined);
172172
config.response.status(!data.error);
173173
})
174-
.fail(function (xhr) {
174+
.fail(function () {
175175
config.response.status(undefined);
176176
config.response.status(false);
177177
config.response.data({
178178
error: true,
179-
messages: xhr.statusText,
179+
messages: 'Something went wrong.',
180180
t: t
181181
});
182182
})

0 commit comments

Comments
 (0)