Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4-develop' into 2.4-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtuvn committed Apr 4, 2020
2 parents 96e0c73 + 339618f commit d7cf188
Show file tree
Hide file tree
Showing 1,846 changed files with 27,221 additions and 32,756 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAdminWithCredentialsActionGroup" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
<actionGroup name="LoginAsAdmin" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginAsAdmin" deprecated="Use AdminLoginActionGroup instead">
<conditionalClick selector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" dependentSelector="{{AdminUsageNotificationSection.adminUsageDontAllowButton}}" visible="true" stepKey="clickDontAllowButtonIfVisible" before="closeAdminNotification"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</annotations>

<!-- Logging in Magento admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
<waitForPageLoad time="30" stepKey="wait2"/>
<seeInField selector="{{AdminEditUserSection.usernameTextField}}" userInput="$$noReportUser.username$$" stepKey="seeUsernameInField"/>
<fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/>
<click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="clickUserRoleTab"/>
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>

<click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="clickUserRoleTab"/>
<fillField selector="{{AdminEditUserSection.roleNameFilterTextField}}" userInput="$$noReportUserRole.rolename$$" stepKey="fillRoleNameSearch"/>
<click selector="{{AdminEditUserSection.searchButton}}" stepKey="clickSearchButtonUserRole"/>
<waitForPageLoad time="10" stepKey="wait3"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\AsynchronousOperations\Api;

use Magento\AsynchronousOperations\Api\Data\OperationInterface;

