-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4-develop' into 23971
- Loading branch information
Showing
7,433 changed files
with
257,150 additions
and
59,141 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2) | ||
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2) | ||
<h2>Welcome</h2> | ||
<p align="center"> | ||
<a href="https://magento.com"> | ||
<img src="https://static.magento.com/sites/all/themes/magento/logo.svg" width="300px" alt="Magento" /> | ||
</a> | ||
</p> | ||
<p align="center"> | ||
<br /><br /> | ||
<a href="https://www.codetriage.com/magento/magento2"> | ||
<img src="https://www.codetriage.com/magento/magento2/badges/users.svg" alt="Open Source Helpers" /> | ||
</a> | ||
<a href="https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"> | ||
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter" /> | ||
</a> | ||
<a href="https://crowdin.com/project/magento-2"> | ||
<img src="https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg" alt="Crowdin" /> | ||
</a> | ||
</p> | ||
|
||
## Welcome | ||
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results. | ||
|
||
## Magento System Requirements | ||
[Magento System Requirements](https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html). | ||
|
||
## Install Magento | ||
|
||
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html). | ||
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html). | ||
|
||
## Learn More About GraphQL in Magento 2 | ||
|
||
* [GraphQL Developer Guide](https://devdocs.magento.com/guides/v2.3/graphql/index.html) | ||
|
||
<h2>Contributing to the Magento 2 Code Base</h2> | ||
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions. | ||
|
||
To learn about how to make a contribution, click [here][1]. | ||
To learn about how to contribute, click [here][1]. | ||
|
||
To learn about issues, click [here][2]. To open an issue, click [here][3]. | ||
|
||
To suggest documentation improvements, click [here][4]. | ||
|
||
[1]: <https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html> | ||
[2]: <https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report> | ||
[3]: <https://github.com/magento/magento2/issues> | ||
[4]: <https://devdocs.magento.com> | ||
[1]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html | ||
[2]: https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report | ||
[3]: https://github.com/magento/magento2/issues | ||
[4]: https://devdocs.magento.com | ||
|
||
<h3>Community Maintainers</h3> | ||
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions. | ||
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks to these Community Maintainers for their valuable contributions. | ||
|
||
<a href="https://magento.com/magento-contributors#maintainers"> | ||
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/> | ||
</a> | ||
|
||
<h3>Top Contributors</h3> | ||
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform. | ||
Magento is thankful for any contribution that can improve our codebase, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform. | ||
<a href="https://magento.com/magento-contributors"> | ||
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/> | ||
</a> | ||
|
@@ -44,7 +63,7 @@ Please review the [Code Contributions guide](https://devdocs.magento.com/guides/ | |
|
||
## Reporting Security Issues | ||
|
||
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up your issue. | ||
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up on your issue. | ||
|
||
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up). | ||
|
||
|
@@ -60,7 +79,7 @@ Please see LICENSE_EE.txt for the full text of the MEE License or visit https:// | |
|
||
## Community Engineering Slack | ||
|
||
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us request at [[email protected]](mailto:[email protected]) or [self signup](https://tinyurl.com/engcom-slack). | ||
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [[email protected]](mailto:[email protected]) or [self signup](https://opensource.magento.com/slack). | ||
|
||
|
||
We have channels for each project. These channels are recommended for new members: | ||
|
104 changes: 104 additions & 0 deletions
104
app/code/Magento/AdminAnalytics/Controller/Adminhtml/Config/DisableAdminUsage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAnalytics\Controller\Adminhtml\Config; | ||
|
||
use Magento\Backend\App\Action; | ||
use Magento\Framework\App\Action\HttpPostActionInterface; | ||
use Magento\Framework\Controller\ResultFactory; | ||
use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger as NotificationLogger; | ||
use Magento\Framework\App\ProductMetadataInterface; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use Magento\Config\Model\Config\Factory; | ||
|
||
/** | ||
* Controller to record Admin analytics usage log | ||
*/ | ||
class DisableAdminUsage extends Action implements HttpPostActionInterface | ||
{ | ||
/** | ||
* @var Factory | ||
*/ | ||
private $configFactory; | ||
|
||
/** | ||
* @var ProductMetadataInterface | ||
*/ | ||
private $productMetadata; | ||
|
||
/** | ||
* @var NotificationLogger | ||
*/ | ||
private $notificationLogger; | ||
|
||
/** | ||
* DisableAdminUsage constructor. | ||
* | ||
* @param Action\Context $context | ||
* @param ProductMetadataInterface $productMetadata | ||
* @param NotificationLogger $notificationLogger | ||
* @param Factory $configFactory | ||
*/ | ||
public function __construct( | ||
Action\Context $context, | ||
ProductMetadataInterface $productMetadata, | ||
NotificationLogger $notificationLogger, | ||
Factory $configFactory | ||
) { | ||
parent::__construct($context); | ||
$this->configFactory = $configFactory; | ||
$this->productMetadata = $productMetadata; | ||
$this->notificationLogger = $notificationLogger; | ||
} | ||
|
||
/** | ||
* Change the value of config/admin/usage/enabled | ||
*/ | ||
private function disableAdminUsage() | ||
{ | ||
$configModel = $this->configFactory->create(); | ||
$configModel->setDataByPath('admin/usage/enabled', 0); | ||
$configModel->save(); | ||
} | ||
|
||
/** | ||
* Log information about the last admin usage selection | ||
* | ||
* @return ResultInterface | ||
*/ | ||
private function markUserNotified(): ResultInterface | ||
{ | ||
$responseContent = [ | ||
'success' => $this->notificationLogger->log( | ||
$this->productMetadata->getVersion() | ||
), | ||
'error_message' => '' | ||
]; | ||
|
||
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON); | ||
return $resultJson->setData($responseContent); | ||
} | ||
|
||
/** | ||
* Log information about the last shown advertisement | ||
* | ||
* @return ResultInterface | ||
*/ | ||
public function execute() | ||
{ | ||
$this->disableAdminUsage(); | ||
$this->markUserNotified(); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function _isAllowed() | ||
{ | ||
return $this->_authorization->isAllowed(static::ADMIN_RESOURCE); | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
app/code/Magento/AdminAnalytics/Controller/Adminhtml/Config/EnableAdminUsage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAnalytics\Controller\Adminhtml\Config; | ||
|
||
use Magento\Backend\App\Action; | ||
use Magento\Framework\App\Action\HttpPostActionInterface; | ||
use Magento\Framework\Controller\ResultFactory; | ||
use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger as NotificationLogger; | ||
use Magento\Framework\App\ProductMetadataInterface; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use Magento\Config\Model\Config\Factory; | ||
|
||
/** | ||
* Controller to record that the current admin user has responded to Admin Analytics notice | ||
*/ | ||
class EnableAdminUsage extends Action implements HttpPostActionInterface | ||
{ | ||
/** | ||
* @var Factory | ||
*/ | ||
private $configFactory; | ||
|
||
/** | ||
* @var ProductMetadataInterface | ||
*/ | ||
private $productMetadata; | ||
|
||
/** | ||
* @var NotificationLogger | ||
*/ | ||
private $notificationLogger; | ||
|
||
/** | ||
* @param Action\Context $context | ||
* @param ProductMetadataInterface $productMetadata | ||
* @param NotificationLogger $notificationLogger | ||
* @param Factory $configFactory | ||
*/ | ||
public function __construct( | ||
Action\Context $context, | ||
ProductMetadataInterface $productMetadata, | ||
NotificationLogger $notificationLogger, | ||
Factory $configFactory | ||
) { | ||
parent::__construct($context); | ||
$this->configFactory = $configFactory; | ||
$this->productMetadata = $productMetadata; | ||
$this->notificationLogger = $notificationLogger; | ||
} | ||
|
||
/** | ||
* Change the value of config/admin/usage/enabled | ||
*/ | ||
private function enableAdminUsage() | ||
{ | ||
$configModel = $this->configFactory->create(); | ||
$configModel->setDataByPath('admin/usage/enabled', 1); | ||
$configModel->save(); | ||
} | ||
|
||
/** | ||
* Log information about the last user response | ||
* | ||
* @return ResultInterface | ||
*/ | ||
private function markUserNotified(): ResultInterface | ||
{ | ||
$responseContent = [ | ||
'success' => $this->notificationLogger->log( | ||
$this->productMetadata->getVersion() | ||
), | ||
'error_message' => '' | ||
]; | ||
|
||
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON); | ||
return $resultJson->setData($responseContent); | ||
} | ||
|
||
/** | ||
* Log information about the last shown advertisement | ||
* | ||
* @return \Magento\Framework\Controller\ResultInterface | ||
*/ | ||
public function execute() | ||
{ | ||
$this->enableAdminUsage(); | ||
$this->markUserNotified(); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function _isAllowed() | ||
{ | ||
return $this->_authorization->isAllowed(static::ADMIN_RESOURCE); | ||
} | ||
} |
Oops, something went wrong.