Skip to content

Commit 1b52d8c

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #15765: check if order data is available to incl ec (by @torhoehn) - #15614: [Backport] Fixed product tier pricing pagination issue in admin (by @dmytro-ch) - #15365: Trim username on customer account login page (by @dankhrapiyush) - #15485: fix: support multiple minisearch widget instances (by @DanielRuf) Fixed GitHub Issues: - #12221: Google analytics pageview being triggered twice (reported by @alexhadley) has been fixed in #15765 by @torhoehn in 2.2-develop branch Related commits: 1. 24a5abd - #15210: Advanced pricing pagination issue (reported by @dryadav) has been fixed in #15614 by @dmytro-ch in 2.2-develop branch Related commits: 1. 896ca96 - #6058: IE11 user login email validation fails if field has leading or trailing space (reported by @dnadle) has been fixed in #15365 by @dankhrapiyush in 2.2-develop branch Related commits: 1. 9ecb84b 2. 62c1a14 3. c81d9a6
2 parents ae54862 + be0bbcf commit 1b52d8c

File tree

5 files changed

+79
-4
lines changed

5 files changed

+79
-4
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,13 @@
4242
</form>
4343
</div>
4444
</div>
45+
46+
<script type="text/x-magento-init">
47+
{
48+
".field.email": {
49+
"Magento_Customer/js/trim-username": {
50+
"formSelector": "form.form-login"
51+
}
52+
}
53+
}
54+
</script>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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.trimUsername', {
12+
options: {
13+
cache: {},
14+
formSelector: 'form',
15+
emailSelector: 'input[type="email"]'
16+
},
17+
18+
/**
19+
* Widget initialization
20+
* @private
21+
*/
22+
_create: function () {
23+
// We need to look outside the module for backward compatibility, since someone can already use the module.
24+
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the the email field from the
25+
// newsletter email field or any other "email" field.
26+
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
27+
this._bind();
28+
},
29+
30+
/**
31+
* Event binding, will monitor change, keyup and paste events.
32+
* @private
33+
*/
34+
_bind: function () {
35+
if (this.options.cache.email.length) {
36+
this._on(this.options.cache.email, {
37+
'change': this._trimUsername,
38+
'keyup': this._trimUsername,
39+
'paste': this._trimUsername
40+
});
41+
}
42+
},
43+
44+
/**
45+
* Trim username
46+
* @private
47+
*/
48+
_trimUsername: function () {
49+
var username = this._getUsername().trim();
50+
51+
this.options.cache.email.val(username);
52+
},
53+
54+
/**
55+
* Get username value
56+
* @returns {*}
57+
* @private
58+
*/
59+
_getUsername: function () {
60+
return this.options.cache.email.val();
61+
}
62+
});
63+
64+
return $.mage.trimUsername;
65+
});

app/code/Magento/GoogleAnalytics/view/frontend/web/js/google-analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ define([
5353
}
5454

5555
// Process orders data
56-
if (config.ordersTrackingData.length) {
56+
if (config.ordersTrackingData.hasOwnProperty('currency')) {
5757
ga('require', 'ec', 'ec.js');
5858

5959
//Set currency code

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define([
5555
this.autoComplete = $(this.options.destinationSelector);
5656
this.searchForm = $(this.options.formSelector);
5757
this.submitBtn = this.searchForm.find(this.options.submitBtn)[0];
58-
this.searchLabel = $(this.options.searchLabel);
58+
this.searchLabel = this.searchForm.find(this.options.searchLabel);
5959
this.isExpandable = this.options.isExpandable;
6060

6161
_.bindAll(this, '_onKeyDown', '_onPropertyChange', '_onSubmit');

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ define([
722722
* @param {Number} page - current page
723723
*/
724724
changePage: function (page) {
725+
this.clear();
726+
725727
if (page === 1 && !this.recordData().length) {
726728
return false;
727729
}
@@ -763,15 +765,13 @@ define([
763765
* Change page to next
764766
*/
765767
nextPage: function () {
766-
this.clear();
767768
this.currentPage(this.currentPage() + 1);
768769
},
769770

770771
/**
771772
* Change page to previous
772773
*/
773774
previousPage: function () {
774-
this.clear();
775775
this.currentPage(this.currentPage() - 1);
776776
},
777777

0 commit comments

Comments
 (0)