/**
* Interface for saving multiple operations
*
* @api
*/
interface SaveMultipleOperationsInterface
{
/**
* Save Operations for Bulk
*
* @param OperationInterface[] $operations
* @return void
*/
public function execute(array $operations): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public function scheduleBulk($bulkUuid, array $operations, $description, $userId
$bulkSummary->setUserId($userId);
$bulkSummary->setUserType($userType);
$bulkSummary->setOperationCount((int)$bulkSummary->getOperationCount() + count($operations));

$this->entityManager->save($bulkSummary);

$connection->commit();
Expand Down
12 changes: 11 additions & 1 deletion app/code/Magento/AsynchronousOperations/Model/MassSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Framework\Bulk\BulkManagementInterface;
use Magento\Framework\DataObject\IdentityGeneratorInterface;
use Magento\Framework\Encryption\Encryptor;
use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface;
use Magento\Framework\Exception\BulkException;
use Magento\Framework\Exception\LocalizedException;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -67,6 +68,11 @@ class MassSchedule
*/
private $encryptor;

/**
* @var SaveMultipleOperationsInterface
*/
private $saveMultipleOperations;

/**
* Initialize dependencies.
*
Expand All @@ -78,6 +84,7 @@ class MassSchedule
* @param OperationRepositoryInterface $operationRepository
* @param UserContextInterface $userContext
* @param Encryptor $encryptor
* @param SaveMultipleOperationsInterface $saveMultipleOperations
*/
public function __construct(
IdentityGeneratorInterface $identityService,
Expand All @@ -87,7 +94,8 @@ public function __construct(
LoggerInterface $logger,
OperationRepositoryInterface $operationRepository,
UserContextInterface $userContext,
Encryptor $encryptor
Encryptor $encryptor,
SaveMultipleOperationsInterface $saveMultipleOperations
) {
$this->identityService = $identityService;
$this->itemStatusInterfaceFactory = $itemStatusInterfaceFactory;
Expand All @@ -97,6 +105,7 @@ public function __construct(
$this->operationRepository = $operationRepository;
$this->userContext = $userContext;
$this->encryptor = $encryptor;
$this->saveMultipleOperations = $saveMultipleOperations;
}

/**
Expand Down Expand Up @@ -159,6 +168,7 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $
}
}

$this->saveMultipleOperations->execute($operations);
if (!$this->bulkManagement->scheduleBulk($groupId, $operations, $bulkDescription, $userId)) {
throw new LocalizedException(
__('Something went wrong while processing the request.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Magento\Framework\EntityManager\EntityManager;

/**
* Class OperationManagement
* Class for managing Bulk Operations
*/
class OperationManagement implements \Magento\Framework\Bulk\OperationManagementInterface
{
Expand Down Expand Up @@ -45,7 +45,7 @@ public function __construct(
$this->operationFactory = $operationFactory;
$this->logger = $logger;
}

/**
* @inheritDoc
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
namespace Magento\AsynchronousOperations\Model\ResourceModel;

/**
* Class Operation
* Resource class for Bulk Operations
*/
class Operation extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{

public const TABLE_NAME = "magento_operation";
public const TABLE_PRIMARY_KEY = "id";

/**
* Initialize banner sales rule resource model
*
* @return void
*/
protected function _construct()
{
$this->_init('magento_operation', 'id');
$this->_init(self::TABLE_NAME, self::TABLE_PRIMARY_KEY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function createByTopic($topicName, $entityParams, $groupId)

/** @var OperationInterface $operation */
$operation = $this->operationFactory->create($data);
return $this->entityManager->save($operation);
return $operation;
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\AsynchronousOperations\Model;

use Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface;
use Magento\AsynchronousOperations\Model\ResourceModel\Operation as OperationResource;
use Magento\Framework\Exception\CouldNotSaveException;

/**
* Implementation for saving multiple operations
*/
class SaveMultipleOperations implements SaveMultipleOperationsInterface
{

/**
* @var OperationResource
*/
private $operationResource;

/**
* BulkSummary constructor.
*
* @param OperationResource $operationResource
*/
public function __construct(
OperationResource $operationResource
) {
$this->operationResource = $operationResource;
}

/**
* @inheritDoc
*/
public function execute(array $operations): void
{
try {
$operationsToInsert = array_map(function ($operation) {
return $operation->getData();
}, $operations);

$connection = $this->operationResource->getConnection();
$connection->insertMultiple(
$this->operationResource->getTable(OperationResource::TABLE_NAME),
$operationsToInsert
);
} catch (\Exception $exception) {
throw new CouldNotSaveException(__($exception->getMessage()));
}
}
}
1 change: 1 addition & 0 deletions app/code/Magento/AsynchronousOperations/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface" type="Magento\AsynchronousOperations\Model\BulkSummary" />
<preference for="Magento\AsynchronousOperations\Api\SaveMultipleOperationsInterface" type="Magento\AsynchronousOperations\Model\SaveMultipleOperations" />
<preference for="Magento\AsynchronousOperations\Api\Data\OperationInterface" type="Magento\AsynchronousOperations\Model\Operation" />
<preference for="Magento\AsynchronousOperations\Api\Data\OperationListInterface" type="Magento\AsynchronousOperations\Model\OperationList" />
<preference for="Magento\Framework\Bulk\BulkManagementInterface" type="Magento\AsynchronousOperations\Model\BulkManagement" />
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Before disabling or uninstalling this module, note that the following modules de
- Magento_ReleaseNotification
- Magento_Search
- Magento_Security
- Magento_Signifyd
- Magento_Swatches
- Magento_Ui
- Magento_User
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminClickLogoActionGroup">
<click selector="{{AdminMenuSection.logo}}" stepKey="clickLogoInAdmin"/>
<waitForPageLoad stepKey="waitForAdminDashboardPageLoaded"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminNavigateToSetupWizardPageActionGroup">
<annotations>
<description>Open Setup Wizard Page.</description>
</annotations>
<amOnPage url="{{AdminSetupWizardPage.url}}" stepKey="navigateToSetupWizardPage"/>
<waitForPageLoad stepKey="waitForSetupWizardPageLoaded"/>
</actionGroup>
</actionGroups>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="LoginActionGroup" deprecated="Use AdminLoginActionGroup instead" extends="AdminLoginActionGroup"/>
</actionGroups>
Loading

0 comments on commit d7cf188

Please sign in to comment.