Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - magento#19889: [Backport]Fix issue 19507 - Frontend Minicart dropdown alignment issue  (by @speedy008)
 - magento#19910: [Backport] fixed Notification page Select Visible items issue  (by @shikhamis11)
 - magento#19928: [Backport] [Review] Integration tests for not allowed review submission (by @eduard13)
 - magento#19056: Fix issue 19052- Position order showing before the text box (by @speedy008)
 - magento#19989: [Backport] Fixed magento#19605 Don't static compile disabled modules (by @shikhamis11)


Fixed GitHub Issues:
 - magento#19507: Frontend Minicart dropdown alignment issue (reported by @speedy008) has been fixed in magento#19889 by @speedy008 in 2.2-develop branch
   Related commits:
     1. afba6e4

 - magento#19285: On Notification page Select All and Select Visible both works same (reported by @hellotaran) has been fixed in magento#19910 by @shikhamis11 in 2.2-develop branch
   Related commits:
     1. 9804da7
     2. c4bf9d2
     3. 9e37895
     4. b39a770
     5. c0ea9e4
     6. 0810a4a
     7. a69b2d9
     8. 598881f
     9. 84461c5
     10. 8397479
     11. 3808266
     12. 108b190
     13. 25a6c2e
     14. 4fd5c95
     15. 2c55232

 - magento#19052: Position order showing before the text box (reported by @Dharmeshvaja91) has been fixed in magento#19056 by @speedy008 in 2.2-develop branch
   Related commits:
     1. 9e1459a

 - magento#19605: Don't static compile disabled modules (reported by @joshuaadickerson) has been fixed in magento#19989 by @shikhamis11 in 2.2-develop branch
   Related commits:
     1. 1f5ec6f
     2. 484b79a
     3. d291cf3
  • Loading branch information
magento-engcom-team authored Jan 4, 2019
2 parents 88e5cda + 39dd340 commit 523a83e
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Magento\Backend\Block\Widget\Grid\Massaction;

use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\DataObject;

/**
Expand Down Expand Up @@ -51,7 +52,7 @@ public function __construct(
}

/**
* @return void
* @inheritdoc
*/
protected function _construct()
{
Expand Down Expand Up @@ -216,6 +217,7 @@ public function getGridJsObjectName()
* Retrieve JSON string of selected checkboxes
*
* @return string
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
*/
public function getSelectedJson()
{
Expand All @@ -230,6 +232,7 @@ public function getSelectedJson()
* Retrieve array of selected checkboxes
*
* @return string[]
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
*/
public function getSelected()
{
Expand All @@ -251,6 +254,8 @@ public function getApplyButtonHtml()
}

/**
* Get mass action javascript code.
*
* @return string
*/
public function getJavaScript()
Expand All @@ -267,6 +272,8 @@ public function getJavaScript()
}

/**
* Get grid ids in JSON format.
*
* @return string
*/
public function getGridIdsJson()
Expand All @@ -282,7 +289,11 @@ public function getGridIdsJson()
} else {
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
}

if ($allIdsCollection instanceof AbstractDb) {
$allIdsCollection->getSelect()->limit();
$allIdsCollection->clear();
}

$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
if (!empty($gridIds)) {
return join(",", $gridIds);
Expand All @@ -291,6 +302,8 @@ public function getGridIdsJson()
}

/**
* Get Html id.
*
* @return string
*/
public function getHtmlId()
Expand Down
53 changes: 39 additions & 14 deletions app/code/Magento/Deploy/Collector/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*/
namespace Magento\Deploy\Collector;

use Magento\Deploy\Source\SourcePool;
use Magento\Deploy\Package\Package;
use Magento\Deploy\Package\PackageFactory;
use Magento\Deploy\Source\SourcePool;
use Magento\Deploy\Package\PackageFile;
use Magento\Framework\Module\Manager;
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;

/**
Expand Down Expand Up @@ -44,6 +46,9 @@ class Collector implements CollectorInterface
*/
private $packageFactory;

/** @var \Magento\Framework\Module\Manager */
private $moduleManager;

/**
* Default values for package primary identifiers
*
Expand All @@ -61,15 +66,19 @@ class Collector implements CollectorInterface
* @param SourcePool $sourcePool
* @param FileNameResolver $fileNameResolver
* @param PackageFactory $packageFactory
* @param Manager $moduleManager
*/
public function __construct(
SourcePool $sourcePool,
FileNameResolver $fileNameResolver,
PackageFactory $packageFactory
PackageFactory $packageFactory,
Manager $moduleManager = null
) {
$this->sourcePool = $sourcePool;
$this->fileNameResolver = $fileNameResolver;
$this->packageFactory = $packageFactory;
$this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(Manager::class);
}

