Skip to content

Commit 6156a41

Browse files
authored
Merge branch '2.4-develop' into 2.4-develop-prs
2 parents 4e58fd9 + 8de016a commit 6156a41

File tree

40 files changed

+3320
-265
lines changed

40 files changed

+3320
-265
lines changed

app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@
2323
<element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" />
2424
<element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" />
2525
<element name="errorElement" type="text" selector="#{{inputId}}-error" parameterized="true" />
26+
<element name="defaultCurrency" type="select" selector="#currency_options_default" />
27+
<element name="allowedCurrencies" type="multiselect" selector="#currency_options_allow" />
28+
<element name="defaultCurrencyCheckbox" type="checkbox" selector="#currency_options_default_inherit"/>
29+
<element name="allowedCurrencyCheckbox" type="checkbox" selector="#currency_options_allow_inherit"/>
2630
</section>
2731
</sections>

app/code/Magento/Customer/Block/Account/AuthenticationPopup.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function __construct(
4242
}
4343

4444
/**
45+
* Returns serialize jsLayout
46+
*
4547
* @return string
4648
*/
4749
public function getJsLayout()
@@ -60,7 +62,8 @@ public function getConfig()
6062
'autocomplete' => $this->escapeHtml($this->isAutocompleteEnabled()),
6163
'customerRegisterUrl' => $this->escapeUrl($this->getCustomerRegisterUrlUrl()),
6264
'customerForgotPasswordUrl' => $this->escapeUrl($this->getCustomerForgotPasswordUrl()),
63-
'baseUrl' => $this->escapeUrl($this->getBaseUrl())
65+
'baseUrl' => $this->escapeUrl($this->getBaseUrl()),
66+
'customerLoginUrl' => $this->getUrl('customer/ajax/login'),
6467
];
6568
}
6669

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@
332332
<data key="telephone">333-33-333-33</data>
333333
<data key="country">Germany</data>
334334
<data key="state">Berlin</data>
335-
<data key="vatNumber">DE265675123</data>
335+
<data key="vatNumber">DE257486969</data>
336336
</entity>
337337
<entity name="US_Address_California">
338338
<data key="firstname">John</data>

app/code/Magento/Customer/Test/Unit/Block/Account/AuthenticationPopupTest.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function ($string) {
102102
*
103103
* @dataProvider dataProviderGetConfig
104104
*/
105-
public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, array $result)
105+
public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, $loginUrl, array $result)
106106
{
107107
$this->scopeConfigMock->expects($this->any())
108108
->method('getValue')
@@ -129,6 +129,7 @@ public function testGetConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUr
129129
[
130130
['customer/account/create', [], $registerUrl],
131131
['customer/account/forgotpassword', [], $forgotUrl],
132+
['customer/ajax/login', [], $loginUrl],
132133
]
133134
);
134135

