Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit cfae201

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into MAGETWO-94226-grid-loader
2 parents 70ddeb9 + bce847d commit cfae201

File tree

21 files changed

+350
-201
lines changed

21 files changed

+350
-201
lines changed

app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
use Magento\Authorizenet\Model\Directpost;
1111
use Magento\Authorizenet\Model\DirectpostFactory;
1212
use Magento\Framework\App\Action\Context;
13+
use Magento\Framework\App\CsrfAwareActionInterface;
14+
use Magento\Framework\App\Request\InvalidRequestException;
15+
use Magento\Framework\App\RequestInterface;
1316
use Magento\Framework\Controller\ResultFactory;
1417
use Magento\Framework\Exception\LocalizedException;
1518
use Magento\Framework\Registry;
1619
use Psr\Log\LoggerInterface;
1720

18-
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment
21+
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment implements CsrfAwareActionInterface
1922
{
2023
/**
2124
* @var LoggerInterface
@@ -48,6 +51,23 @@ public function __construct(
4851
$this->logger = $logger ?: $this->_objectManager->get(LoggerInterface::class);
4952
}
5053

54+
/**
55+
* @inheritDoc
56+
*/
57+
public function createCsrfValidationException(
58+
RequestInterface $request
59+
): ?InvalidRequestException {
60+
return null;
61+
}
62+
63+
/**
64+
* @inheritDoc
65+
*/
66+
public function validateForCsrf(RequestInterface $request): ?bool
67+
{
68+
return true;
69+
}
70+
5171
/**
5272
* Response action.
5373
* Action for Authorize.net SIM Relay Request.

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,29 @@
66
*/
77
namespace Magento\Authorizenet\Controller\Directpost\Payment;
88

9-
class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
9+
use Magento\Framework\App\CsrfAwareActionInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
11+
use Magento\Framework\App\RequestInterface;
12+
13+
class Response extends \Magento\Authorizenet\Controller\Directpost\Payment implements CsrfAwareActionInterface
1014
{
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function createCsrfValidationException(
19+
RequestInterface $request
20+
): ?InvalidRequestException {
21+
return null;
22+
}
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
public function validateForCsrf(RequestInterface $request): ?bool
28+
{
29+
return true;
30+
}
31+
1132
/**
1233
* Response action.
1334
* Action for Authorize.net SIM Relay Request.

app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<amOnPage url="admin/admin/system_config/edit/section/cms/" stepKey="navigateToConfigurationPage" />
2424
<waitForPageLoad stepKey="wait3"/>
2525
<conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true" />
26-
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown2" />
26+
<waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown2" time="30"/>
2727
<uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="uncheckUseSystemValue"/>
2828
<selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Disabled Completely" stepKey="selectOption2"/>
2929
<click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions" />

app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,31 @@
6969

7070
<!--Add option 1 to attribute-->
7171
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/>
72+
<waitForPageLoad stepKey="waitForOption1"/>
7273
<fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/>
7374
<fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/>
7475

7576
<!--Add option 2 to attribute-->
7677
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/>
78+
<waitForPageLoad stepKey="waitForOption2"/>
7779
<fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/>
7880
<fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/>
7981

8082
<!--Add option 3 to attribute-->
8183
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/>
84+
<waitForPageLoad stepKey="waitForOption3"/>
8285
<fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/>
8386
<fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/>
8487

8588
<!--Add option 4 to attribute-->
8689
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/>
90+
<waitForPageLoad stepKey="waitForOption4"/>
8791
<fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/>
8892
<fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/>
8993

9094
<!--Add option 5 to attribute-->
9195
<click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/>
96+
<waitForPageLoad stepKey="waitForOption5"/>
9297
<fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/>
9398
<fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/>
9499

@@ -135,6 +140,7 @@
135140

136141
<!--Click on Stores item-->
137142
<click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/>
143+
<waitForPageLoad stepKey="waitForNavigationPanel"/>
138144

139145
<!--Click on Products item-->
140146
<waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/>

app/code/Magento/Paypal/Controller/Ipn/Index.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77

88
namespace Magento\Paypal\Controller\Ipn;
99

10+
use Magento\Framework\App\CsrfAwareActionInterface;
11+
use Magento\Framework\App\Request\InvalidRequestException;
12+
use Magento\Framework\App\RequestInterface;
1013
use Magento\Framework\Exception\RemoteServiceUnavailableException;
1114

1215
/**
1316
* Unified IPN controller for all supported PayPal methods
1417
*/
15-
class Index extends \Magento\Framework\App\Action\Action
18+
class Index extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface
1619
{
1720
/**
1821
* @var \Psr\Log\LoggerInterface
@@ -39,6 +42,23 @@ public function __construct(
3942
parent::__construct($context);
4043
}
4144

45+
/**
46+
* @inheritDoc
47+
*/
48+
public function createCsrfValidationException(
49+
RequestInterface $request
50+
): ?InvalidRequestException {
51+
return null;
52+
}
53+
54+
/**
55+
* @inheritDoc
56+
*/
57+
public function validateForCsrf(RequestInterface $request): ?bool
58+
{
59+
return true;
60+
}
61+
4262
/**
4363
* Instantiate IPN model and pass IPN request to it
4464
*

app/code/Magento/Paypal/Controller/Payflow/CancelPayment.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,29 @@
66
*/
77
namespace Magento\Paypal\Controller\Payflow;
88

9-
class CancelPayment extends \Magento\Paypal\Controller\Payflow
9+
use Magento\Framework\App\CsrfAwareActionInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
11+
use Magento\Framework\App\RequestInterface;
12+
13+
class CancelPayment extends \Magento\Paypal\Controller\Payflow implements CsrfAwareActionInterface
1014
{
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function createCsrfValidationException(
19+
RequestInterface $request
20+
): ?InvalidRequestException {
21+
return null;
22+
}
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
public function validateForCsrf(RequestInterface $request): ?bool
28+
{
29+
return true;
30+
}
31+
1132
/**
1233
* When a customer cancel payment from payflow gateway.
1334
*

app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
*/
77
namespace Magento\Paypal\Controller\Payflow;
88

9+
use Magento\Framework\App\CsrfAwareActionInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
11+
use Magento\Framework\App\RequestInterface;
912
use Magento\Paypal\Controller\Payflow;
1013
use Magento\Paypal\Model\Config;
1114
use Magento\Sales\Model\Order;
1215

13-
class ReturnUrl extends Payflow
16+
class ReturnUrl extends Payflow implements CsrfAwareActionInterface
1417
{
1518
/**
1619
* @var array of allowed order states on frontend
@@ -30,6 +33,23 @@ class ReturnUrl extends Payflow
3033
Config::METHOD_PAYFLOWLINK
3134
];
3235

36+
/**
37+
* @inheritDoc
38+
*/
39+
public function createCsrfValidationException(
40+
RequestInterface $request
41+
): ?InvalidRequestException {
42+
return null;
43+
}
44+
45+
/**
46+
* @inheritDoc
47+
*/
48+
public function validateForCsrf(RequestInterface $request): ?bool
49+
{
50+
return true;
51+
}
52+
3353
/**
3454
* When a customer return to website from payflow gateway.
3555
*

app/code/Magento/Paypal/Controller/Payflow/SilentPost.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,29 @@
66
*/
77
namespace Magento\Paypal\Controller\Payflow;
88

9-
class SilentPost extends \Magento\Paypal\Controller\Payflow
9+
use Magento\Framework\App\CsrfAwareActionInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
11+
use Magento\Framework\App\RequestInterface;
12+
13+
class SilentPost extends \Magento\Paypal\Controller\Payflow implements CsrfAwareActionInterface
1014
{
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function createCsrfValidationException(
19+
RequestInterface $request
20+
): ?InvalidRequestException {
21+
return null;
22+
}
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
public function validateForCsrf(RequestInterface $request): ?bool
28+
{
29+
return true;
30+
}
31+
1132
/**
1233
* Get response from PayPal by silent post method
1334
*

app/code/Magento/Paypal/Controller/Transparent/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\Paypal\Controller\Transparent;
77

88
use Magento\Framework\App\CsrfAwareActionInterface;
9+
use Magento\Framework\App\Request\InvalidRequestException;
10+
use Magento\Framework\App\RequestInterface;
911
use Magento\Framework\Registry;
1012
use Magento\Framework\App\Action\Context;
1113
use Magento\Framework\View\Result\LayoutFactory;
@@ -17,8 +19,6 @@
1719
use Magento\Paypal\Model\Payflow\Transparent;
1820
use Magento\Sales\Api\PaymentFailuresInterface;
1921
use Magento\Framework\Session\Generic as Session;
20-
use Magento\Framework\App\RequestInterface;
21-
use Magento\Framework\App\Request\InvalidRequestException;
2222

2323
/**
2424
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)

app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ define([
8686
this._height = this.element.data('height');
8787
this._autoplay = !!this.element.data('autoplay');
8888
this._playing = this._autoplay || false;
89+
this.useYoutubeNocookie = this.element.data('youtubenocookie') || false;
8990

9091
this._responsive = this.element.data('responsive') !== false;
9192

@@ -163,6 +164,12 @@ define([
163164
* @private
164165
*/
165166
'youtubeapiready': function () {
167+
var host = 'https://www.youtube.com';
168+
169+
if (self.useYoutubeNocookie) {
170+
host = 'https://www.youtube-nocookie.com';
171+
}
172+
166173
if (self._player !== undefined) {
167174
return;
168175
}
@@ -177,6 +184,7 @@ define([
177184
width: self._width,
178185
videoId: self._code,
179186
playerVars: self._params,
187+
host: host,
180188
events: {
181189

182190
/**
@@ -469,7 +477,8 @@ define([
469477
description: tmp.snippet.description,
470478
thumbnail: tmp.snippet.thumbnails.high.url,
471479
videoId: videoInfo.id,
472-
videoProvider: videoInfo.type
480+
videoProvider: videoInfo.type,
481+
useYoutubeNocookie: videoInfo.useYoutubeNocookie
473482
};
474483
this._videoInformation = respData;
475484
this.element.trigger(this._UPDATE_VIDEO_INFORMATION_TRIGGER, respData);
@@ -600,7 +609,8 @@ define([
600609
var id,
601610
type,
602611
ampersandPosition,
603-
vimeoRegex;
612+
vimeoRegex,
613+
useYoutubeNocookie = false;
604614

605615
if (typeof href !== 'string') {
606616
return href;
@@ -620,9 +630,13 @@ define([
620630
id = id.substring(0, ampersandPosition);
621631
}
622632

623-
} else if (href.host.match(/youtube\.com|youtu\.be/)) {
633+
} else if (href.host.match(/youtube\.com|youtu\.be|youtube-nocookie.com/)) {
624634
id = href.pathname.replace(/^\/(embed\/|v\/)?/, '').replace(/\/.*/, '');
625635
type = 'youtube';
636+
637+
if (href.host.match(/youtube-nocookie.com/)) {
638+
useYoutubeNocookie = true;
639+
}
626640
} else if (href.host.match(/vimeo\.com/)) {
627641
type = 'vimeo';
628642
vimeoRegex = new RegExp(['https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)',
@@ -640,7 +654,7 @@ define([
640654
}
641655

642656
return id ? {
643-
id: id, type: type, s: href.search.replace(/^\?/, '')
657+
id: id, type: type, s: href.search.replace(/^\?/, ''), useYoutubeNocookie: useYoutubeNocookie
644658
} : false;
645659
}
646660
});

app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ define([
2121
container: '.video-player-container',
2222
videoClass: 'product-video',
2323
reset: false,
24+
useYoutubeNocookie: false,
2425
metaData: {
2526
DOM: {
2627
title: '.video-information.title span',
@@ -87,13 +88,17 @@ define([
8788
*/
8889
_doUpdate: function () {
8990
this.reset();
90-
this.element.find(this.options.container).append('<div class="' +
91-
this.options.videoClass +
92-
'" data-type="' +
93-
this.options.videoProvider +
94-
'" data-code="' +
95-
this.options.videoId +
96-
'" data-width="100%" data-height="100%"></div>');
91+
this.element.find(this.options.container).append(
92+
'<div class="' +
93+
this.options.videoClass +
94+
'" data-type="' +
95+
this.options.videoProvider +
96+
'" data-code="' +
97+
this.options.videoId +
98+
'" data-youtubenocookie="' +
99+
this.options.useYoutubeNocookie +
100+
'" data-width="100%" data-height="100%"></div>'
101+
);
97102
this.element.find(this.options.metaData.DOM.wrapper).show();
98103
this.element.find(this.options.metaData.DOM.title).text(this.options.metaData.data.title);
99104
this.element.find(this.options.metaData.DOM.uploaded).text(this.options.metaData.data.uploaded);
@@ -337,6 +342,7 @@ define([
337342
.createVideoPlayer({
338343
videoId: data.videoId,
339344
videoProvider: data.videoProvider,
345+
useYoutubeNocookie: data.useYoutubeNocookie,
340346
reset: false,
341347
metaData: {
342348
DOM: {

0 commit comments

Comments
 (0)