/**
Expand All @@ -81,19 +90,11 @@ public function collect()
foreach ($this->sourcePool->getAll() as $source) {
$files = $source->get();
foreach ($files as $file) {
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
$params = [
'area' => $file->getArea(),
'theme' => $file->getTheme(),
'locale' => $file->getLocale(),
'module' => $file->getModule(),
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
];
foreach ($this->packageDefaultValues as $name => $value) {
if (!isset($params[$name])) {
$params[$name] = $value;
}
if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
continue;
}
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
$params = $this->getParams($file);
$packagePath = "{$params['area']}/{$params['theme']}/{$params['locale']}";
if (!isset($packages[$packagePath])) {
$packages[$packagePath] = $this->packageFactory->create($params);
Expand All @@ -105,4 +106,28 @@ public function collect()
}
return $packages;
}

/**
* Retrieve package params.
*
* @param PackageFile $file
* @return array
*/
private function getParams(PackageFile $file)
{
$params = [
'area' => $file->getArea(),
'theme' => $file->getTheme(),
'locale' => $file->getLocale(),
'module' => $file->getModule(),
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
];
foreach ($this->packageDefaultValues as $name => $value) {
if (!isset($params[$name])) {
$params[$name] = $value;
}
}

return $params;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
}
}

.catalog-category-edit {
.admin__grid-control {
.admin__grid-control-value {
display: none;
}
}
}

.product-composite-configure-inner {
.admin__control-text {
&.qty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
@_toggle-selector: ~'.action.showcart',
@_options-selector: ~'.block-minicart',
@_dropdown-list-width: 320px,
@_dropdown-list-position-right: 0px,
@_dropdown-list-position-right: -10px,
@_dropdown-list-pointer-position: right,
@_dropdown-list-pointer-position-left-right: 26px,
@_dropdown-list-pointer-position-left-right: 12px,
@_dropdown-list-z-index: 101,
@_dropdown-toggle-icon-content: @icon-cart,
@_dropdown-toggle-active-icon-content: @icon-cart,
Expand Down Expand Up @@ -412,7 +412,6 @@
margin-left: 13px;

.block-minicart {
right: -15px;
width: 390px;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Review\Controller;

use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Data\Form\FormKey;
use Magento\Framework\Message\MessageInterface;
use Magento\TestFramework\Request;
use Magento\TestFramework\TestCase\AbstractController;

/**
* Test review product controller behavior
*
* @magentoAppArea frontend
*/
class CaseCheckAddingProductReviewTest extends AbstractController
{
/**
* Test adding a review for allowed guests with incomplete data by a not logged in user
*
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Review/_files/config.php
* @magentoDataFixture Magento/Catalog/_files/products.php
*/
public function testAttemptForGuestToAddReviewsWithIncompleteData()
{
$product = $this->getProduct();
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);
$post = [
'nickname' => 'Test nick',
'title' => 'Summary',
'form_key' => $formKey->getFormKey(),
];
$this->prepareRequestData($post);
$this->dispatch('review/product/post/id/' . $product->getId());
$this->assertSessionMessages(
$this->equalTo(['Please enter a review.']),
MessageInterface::TYPE_ERROR
);
}

/**
* Test adding a review for not allowed guests by a guest
*
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Review/_files/disable_config.php
* @magentoDataFixture Magento/Catalog/_files/products.php
*/
public function testAttemptForGuestToAddReview()
{
$product = $this->getProduct();
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);
$post = [
'nickname' => 'Test nick',
'title' => 'Summary',
'detail' => 'Test Details',
'form_key' => $formKey->getFormKey(),
];

$this->prepareRequestData($post);
$this->dispatch('review/product/post/id/' . $product->getId());

$this->assertRedirect($this->stringContains('customer/account/login'));
}

/**
* Test successfully adding a product review by a guest
*
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
* @magentoDataFixture Magento/Review/_files/config.php
* @magentoDataFixture Magento/Catalog/_files/products.php
*/
public function testSuccessfullyAddingProductReviewForGuest()
{
$product = $this->getProduct();
/** @var FormKey $formKey */
$formKey = $this->_objectManager->get(FormKey::class);
$post = [
'nickname' => 'Test nick',
'title' => 'Summary',
'detail' => 'Test Details',
'form_key' => $formKey->getFormKey(),
];

$this->prepareRequestData($post);
$this->dispatch('review/product/post/id/' . $product->getId());

$this->assertSessionMessages(
$this->equalTo(['You submitted your review for moderation.']),
MessageInterface::TYPE_SUCCESS
);
}

/**
* @return ProductInterface
*/
private function getProduct()
{
return $this->_objectManager->get(ProductRepositoryInterface::class)->get('custom-design-simple-product');
}

/**
* @param array $postData
* @return void
*/
private function prepareRequestData($postData)
{
$this->getRequest()->setMethod(Request::METHOD_POST);
$this->getRequest()->setPostValue($postData);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var Value $config */
use Magento\Framework\App\Config\Value;

$config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(Value::class);
$config->setPath('catalog/review/allow_guest');
$config->setScope('default');
$config->setScopeId(0);
$config->setValue(0);
$config->save();

0 comments on commit 523a83e

Please sign in to comment.