@@ -146,47 +147,55 @@ public function dataProviderGetConfig()
146147
'base',
147148
'reg',
148149
'forgot',
150+
'loginUrl',
149151
[
150152
'autocomplete' => 'escapeHtmloff',
151153
'customerRegisterUrl' => 'escapeUrlreg',
152154
'customerForgotPasswordUrl' => 'escapeUrlforgot',
153155
'baseUrl' => 'escapeUrlbase',
156+
'customerLoginUrl'=>'loginUrl',
154157
],
155158
],
156159
[
157160
1,
158161
'',
159162
'reg',
160163
'forgot',
164+
'loginUrl',
161165
[
162166
'autocomplete' => 'escapeHtmlon',
163167
'customerRegisterUrl' => 'escapeUrlreg',
164168
'customerForgotPasswordUrl' => 'escapeUrlforgot',
165169
'baseUrl' => 'escapeUrl',
170+
'customerLoginUrl'=>'loginUrl',
166171
],
167172
],
168173
[
169174
'',
170175
'base',
171176
'',
172177
'forgot',
178+
'loginUrl',
173179
[
174180
'autocomplete' => 'escapeHtmloff',
175181
'customerRegisterUrl' => 'escapeUrl',
176182
'customerForgotPasswordUrl' => 'escapeUrlforgot',
177183
'baseUrl' => 'escapeUrlbase',
184+
'customerLoginUrl'=>'loginUrl',
178185
],
179186
],
180187
[
181188
true,
182189
'base',
183190
'reg',
184191
'',
192+
'loginUrl',
185193
[
186194
'autocomplete' => 'escapeHtmlon',
187195
'customerRegisterUrl' => 'escapeUrlreg',
188196
'customerForgotPasswordUrl' => 'escapeUrl',
189197
'baseUrl' => 'escapeUrlbase',
198+
'customerLoginUrl'=>'loginUrl',
190199
],
191200
],
192201
];
@@ -202,8 +211,14 @@ public function dataProviderGetConfig()
202211
*
203212
* @dataProvider dataProviderGetConfig
204213
*/
205-
public function testGetSerializedConfig($isAutocomplete, $baseUrl, $registerUrl, $forgotUrl, array $result)
206-
{
214+
public function testGetSerializedConfig(
215+
$isAutocomplete,
216+
$baseUrl,
217+
$registerUrl,
218+
$forgotUrl,
219+
$loginUrl,
220+
array $result
221+
) {
207222
$this->scopeConfigMock->expects($this->any())
208223
->method('getValue')
209224
->with(Form::XML_PATH_ENABLE_AUTOCOMPLETE, ScopeInterface::SCOPE_STORE, null)
@@ -229,6 +244,7 @@ public function testGetSerializedConfig($isAutocomplete, $baseUrl, $registerUrl,
229244
[
230245
['customer/account/create', [], $registerUrl],
231246
['customer/account/forgotpassword', [], $forgotUrl],
247+
['customer/ajax/login', [], $loginUrl],
232248
]
233249
);
234250
$this->serializerMock->expects($this->any())->method('serialize')

app/code/Magento/Customer/view/frontend/web/js/action/login.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ define([
2222
*/
2323
action = function (loginData, redirectUrl, isGlobal, messageContainer) {
2424
messageContainer = messageContainer || globalMessageList;
25+
let customerLoginUrl = 'customer/ajax/login';
26+
27+
if (loginData.customerLoginUrl) {
28+
customerLoginUrl = loginData.customerLoginUrl;
29+
delete loginData.customerLoginUrl;
30+
}
2531

2632
return storage.post(
27-
'customer/ajax/login',
33+
customerLoginUrl,
2834
JSON.stringify(loginData),
2935
isGlobal
3036
).done(function (response) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ define([
8080
formDataArray.forEach(function (entry) {
8181
loginData[entry.name] = entry.value;
8282
});
83-
83+
loginData['customerLoginUrl'] = window.authenticationPopup.customerLoginUrl;
8484
if (formElement.validation() &&
8585
formElement.validation('isValid')
8686
) {

app/code/Magento/ProductVideo/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
},
1717
"suggest": {
1818
"magento/module-customer": "*",
19-
"magento/module-config": "*"
19+
"magento/module-config": "*",
20+
"magento/module-theme": "*"
2021
},
2122
"type": "magento2-module",
2223
"license": [

app/code/Magento/ProductVideo/view/frontend/requirejs-config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ var config = {
77
map: {
88
'*': {
99
loadPlayer: 'Magento_ProductVideo/js/load-player',
10-
fotoramaVideoEvents: 'Magento_ProductVideo/js/fotorama-add-video-events'
10+
fotoramaVideoEvents: 'Magento_ProductVideo/js/fotorama-add-video-events',
11+
'vimeoWrapper': 'vimeo/vimeo-wrapper'
1112
}
1213
},
1314
shim: {
14-
vimeoAPI: {}
15+
vimeoAPI: {},
16+
'Magento_ProductVideo/js/load-player': {
17+
deps: ['vimeoWrapper']
18+
}
1519
}
1620
};

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ define([
100100
videoData: '',
101101
videoSettings: '',
102102
optionsVideoData: '',
103-
dataMergeStrategy: 'replace',
104-
vimeoJSFrameworkLoaded: false
103+
dataMergeStrategy: 'replace'
105104
},
106105

107106
/**
@@ -163,7 +162,6 @@ define([
163162
if (this._checkForVideoExist()) {
164163
this._checkFullscreen();
165164
this._listenForFullscreen();
166-
this._checkForVimeo();
167165
this._isVideoBase();
168166
this._initFotoramaVideo();
169167
this._attachFotoramaEvents();
@@ -396,27 +394,6 @@ define([
396394
return checker;
397395
},
398396

399-
/**
400-
*
401-
* @private
402-
*/
403-
_checkForVimeo: function () {
404-
var allVideoData = this.options.videoData,
405-
videoItem;
406-
407-
if (window.Froogaloop) { // prevent duplicated initialization
408-
return;
409-
}
410-
411-
for (videoItem in allVideoData) {
412-
if (allVideoData[videoItem].provider === this.VI) {
413-
this._loadVimeoJSFramework();
414-
415-
return;
416-
}
417-
}
418-
},
419-
420397
/**
421398
*
422399
* @private
@@ -448,27 +425,6 @@ define([
448425
}
449426
},
450427

451-
/**
452-
*
453-
* @private
454-
*/
455-
_loadVimeoJSFramework: function () {
456-
var element = document.createElement('script'),
457-
scriptTag = document.getElementsByTagName('script')[0];
458-
459-
element.async = true;
460-
element.src = 'https://f.vimeocdn.com/js/froogaloop2.min.js';
461-
462-
/**
463-
* Vimeo js framework on load callback.
464-
*/
465-
element.onload = function () {
466-
this.onVimeoJSFramework();
467-
this.vimeoJSFrameworkLoaded = true;
468-
}.bind(this);
469-
scriptTag.parentNode.insertBefore(element, scriptTag);
470-
},
471-
472428
/**
473429
*
474430
* @param {Event} e
@@ -708,7 +664,7 @@ define([
708664
$(event.target).removeClass(this.VU);
709665
type = $(event.target).find('.' + this.PV).data('type');
710666

711-
if (this.vimeoJSFrameworkLoaded && type === this.VI) {
667+
if (type === this.VI) {
712668
$(event.target).find('.' + this.PV).productVideoLoader();
713669
} else if (type === this.VI) {
714670
this._showLoader();
@@ -732,8 +688,7 @@ define([
732688
* @private
733689
*/
734690
_handleBaseVideo: function (fotorama, srcNumber) {
735-
var waitForFroogaloop,
736-
videoData = this.options.videoData,
691+
var videoData = this.options.videoData,
737692
activeIndex = fotorama.activeIndex,
738693
number = parseInt(srcNumber, 10),
739694
activeIndexIsBase = videoData[activeIndex];
@@ -743,22 +698,11 @@ define([
743698
}
744699

745700
if (activeIndexIsBase && number === 1 && $(window).width() > this.MobileMaxWidth) {
746-
if (this.options.videoData[fotorama.activeIndex].provider === this.VI) {
747-
waitForFroogaloop = setInterval($.proxy(function () {
748-
if (window.Froogaloop) {
749-
clearInterval(waitForFroogaloop);
750-
fotorama.requestFullScreen();
751-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
752-
this.Base = false;
753-
}
754-
}, this), 50);
755-
} else { //if not a vimeo - play it immediately with a little lag in case for fotorama fullscreen
756-
setTimeout($.proxy(function () {
757-
fotorama.requestFullScreen();
758-
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
759-
this.Base = false;
760-
}, this), 50);
761-
}
701+
setTimeout($.proxy(function () {
702+
fotorama.requestFullScreen();
703+
this.fotoramaItem.data('fotorama').activeFrame.$stageFrame[0].trigger('click');
704+
this.Base = false;
705+
}, this), 50);
762706
}
763707
},
764708

app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
*/
1010
define([
1111
'jquery',
12-
'jquery-ui-modules/widget'
12+
'jquery-ui-modules/widget',
13+
'vimeoWrapper'
1314
], function ($) {
1415
'use strict';
1516

@@ -307,7 +308,8 @@ define([
307308
_create: function () {
308309
var timestamp,
309310
additionalParams = '',
310-
src;
311+
src,
312+
id;
311313

312314
this._initialize();
313315
timestamp = new Date().getTime();
@@ -325,10 +327,11 @@ define([
325327
this._code +
326328
timestamp +
327329
additionalParams;
330+
id = 'vimeo' + this._code + timestamp;
328331
this.element.append(
329332
$('<iframe></iframe>')
330333
.attr('frameborder', 0)
331-
.attr('id', 'vimeo' + this._code + timestamp)
334+
.attr('id', id)
332335
.attr('width', this._width)
333336
.attr('height', this._height)
334337
.attr('src', src)
@@ -338,10 +341,11 @@ define([
338341
.attr('referrerPolicy', 'origin')
339342
.attr('allow', 'autoplay')
340343
);
341-
this._player = window.$f(this.element.children(':first')[0]);
342344

343-
// Froogaloop throws error without a registered ready event
344-
this._player.addEvent('ready', function (id) {
345+
/* eslint-disable no-undef */
346+
this._player = new Vimeo.Player(this.element.children(':first')[0]);
347+
348+
this._player.ready().then(function () {
345349
$('#' + id).closest('.fotorama__stage__frame').addClass('fotorama__product-video--loaded');
346350
});
347351
},
@@ -350,23 +354,23 @@ define([
350354
* Play command for Vimeo
351355
*/
352356
play: function () {
353-
this._player.api('play');
357+
this._player.play();
354358
this._playing = true;
355359
},
356360

357361
/**
358362
* Pause command for Vimeo
359363
*/
360364
pause: function () {
361-
this._player.api('pause');
365+
this._player.pause();
362366
this._playing = false;
363367
},
364368

365369
/**
366370
* Stop command for Vimeo
367371
*/
368372
stop: function () {
369-
this._player.api('unload');
373+
this._player.unload();
370374
this._playing = false;
371375
},
372376

0 commit comments

Comments
 (0)