Skip to content

Commit

Permalink
Merge pull request #162 from magento-south/PR-Vanilla-Bugs
Browse files Browse the repository at this point in the history
[Vanilla] Bugfixes
  • Loading branch information
VladimirZaets authored Jul 19, 2016
2 parents f262529 + 7b04b5c commit 27c7763
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ protected function getBundleOptions()
'data' => [
'config' => [
'componentType' => 'fieldset',
'collapsible' => true,
'label' => '',
'opened' => true,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ protected function getOptionsGridConfig($sortOrder)
'data' => [
'config' => [
'componentType' => Fieldset::NAME,
'collapsible' => true,
'label' => null,
'sortOrder' => 10,
'opened' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- ko text: currentBillingAddress().prefix --><!-- /ko --> <!-- ko text: currentBillingAddress().firstname --><!-- /ko -->
<!-- ko text: currentBillingAddress().lastname --><!-- /ko --> <!-- ko text: currentBillingAddress().suffix --><!-- /ko --><br/>
<!-- ko text: currentBillingAddress().street --><!-- /ko --><br/>
<!-- ko text: currentBillingAddress().city --><!-- /ko -->, <!-- ko text: currentBillingAddress().region --><!-- /ko --> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/>
<!-- ko text: currentBillingAddress().city --><!-- /ko -->, <span data-bind="html: currentBillingAddress().region"></span> <!-- ko text: currentBillingAddress().postcode --><!-- /ko --><br/>
<!-- ko text: getCountryName(currentBillingAddress().countryId) --><!-- /ko --><br/>
<!-- ko if: (currentBillingAddress().telephone) -->
<a data-bind="text: currentBillingAddress().telephone, attr: {'href': 'tel:' + currentBillingAddress().telephone}"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
<!-- ko text: address().street --><!-- /ko --><br/>
<!-- ko text: address().city --><!-- /ko -->, <!-- ko text: address().region --><!-- /ko --> <!-- ko text: address().postcode --><!-- /ko --><br/>
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>
<!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/>
<!-- ko if: (address().telephone) -->
<a data-bind="text: address().telephone, attr: {'href': 'tel:' + address().telephone}"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- ko text: address().prefix --><!-- /ko --> <!-- ko text: address().firstname --><!-- /ko -->
<!-- ko text: address().lastname --><!-- /ko --> <!-- ko text: address().suffix --><!-- /ko --><br/>
<!-- ko text: address().street --><!-- /ko --><br/>
<!-- ko text: address().city --><!-- /ko -->, <!-- ko text: address().region --><!-- /ko --> <!-- ko text: address().postcode --><!-- /ko --><br/>
<!-- ko text: address().city --><!-- /ko -->, <span data-bind="html: address().region"></span> <!-- ko text: address().postcode --><!-- /ko --><br/>
<!-- ko text: getCountryName(address().countryId) --><!-- /ko --><br/>
<!-- ko if: (address().telephone) -->
<a data-bind="text: address().telephone, attr: {'href': 'tel:' + address().telephone}"></a>
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Payment/view/adminhtml/web/transparent.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ define([
} else {
this._processErrors(response);
}
},
complete: function () {
$('body').trigger('processStop');
}
});
},
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Theme/view/base/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ var config = {
"jquery/jstree/jquery.jstree": {
"mage/backend/jstree-mixin": true
}
},
"text": {
"headers": {
"X-Requested-With": "XMLHttpRequest"
}
}
}
};
Expand Down
15 changes: 8 additions & 7 deletions app/code/Magento/Ui/view/base/web/js/form/element/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ define([

this._super();

scope = this.dataScope;
name = scope.split('.').slice(1);
scope = this.dataScope;
name = scope.split('.').slice(1);

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

Expand Down Expand Up @@ -264,7 +264,7 @@ define([
* @returns {Abstract} Chainable.
*/
setValidation: function (rule, options) {
var rules = utils.copy(this.validation),
var rules = utils.copy(this.validation),
changed;

if (_.isObject(rule)) {
Expand Down Expand Up @@ -306,7 +306,7 @@ define([
*
* @returns {Boolean}
*/
hasService: function() {
hasService: function () {
return this.service && this.service.template;
},

Expand Down Expand Up @@ -379,8 +379,8 @@ define([
* @returns {Object} Validate information.
*/
validate: function () {
var value = this.value(),
result = validator(this.validation, value, this.validationParams),
var value = this.value(),
result = validator(this.validation, value, this.validationParams),
message = !this.disabled() && this.visible() ? result.message : '',
isValid = this.disabled() || !this.visible() || result.passed;

Expand Down Expand Up @@ -412,6 +412,7 @@ define([
*/
restoreToDefault: function () {
this.value(this.default);
this.focused(true);
},

/**
Expand All @@ -433,7 +434,7 @@ define([
/**
* Callback when value is changed by user
*/
userChanges: function() {
userChanges: function () {
this.valueChangedByUser = true;
}
});
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ define([
additionalInvalid: false,
selectorPrefix: '.page-content',
messagesClass: 'messages',
errorClass: '.admin__field._error',
eventPrefix: '.${ $.index }',
ajaxSave: false,
ajaxSaveType: 'default',
Expand Down Expand Up @@ -247,11 +248,16 @@ define([
* @param {Object} data
*/
save: function (redirect, data) {
var scrollTop;

this.validate();

if (!this.additionalInvalid && !this.source.get('params.invalid')) {
this.setAdditionalData(data)
.submit(redirect);
} else {
scrollTop = $(this.errorClass).offset().top - window.innerHeight / 2;
window.scrollTo(0, scrollTop);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
<td css="$parents[1].setClasses(elem)" if="elem.template">
<div class="fieldset-wrapper admin__collapsible-block-wrapper"
collapsible="openClass: '_show', closeOnOuter: false, opened: elem.opened()">
<div class="fieldset-wrapper-title" toggleCollapsible>
<div class="fieldset-wrapper-title">

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

Expand All @@ -53,7 +53,7 @@
</div>

<div class="admin__collapsible-content"
css="{_show: $collapsible.opened()}"
css="{_show: $data.opened()}"
data-role="collapsible-content"
template="elem.template"></div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion lib/web/mage/requirejs/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ define(['module'], function (module) {
header,
errorHandler = fail || Function();

xhr.open('GET', url);

/*eslint-disable max-depth */
if ('setRequestHeader' in xhr && headers) {
for (header in headers) {
Expand Down Expand Up @@ -127,7 +129,6 @@ define(['module'], function (module) {
}
};

xhr.open('GET', url);
xhr.send();
}

Expand Down
4 changes: 2 additions & 2 deletions lib/web/mage/utils/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ define([
config.response.status(undefined);
config.response.status(!data.error);
})
.fail(function (xhr) {
.fail(function () {
config.response.status(undefined);
config.response.status(false);
config.response.data({
error: true,
messages: xhr.statusText,
messages: 'Something went wrong.',
t: t
});
})
Expand Down

0 comments on commit 27c7763

Please sign in to comment.