Skip to content

Commit 86ad7ab

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into 2.4-develop-temporary-five-prs
2 parents ed0b1b1 + 562644f commit 86ad7ab

File tree

361 files changed

+4618
-18840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+4618
-18840
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AsynchronousOperations\Api;
10+
11+
use Magento\AsynchronousOperations\Api\Data\OperationInterface;
12+
13+
/**
14+
* Interface for saving multiple operations
15+
*
16+
* @api
17+
*/
18+
interface SaveMultipleOperationsInterface
19+
{
20+
/**
21+
* Save Operations for Bulk
22+
*
23+
* @param OperationInterface[] $operations
24+
* @return void
25+
*/
26+
public function execute(array $operations): void;
27+
}

app/code/Magento/AsynchronousOperations/Model/BulkManagement.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public function scheduleBulk($bulkUuid, array $operations, $description, $userId
117117
$bulkSummary->setUserId($userId);
118118
$bulkSummary->setUserType($userType);
119119
$bulkSummary->setOperationCount((int)$bulkSummary->getOperationCount() + count($operations));
120-
121120
$this->entityManager->save($bulkSummary);
122121

123122
$connection->commit();

app/code/Magento/AsynchronousOperations/Model/MassSchedule.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\Bulk\BulkManagementInterface;
1717
use Magento\Framework\DataObject\IdentityGeneratorInterface;
1818
use Magento\Framework\Encryption\Encryptor;
19+
use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface;
1920
use Magento\Framework\Exception\BulkException;
2021
use Magento\Framework\Exception\LocalizedException;
2122
use Psr\Log\LoggerInterface;
@@ -67,6 +68,11 @@ class MassSchedule
6768
*/
6869
private $encryptor;
6970

71+
/**
72+
* @var SaveMultipleOperationsInterface
73+
*/
74+
private $saveMultipleOperations;
75+
7076
/**
7177
* Initialize dependencies.
7278
*
@@ -78,6 +84,7 @@ class MassSchedule
7884
* @param OperationRepositoryInterface $operationRepository
7985
* @param UserContextInterface $userContext
8086
* @param Encryptor $encryptor
87+
* @param SaveMultipleOperationsInterface $saveMultipleOperations
8188
*/
8289
public function __construct(
8390
IdentityGeneratorInterface $identityService,
@@ -87,7 +94,8 @@ public function __construct(
8794
LoggerInterface $logger,
8895
OperationRepositoryInterface $operationRepository,
8996
UserContextInterface $userContext,
90-
Encryptor $encryptor
97+
Encryptor $encryptor,
98+
SaveMultipleOperationsInterface $saveMultipleOperations
9199
) {
92100
$this->identityService = $identityService;
93101
$this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory;
@@ -97,6 +105,7 @@ public function __construct(
97105
$this->operationRepository = $operationRepository;
98106
$this->userContext = $userContext;
99107
$this->encryptor = $encryptor;
108+
$this->saveMultipleOperations = $saveMultipleOperations;
100109
}
101110

102111
/**
@@ -159,6 +168,7 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $
159168
}
160169
}
161170

171+
$this->saveMultipleOperations->execute($operations);
162172
if (!$this->bulkManagement->scheduleBulk($groupId, $operations, $bulkDescription, $userId)) {
163173
throw new LocalizedException(
164174
__('Something went wrong while processing the request.')

app/code/Magento/AsynchronousOperations/Model/OperationManagement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Framework\EntityManager\EntityManager;
1111

1212
/**
13-
* Class OperationManagement
13+
* Class for managing Bulk Operations
1414
*/
1515
class OperationManagement implements \Magento\Framework\Bulk\OperationManagementInterface
1616
{
@@ -45,7 +45,7 @@ public function __construct(
4545
$this->operationFactory = $operationFactory;
4646
$this->logger = $logger;
4747
}
48-
48+
4949
/**
5050
* @inheritDoc
5151
*/

app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
namespace Magento\AsynchronousOperations\Model\ResourceModel;
88

99
/**
10-
* Class Operation
10+
* Resource class for Bulk Operations
1111
*/
1212
class Operation extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
1313
{
14+
15+
public const TABLE_NAME = "magento_operation";
16+
public const TABLE_PRIMARY_KEY = "id";
17+
1418
/**
1519
* Initialize banner sales rule resource model
1620
*
1721
* @return void
1822
*/
1923
protected function _construct()
2024
{
21-
$this->_init('magento_operation', 'id');
25+
$this->_init(self::TABLE_NAME, self::TABLE_PRIMARY_KEY);
2226
}
2327
}

app/code/Magento/AsynchronousOperations/Model/ResourceModel/Operation/OperationRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function createByTopic($topicName, $entityParams, $groupId)
9898

9999
/** @var OperationInterface $operation */
100100
$operation = $this->operationFactory->create($data);
101-
return $this->entityManager->save($operation);
101+
return $operation;
102102
}
103103

104104
/**
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\AsynchronousOperations\Model;
10+
11+
use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface;
12+
use Magento\AsynchronousOperations\Model\ResourceModel\Operation as OperationResource;
13+
use Magento\Framework\Exception\CouldNotSaveException;
14+
15+
/**
16+
* Implementation for saving multiple operations
17+
*/
18+
class SaveMultipleOperations implements SaveMultipleOperationsInterface
19+
{
20+
21+
/**
22+
* @var OperationResource
23+
*/
24+
private $operationResource;
25+
26+
/**
27+
* BulkSummary constructor.
28+
*
29+
* @param OperationResource $operationResource
30+
*/
31+
public function __construct(
32+
OperationResource $operationResource
33+
) {
34+
$this->operationResource = $operationResource;
35+
}
36+
37+
/**
38+
* @inheritDoc
39+
*/
40+
public function execute(array $operations): void
41+
{
42+
try {
43+
$operationsToInsert = array_map(function ($operation) {
44+
return $operation->getData();
45+
}, $operations);
46+
47+
$connection = $this->operationResource->getConnection();
48+
$connection->insertMultiple(
49+
$this->operationResource->getTable(OperationResource::TABLE_NAME),
50+
$operationsToInsert
51+
);
52+
} catch (\Exception $exception) {
53+
throw new CouldNotSaveException(__($exception->getMessage()));
54+
}
55+
}
56+
}

app/code/Magento/AsynchronousOperations/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<preference for="Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface" type="Magento\AsynchronousOperations\Model\BulkSummary" />
10+
<preference for="Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface" type="Magento\AsynchronousOperations\Model\SaveMultipleOperations" />
1011
<preference for="Magento\AsynchronousOperations\Api\Data\OperationInterface" type="Magento\AsynchronousOperations\Model\Operation" />
1112
<preference for="Magento\AsynchronousOperations\Api\Data\OperationListInterface" type="Magento\AsynchronousOperations\Model\OperationList" />
1213
<preference for="Magento\Framework\Bulk\BulkManagementInterface" type="Magento\AsynchronousOperations\Model\BulkManagement" />

app/code/Magento/Backend/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Before disabling or uninstalling this module, note that the following modules de
1616
- Magento_ReleaseNotification
1717
- Magento_Search
1818
- Magento_Security
19-
- Magento_Signifyd
2019
- Magento_Swatches
2120
- Magento_Ui
2221
- Magento_User
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickLogoActionGroup">
12+
<click selector="{{AdminMenuSection.logo}}" stepKey="clickLogoInAdmin"/>
13+
<waitForPageLoad stepKey="waitForAdminDashboardPageLoaded"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToSetupWizardPageActionGroup">
12+
<annotations>
13+
<description>Open Setup Wizard Page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminSetupWizardPage.url}}" stepKey="navigateToSetupWizardPage"/>
16+
<waitForPageLoad stepKey="waitForSetupWizardPageLoaded"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSetupWizardPage" url="admin/backendapp/redirect/app/setup/" area="admin" module="Magento_Backend"/>
12+
</pages>

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMenuSection">
12+
<element name="logo" type="button" selector=".menu-wrapper a.logo"/>
1213
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
1314
<element name="catalogProducts" type="button" selector="#nav li[data-ui-id='menu-magento-catalog-catalog-products']"/>
1415
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginWithRestrictPermissionTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
<!--Create user role-->
2525
<actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData">
2626
<argument name="User" value="adminRole"/>
27-
<argument name="restrictedRole" value="Media Gallery"/>
27+
<argument name="restrictedRole" value="Global Search"/>
2828
</actionGroup>
2929
<actionGroup ref="AdminUserClickRoleResourceTabActionGroup" stepKey="switchToRoleResourceTab"/>
3030
<actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores">
3131
<argument name="User" value="adminRole"/>
32-
<argument name="restrictedRole" value="Media Gallery"/>
32+
<argument name="restrictedRole" value="Global Search"/>
3333
</actionGroup>
3434
<actionGroup ref="AdminUserSaveRoleActionGroup" stepKey="saveRole"/>
3535
<!--Create user and assign role to it-->
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Navigate to dashboard from Setup Wizard Page"/>
15+
<title value="Navigate to dashboard after click on logo on Setup Wizard Page"/>
16+
<description value="Check navigate to dashboard after click on logo on Setup Wizard Page"/>
17+
</annotations>
18+
<before>
19+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
20+
</before>
21+
<after>
22+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
23+
</after>
24+
25+
<actionGroup ref="AdminNavigateToSetupWizardPageActionGroup" stepKey="navigateToSetupWizardPage"/>
26+
<actionGroup ref="AdminClickLogoActionGroup" stepKey="clickOnLogo"/>
27+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="checkTheDashboardPage"/>
28+
</test>
29+
</tests>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="Enable3DSecureBraintree">
12+
<data key="path">payment/braintree/verify_3dsecure</data>
13+
<data key="value">1</data>
14+
</entity>
15+
<entity name="Disable3DSecureBraintree">
16+
<data key="path">payment/braintree/verify_3dsecure</data>
17+
<data key="value">0</data>
18+
</entity>
19+
<entity name="DisableVaultBraintree">
20+
<data key="path">payment/braintree_cc_vault/active</data>
21+
<data key="value">0</data>
22+
</entity>
23+
</entities>

app/code/Magento/Braintree/Test/Unit/Gateway/Response/PayPal/VaultDetailsHandlerTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use Braintree\Result\Successful;
99
use Braintree\Transaction;
1010
use Braintree\Transaction\PayPalDetails;
11-
use Magento\Braintree\Gateway\SubjectReader;
1211
use Magento\Braintree\Gateway\Response\PayPal\VaultDetailsHandler;
12+
use Magento\Braintree\Gateway\SubjectReader;
1313
use Magento\Framework\Intl\DateTimeFactory;
1414
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1515
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
@@ -99,7 +99,12 @@ protected function setUp()
9999
->getMock();
100100

101101
$this->paymentExtensionMock = $this->getMockBuilder(OrderPaymentExtensionInterface::class)
102-
->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken'])
102+
->setMethods([
103+
'setVaultPaymentToken',
104+
'getVaultPaymentToken',
105+
'setNotificationMessage',
106+
'getNotificationMessage'
107+
])
103108
->disableOriginalConstructor()
104109
->getMock();
105110
$this->paymentExtensionFactoryMock = $this->getMockBuilder(OrderPaymentExtensionInterfaceFactory::class)
@@ -119,7 +124,7 @@ protected function setUp()
119124
->disableOriginalConstructor()
120125
->setMethods(['create'])
121126
->getMock();
122-
127+
123128
$this->handler = new VaultDetailsHandler(
124129
$this->paymentTokenFactoryMock,
125130
$this->paymentExtensionFactoryMock,
@@ -139,7 +144,7 @@ public function testHandle()
139144
->with($this->paymentTokenMock);
140145
$this->paymentExtensionMock->method('getVaultPaymentToken')
141146
->willReturn($this->paymentTokenMock);
142-
147+
143148
$this->paymentDataObjectMock->method('getPayment')
144149
->willReturn($this->paymentInfoMock);
145150

@@ -154,7 +159,7 @@ public function testHandle()
154159
$expirationDate = '2017-07-05 00:00:00';
155160
$this->dateTimeFactoryMock->method('create')
156161
->willReturn($dateTime);
157-
162+
158163
$this->handler->handle($this->subject, $response);
159164

160165
$extensionAttributes = $this->paymentInfoMock->getExtensionAttributes();

0 commit comments

Comments
 (0)