Skip to content

Commit

Permalink
Merge pull request #2 from magento/2.4-develop
Browse files Browse the repository at this point in the history
Pull
  • Loading branch information
yogesh-valiya authored Aug 4, 2023
2 parents 5b371de + 0a834cc commit c2676bb
Show file tree
Hide file tree
Showing 2,399 changed files with 68,715 additions and 24,417 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For more detailed information on contribution please read our [beginners guide](

## Contribution requirements

1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ However, for those who need a full-featured eCommerce solution, we recommend [Ad

## Contribute

Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://devdocs.magento.com/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.
Our [Community](https://opensource.magento.com/) is large and diverse, and our project is enormous. As a contributor, you have countless opportunities to impact product development and delivery by introducing new features or improving existing ones, enhancing test coverage, updating documentation for [developers](https://developer.adobe.com/commerce/docs/) and [end-users](https://docs.magento.com/user-guide/), catching and fixing code bugs, suggesting points for optimization, and sharing your great ideas.

- [Contribute to the code](https://developer.adobe.com/commerce/contributor/guides/code-contributions/)
- [Report an issue](https://developer.adobe.com/commerce/contributor/guides/code-contributions/#report)
Expand All @@ -36,7 +36,7 @@ Our [Community](https://opensource.magento.com/) is large and diverse, and our p

### Maintainers

We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.
We encourage experts from the Community to help us with GitHub routines such as accepting, merging, or rejecting pull requests and reviewing issues. Adobe has granted the Community Maintainers permission to accept, merge, and reject pull requests, as well as review issues. Thanks to invaluable input from the Community Maintainers team, we can significantly improve contribution quality and accelerate the time to deliver your updates to production.

- [Learn more about the Maintainer role](https://developer.adobe.com/commerce/contributor/guides/maintainers/)
- [Maintainer's Handbook](https://developer.adobe.com/commerce/contributor/guides/maintainers/handbook/)
Expand Down Expand Up @@ -64,9 +64,9 @@ Stay up-to-date on the latest security news and patches by signing up for [Secur
## Licensing

Each Magento source file included in this distribution is licensed under OSL 3.0 or the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento).

[Open Software License (OSL 3.0)](https://opensource.org/licenses/osl-3.0.php) – Please see [LICENSE.txt](LICENSE.txt) for the full text of the OSL 3.0 license.

Subject to Licensee's/Customer's payment of fees and compliance with the terms and conditions of the applicable ordering document between Licensee/Customer and Adobe (or Magento), the terms and conditions of the applicable ordering between Licensee/Customer and Adobe (or Magento) supersede the OSL 3.0 license for each source file.

## Communications
Expand Down
4 changes: 2 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80100) {
if (PHP_SAPI == 'cli') {
echo 'Magento supports PHP 8.1.0 or later. ' .
'Please read https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html';
'Please read https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html';
} else {
echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
<p>Magento supports PHP 8.1.0 or later. Please read
<a target="_blank" href="https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html">
<a target="_blank" href="https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html">
Magento System Requirements</a>.
</div>
HTML;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The Magento\AdminAnalytics module gathers information about the features Magento administrators use. This information will be used to help improve the user experience on the Magento Admin.
The Magento\AdminAnalytics module gathers information about the features Magento administrators use. This information will be used to help improve the user experience on the Magento Admin.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<group value="menu"/>
<group value="mtf_migrated"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<severity value="MAJOR"/>
<testCaseId value="MC-36011"/>
<group value="menu"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<severity value="CRITICAL"/>
<group value="AdvancedSearch"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<group value="analytics"/>
<group value="mtf_migrated"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>

<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<group value="menu"/>
<group value="mtf_migrated"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<testCaseId value="MAGETWO-63981"/>
<group value="analytics"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<testCaseId value="MAGETWO-63898"/>
<group value="analytics"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="clickFoundUsername"/>
<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"/>
<fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_CREDS.magento/MAGENTO_ADMIN_PASSWORD}}" stepKey="fillCurrentPassword"/>
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>

<click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="clickUserRoleTab"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<testCaseId value="MAGETWO-66464"/>
<group value="analytics"/>
<group value="pr_exclude"/>
<group value="cloud"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
<suite name="AsyncOperationsSuite">
<include>
<group name="async_operations"/>
</include>
</suite>
</suites>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<severity value="MAJOR"/>
<testCaseId value="ACPT-885"/>
<group value="configuration"/>
<group value="async_operations" />
</annotations>
<before>
<!--Enable Async Configuration-->
Expand Down
19 changes: 11 additions & 8 deletions app/code/Magento/AsynchronousOperations/Model/AccessValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace Magento\AsynchronousOperations\Model;

/**
* Class AccessValidator
*/
use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface;
use Magento\Authorization\Model\UserContextInterface;

class AccessValidator
{
/**
* @var \Magento\Authorization\Model\UserContextInterface
* @var UserContextInterface
*/
private $userContext;

Expand All @@ -27,13 +27,12 @@ class AccessValidator
private $bulkSummaryFactory;

/**
* AccessValidator constructor.
* @param \Magento\Authorization\Model\UserContextInterface $userContext
* @param UserContextInterface $userContext
* @param \Magento\Framework\EntityManager\EntityManager $entityManager
* @param \Magento\AsynchronousOperations\Api\Data\BulkSummaryInterfaceFactory $bulkSummaryFactory
*/
public function __construct(
\Magento\Authorization\Model\UserContextInterface $userContext,
UserContextInterface $userContext,
\Magento\Framework\EntityManager\EntityManager $entityManager,
\Magento\AsynchronousOperations\Api\Data\BulkSummaryInterfaceFactory $bulkSummaryFactory
) {
Expand All @@ -50,11 +49,15 @@ public function __construct(
*/
public function isAllowed($bulkUuid)
{
/** @var \Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface $bulkSummary */
/** @var BulkSummaryInterface $bulkSummary */
$bulkSummary = $this->entityManager->load(
$this->bulkSummaryFactory->create(),
$bulkUuid
);
if ((int) $bulkSummary->getUserType() === UserContextInterface::USER_TYPE_INTEGRATION) {
return true;
}

return ((int) $bulkSummary->getUserId()) === ((int) $this->userContext->getUserId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@

use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface;

/**
* Class Options
*/
class Options implements \Magento\Framework\Data\OptionSourceInterface
{
/**
* @return array
* @inheritDoc
*/
public function toOptionArray()
{
return [
[
'value' => BulkSummaryInterface::NOT_STARTED,
'label' => 'Not Started'
'label' => __('Not Started')
],
[
'value' => BulkSummaryInterface::IN_PROGRESS,
'label' => 'In Progress'
'label' => __('In Progress')
],
[
'value' => BulkSummaryInterface::FINISHED_SUCCESSFULLY,
'label' => 'Finished Successfully'
'label' => __('Finished Successfully')
],
[
'value' => BulkSummaryInterface::FINISHED_WITH_FAILURE,
'label' => 'Finished with Failure'
'label' => __('Finished with Failure')
]
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\AsynchronousOperations\Model\BulkUserType;

use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\Data\OptionSourceInterface;

class Options implements OptionSourceInterface
{
/**
* @inheritDoc
*/
public function toOptionArray(): array
{
return [
[
'value' => UserContextInterface::USER_TYPE_ADMIN,
'label' => __('Admin user')
],
[
'value' => UserContextInterface::USER_TYPE_INTEGRATION,
'label' => __('Integration')
]
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Framework\Model\ResourceModel\AbstractResource;
use Psr\Log\LoggerInterface as Logger;
use Magento\Authorization\Model\UserContextInterface;
use Magento\Framework\Bulk\BulkSummaryInterface;
use Magento\AsynchronousOperations\Model\StatusMapper;
use Magento\AsynchronousOperations\Model\BulkStatus\CalculatedStatusSql;

/**
* Class SearchResult
*/
class SearchResult extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
/**
Expand All @@ -40,7 +38,6 @@ class SearchResult extends \Magento\Framework\View\Element\UiComponent\DataProvi
private $calculatedStatusSql;

/**
* SearchResult constructor.
* @param EntityFactory $entityFactory
* @param Logger $logger
* @param FetchStrategy $fetchStrategy
Expand All @@ -49,7 +46,7 @@ class SearchResult extends \Magento\Framework\View\Element\UiComponent\DataProvi
* @param StatusMapper $statusMapper
* @param CalculatedStatusSql $calculatedStatusSql
* @param string $mainTable
* @param null $resourceModel
* @param AbstractResource $resourceModel
* @param string $identifierName
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -80,7 +77,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
protected function _initSelect()
{
Expand All @@ -93,12 +90,18 @@ protected function _initSelect()
)->where(
'user_id=?',
$this->userContext->getUserId()
)->where(
'user_type=?',
UserContextInterface::USER_TYPE_ADMIN
)->orWhere(
'user_type=?',
UserContextInterface::USER_TYPE_INTEGRATION
);
return $this;
}

/**
* {@inheritdoc}
* @inheritdoc
*/
protected function _afterLoad()
{
Expand All @@ -110,7 +113,7 @@ protected function _afterLoad()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function addFieldToFilter($field, $condition = null)
{
Expand All @@ -133,7 +136,7 @@ public function addFieldToFilter($field, $condition = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getSelectCountSql()
{
Expand Down
7 changes: 7 additions & 0 deletions app/code/Magento/AsynchronousOperations/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ Error,Error
"Dismiss All Completed Tasks","Dismiss All Completed Tasks"
"Action Details - #","Action Details - #"
"Number of Records Affected","Number of Records Affected"
"User Type","User Type"
"Admin user","Admin user"
"Integration","Integration"
"Not Started","Not Started"
"In Progress","In Progress"
"Finished Successfully","Finished Successfully"
"Finished with Failure","Finished with Failure"
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
<label translate="true">Description of Operation</label>
</settings>
</column>
<column name="user_type" component="Magento_Ui/js/grid/columns/select" sortOrder="55">
<settings>
<filter>select</filter>
<options class="\Magento\AsynchronousOperations\Model\BulkUserType\Options"/>
<dataType>select</dataType>
<label translate="true">User Type</label>
</settings>
</column>
<column name="status" component="Magento_Ui/js/grid/columns/select" sortOrder="60">
<settings>
<filter>select</filter>
Expand Down
Loading

0 comments on commit c2676bb

Please sign in to comment.