Skip to content

Commit 7516446

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #16325: [Backport] Fixed typo error (by @vgelani) - #16297: [Backport-2.1] Trim email address in customer account create and login form (by @dankhrapiyush) - #16264: [Backport] Fix duplicate element id issue. (by @chirag-wagento) - #16270: Refactor validate code in Tax module (by @vgelani) - #16319: [Backport] Correct sentence in comment section in class file. (by @namratachangani) - #16281: [Backport] Submitting search form (mini) with enter key fires event handlers bound by jquery twice (by @vgelani) Fixed GitHub Issues: - #6058: IE11 user login email validation fails if field has leading or trailing space (reported by @dnadle) has been fixed in #16297 by @dankhrapiyush in 2.1-develop branch Related commits: 1. 96af9cf 2. 5e58bac 3. 4ec83ec - #13415: Duplicated elements id in checkout page (reported by @angelo983) has been fixed in #16264 by @chirag-wagento in 2.1-develop branch Related commits: 1. c9e5239 - #15352: Reformat the javascript code as per magento standards. (reported by @namratachangani) has been fixed in #16270 by @vgelani in 2.1-develop branch Related commits: 1. 67a9e13 - #13793: Submitting search form (mini) with enter key fires event handlers bound by jquery twice (reported by @koenner01) has been fixed in #16281 by @vgelani in 2.1-develop branch Related commits: 1. 5064cb8
2 parents 59129f5 + 3b22433 commit 7516446

File tree

18 files changed

+101
-101
lines changed

18 files changed

+101
-101
lines changed

app/code/Magento/Customer/view/frontend/templates/form/login.phtml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="field email required">
3333
<label class="label" for="email"><span><?php echo $block->escapeHtml(__('Email')) ?></span></label>
3434
<div class="control">
35-
<input name="login[username]" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getUsername()) ?>" <?php if ($block->isAutocompleteDisabled()) :?> autocomplete="off"<?php endif; ?> id="email" type="email" class="input-text" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" data-validate="{required:true, 'validate-email':true}">
35+
<input name="login[username]" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getUsername()) ?>" <?php if ($block->isAutocompleteDisabled()) :?> autocomplete="off"<?php endif; ?> id="email" type="email" class="input-text" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
3636
</div>
3737
</div>
3838
<div class="field password required">
@@ -51,12 +51,3 @@
5151
</div>
5252
</div>
5353

54-
<script type="text/x-magento-init">
55-
{
56-
".field.email": {
57-
"Magento_Customer/js/trim-username": {
58-
"formSelector": "form.form-login"
59-
}
60-
}
61-
}
62-
</script>

app/code/Magento/Customer/view/frontend/templates/form/register.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<div class="field required">
135135
<label for="email_address" class="label"><span><?php echo $block->escapeHtml(__('Email')) ?></span></label>
136136
<div class="control">
137-
<input type="email" name="email" autocomplete="email" id="email_address" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-validate="{required:true, 'validate-email':true}">
137+
<input type="email" name="email" autocomplete="email" id="email_address" value="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr($block->getFormData()->getEmail()) ?>" title="<?php echo $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Email')) ?>" class="input-text" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
138138
</div>
139139
</div>
140140
<div class="field password required" data-mage-init='{"passwordStrengthIndicator": {}}'>

app/code/Magento/Customer/view/frontend/web/js/model/authentication-popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define(
3131

3232
/** Show login popup window */
3333
showModal: function () {
34-
$(this.modalWindow).modal('openModal');
34+
$(this.modalWindow).modal('openModal').trigger('contentUpdated');
3535
}
3636
}
3737
}

app/code/Magento/Customer/view/frontend/web/js/trim-username.js

Lines changed: 0 additions & 65 deletions
This file was deleted.

app/code/Magento/Customer/view/frontend/web/template/authentication-popup.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
id="email"
6161
type="email"
6262
class="input-text"
63+
data-mage-init='{"mage/trim-input":{}}'
6364
data-bind="attr: {autocomplete: autocomplete}"
6465
data-validate="{required:true, 'validate-email':true}">
6566
</div>

