-
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 ASI-1789
- Loading branch information
Showing
155 changed files
with
4,607 additions
and
1,103 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...agento/Analytics/Test/Mftf/ActionGroup/AdminOpenConfigGeneralAnalyticsPageActionGroup.xml
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,19 @@ | ||
<?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="AdminOpenConfigGeneralAnalyticsPageActionGroup"> | ||
<annotations> | ||
<description>Open Config General Analytics Page.</description> | ||
</annotations> | ||
|
||
<amOnPage url="{{AdminConfigGeneralAnalyticsPage.url}}" stepKey="amOnAdminConfig"/> | ||
<waitForPageLoad stepKey="waitPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
...agento/Analytics/Test/Mftf/ActionGroup/AssertAdminAdvancedReportingPageUrlActionGroup.xml
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,20 @@ | ||
<?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="AssertAdminAdvancedReportingPageUrlActionGroup"> | ||
<annotations> | ||
<description>Assert admin advanced reporting page url.</description> | ||
</annotations> | ||
|
||
<switchToNextTab stepKey="switchToNewTab"/> | ||
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/> | ||
<seeInCurrentUrl url="advancedreporting.rjmetrics.com/report" stepKey="seeAssertAdvancedReportingPageUrl"/> | ||
</actionGroup> | ||
</actionGroups> |
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
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
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
71 changes: 36 additions & 35 deletions
71
app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/OnInsert.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 |
---|---|---|
@@ -1,62 +1,63 @@ | ||
<?php | ||
/** | ||
* | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Cms\Controller\Adminhtml\Wysiwyg\Images; | ||
|
||
class OnInsert extends \Magento\Cms\Controller\Adminhtml\Wysiwyg\Images | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Cms\Controller\Adminhtml\Wysiwyg\Images; | ||
use Magento\Cms\Model\Wysiwyg\Images\GetInsertImageContent; | ||
use Magento\Framework\App\Action\HttpPostActionInterface; | ||
use Magento\Framework\Controller\Result\RawFactory; | ||
use Magento\Framework\Controller\ResultInterface; | ||
use Magento\Framework\Registry; | ||
|
||
class OnInsert extends Images implements HttpPostActionInterface | ||
{ | ||
/** | ||
* @var \Magento\Framework\Controller\Result\RawFactory | ||
* @var RawFactory | ||
*/ | ||
protected $resultRawFactory; | ||
|
||
/** | ||
* @param \Magento\Backend\App\Action\Context $context | ||
* @param \Magento\Framework\Registry $coreRegistry | ||
* @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory | ||
* @var GetInsertImageContent | ||
*/ | ||
private $getInsertImageContent; | ||
|
||
/** | ||
* @param Context $context | ||
* @param Registry $coreRegistry | ||
* @param RawFactory $resultRawFactory | ||
* @param GetInsertImageContent $getInsertImageContent | ||
*/ | ||
public function __construct( | ||
\Magento\Backend\App\Action\Context $context, | ||
\Magento\Framework\Registry $coreRegistry, | ||
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory | ||
Context $context, | ||
Registry $coreRegistry, | ||
RawFactory $resultRawFactory, | ||
?GetInsertImageContent $getInsertImageContent = null | ||
) { | ||
$this->resultRawFactory = $resultRawFactory; | ||
parent::__construct($context, $coreRegistry); | ||
$this->getInsertImageContent = $getInsertImageContent ?: $this->_objectManager | ||
->get(GetInsertImageContent::class); | ||
} | ||
|
||
/** | ||
* Fire when select image | ||
* Return a content (just a link or an html block) for inserting image to the content | ||
* | ||
* @return \Magento\Framework\Controller\ResultInterface | ||
* @return ResultInterface | ||
*/ | ||
public function execute() | ||
{ | ||
$imagesHelper = $this->_objectManager->get(\Magento\Cms\Helper\Wysiwyg\Images::class); | ||
$request = $this->getRequest(); | ||
|
||
$storeId = $request->getParam('store'); | ||
|
||
$filename = $request->getParam('filename'); | ||
$filename = $imagesHelper->idDecode($filename); | ||
|
||
$asIs = $request->getParam('as_is'); | ||
|
||
$forceStaticPath = $request->getParam('force_static_path'); | ||
|
||
$this->_objectManager->get(\Magento\Catalog\Helper\Data::class)->setStoreId($storeId); | ||
$imagesHelper->setStoreId($storeId); | ||
|
||
if ($forceStaticPath) { | ||
$image = parse_url($imagesHelper->getCurrentUrl() . $filename, PHP_URL_PATH); | ||
} else { | ||
$image = $imagesHelper->getImageHtmlDeclaration($filename, $asIs); | ||
} | ||
|
||
/** @var \Magento\Framework\Controller\Result\Raw $resultRaw */ | ||
$resultRaw = $this->resultRawFactory->create(); | ||
return $resultRaw->setContents($image); | ||
$data = $this->getRequest()->getParams(); | ||
return $this->resultRawFactory->create()->setContents( | ||
$this->getInsertImageContent->execute( | ||
$data['filename'], | ||
$data['force_static_path'], | ||
$data['as_is'], | ||
isset($data['store']) ? (int) $data['store'] : null | ||
) | ||
); | ||
} | ||
} |
Oops, something went wrong.