app/code/Magento/GiftMessage/view/frontend/web/template/gift-message-form.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,24 @@
1212
<div class="gift-options-content">
1313
<fieldset class="fieldset">
1414
<div class="field field-to">
15-
<label for="gift-message-whole-to" class="label">
15+
<label data-bind="attr: {for: 'gift-message-whole-to-' + index }" class="label">
1616
<span data-bind="i18n: 'To:'"></span>
1717
</label>
1818
<div class="control">
1919
<input type="text"
20-
id="gift-message-whole-to"
2120
class="input-text"
22-
data-bind="value: getObservable('recipient')">
21+
data-bind="value: getObservable('recipient'), attr: { id: 'gift-message-whole-to-' + index }">
2322
</div>
2423
</div>
2524

2625
<div class="field field-from">
27-
<label for="gift-message-whole-from" class="label">
26+
<label data-bind="attr: {for: 'gift-message-whole-from-' + index }" class="label">
2827
<span data-bind="i18n: 'From:'"></span>
2928
</label>
3029
<div class="control">
3130
<input type="text"
32-
id="gift-message-whole-from"
3331
class="input-text"
34-
data-bind="value: getObservable('sender')">
32+
data-bind="value: getObservable('sender'), attr: { id: 'gift-message-whole-from-' + index }">
3533
</div>
3634
</div>
3735
<div class="field text">
@@ -46,7 +44,6 @@
4644
</div>
4745
</div>
4846
</fieldset>
49-
5047
</div>
5148
</div>
5249
<!-- /ko -->

app/code/Magento/Paypal/view/frontend/web/order-review.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ define([
8888
},
8989

9090
/**
91-
* trigger change for the update of shippping methods from server
91+
* trigger change for the update of shipping methods from server
9292
*/
9393
_updateOrderHandler: function () {
9494
$(this.options.shippingSelector).trigger('change');
@@ -246,7 +246,7 @@ define([
246246
this._updateOrderSubmit(true);
247247
this._toggleButton(this.options.updateOrderSelector, true);
248248

249-
// form data and callBack updated based on the shippping Form element
249+
// form data and callBack updated based on the shipping Form element
250250
if (this.isShippingSubmitForm) {
251251
formData = $(this.options.shippingSubmitFormSelector).serialize() + "&isAjax=true";
252252
callBackResponseHandler = function (response) {

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ define([
207207
break;
208208
case $.ui.keyCode.ENTER:
209209
this.searchForm.trigger('submit');
210+
e.preventDefault();
210211
break;
211212
case $.ui.keyCode.DOWN:
212213
if (this.responseList.indexList) {

app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?php echo $block->getSaveButtonHtml(); ?>
1212
</div>
1313
<?php echo $block->getRenameFormHtml(); ?>
14-
<script>
15-
require(['jquery', "mage/mage"], function(jQuery){
16-
17-
jQuery('#<?php /* @escapeNotVerified */ echo $block->getRenameFormId() ?>').mage('form').mage('validation');
18-
19-
});
20-
</script>
14+
<script type="text/x-magento-init">
15+
{
16+
"#<?php /* @escapeNotVerified */ echo $block->getRenameFormId(); ?>": {
17+
"Magento_Tax/js/page/validate": {}
18+
}
19+
}
20+
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mage/mage'
9+
], function (jQuery) {
10+
'use strict';
11+
12+
return function (data, element) {
13+
jQuery(element).mage('form').mage('validation');
14+
};
15+
});

lib/web/mage/trim-input.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery'
8+
], function ($) {
9+
'use strict';
10+
11+
$.widget('mage.trimInput', {
12+
options: {
13+
cache: {}
14+
},
15+
16+
/**
17+
* Widget initialization
18+
* @private
19+
*/
20+
_create: function () {
21+
this.options.cache.input = $(this.element);
22+
this._bind();
23+
},
24+
25+
/**
26+
* Event binding, will monitor change, keyup and paste events.
27+
* @private
28+
*/
29+
_bind: function () {
30+
if (this.options.cache.input.length) {
31+
this._on(this.options.cache.input, {
32+
'change': this._trimInput,
33+
'keyup': this._trimInput,
34+
'paste': this._trimInput
35+
});
36+
}
37+
},
38+
39+
/**
40+
* Trim value
41+
* @private
42+
*/
43+
_trimInput: function () {
44+
var input = this._getInputValue().trim();
45+
46+
this.options.cache.input.val(input);
47+
},
48+
49+
/**
50+
* Get input value
51+
* @returns {*}
52+
* @private
53+
*/
54+
_getInputValue: function () {
55+
return this.options.cache.input.val();
56+
}
57+
});
58+
59+
return $.mage.trimInput;
60+
});

lib/web/modernizr/modernizr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ window.Modernizr = (function( window, document, undefined ) {
910910
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
911911

912912
} else {
913-
// If the upgraded input compontent rejects the :) text, we got a winner
913+
// If the upgraded input component rejects the :) text, we got a winner
914914
bool = inputElem.value != smile;
915915
}
916916
}

lib/web/tiny_mce/classes/Formatter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
childCount = getChildCount(node);
446446

447447
// Remove empty nodes but only if there is multiple wrappers and they are not block
448-
// elements so never remove single <h1></h1> since that would remove the currrent empty block element where the caret is at
448+
// elements so never remove single <h1></h1> since that would remove the current empty block element where the caret is at
449449
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
450450
dom.remove(node, 1);
451451
return;

lib/web/tiny_mce/classes/dom/DOMUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@
11061106

11071107
/**
11081108
* Returns a unique id. This can be useful when generating elements on the fly.
1109-
* This method will not check if the element allready exists.
1109+
* This method will not check if the element already exists.
11101110
*
11111111
* @method uniqueId
11121112
* @param {String} p Optional prefix to add infront of all ids defaults to "mce_".

lib/web/tiny_mce/tiny_mce_jquery_src.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14451,7 +14451,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
1445114451
childCount = getChildCount(node);
1445214452

1445314453
// Remove empty nodes but only if there is multiple wrappers and they are not block
14454-
// elements so never remove single <h1></h1> since that would remove the currrent empty block element where the caret is at
14454+
// elements so never remove single <h1></h1> since that would remove the current empty block element where the caret is at
1445514455
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
1445614456
dom.remove(node, 1);
1445714457
return;

lib/web/tiny_mce/tiny_mce_prototype_src.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15301,7 +15301,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
1530115301
childCount = getChildCount(node);
1530215302

1530315303
// Remove empty nodes but only if there is multiple wrappers and they are not block
15304-
// elements so never remove single <h1></h1> since that would remove the currrent empty block element where the caret is at
15304+
// elements so never remove single <h1></h1> since that would remove the current empty block element where the caret is at
1530515305
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
1530615306
dom.remove(node, 1);
1530715307
return;

lib/web/tiny_mce/tiny_mce_src.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15275,7 +15275,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
1527515275
childCount = getChildCount(node);
1527615276

1527715277
// Remove empty nodes but only if there is multiple wrappers and they are not block
15278-
// elements so never remove single <h1></h1> since that would remove the currrent empty block element where the caret is at
15278+
// elements so never remove single <h1></h1> since that would remove the current empty block element where the caret is at
1527915279
if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) {
1528015280
dom.remove(node, 1);
1528115281
return;

setup/src/Magento/Setup/Fixtures/OrdersFixture.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright © 2013-2018 Magento, Inc. All rights reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66

@@ -14,7 +14,7 @@
1414
* Optionally generates inactive quotes for generated orders.
1515
*
1616
* Support the following format:
17-
* <!-- Is is nescessary to enable quotes for orders -->
17+
* <!-- It is necessary to enable quotes for orders -->
1818
* <order_quotes_enable>{bool}</order_quotes_enable>
1919
*
2020
* <!-- Min number of simple products per each order -->

0 commit comments

Comments
 (0)