Skip to content

Commit

Permalink
Merge branch '2.4-develop' into paypalflowpro-graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
Usik2203 committed Jul 21, 2020
2 parents 6596e65 + 455ca54 commit d6a2fb7
Show file tree
Hide file tree
Showing 520 changed files with 11,276 additions and 1,677 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<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://magento.com">
<img src="https://static.magento.com/sites/all/themes/magento/logo.svg" width="300px" alt="Magento Commerce" />
</a>
<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>
Expand Down
10 changes: 9 additions & 1 deletion app/code/Magento/AsynchronousOperations/Model/MassConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,19 @@ public function process($maxNumberOfMessages = null)
$this->registry->register('isSecureArea', true, true);

$queue = $this->configuration->getQueue();
$maxIdleTime = $this->configuration->getMaxIdleTime();
$sleep = $this->configuration->getSleep();

if (!isset($maxNumberOfMessages)) {
$queue->subscribe($this->getTransactionCallback($queue));
} else {
$this->invoker->invoke($queue, $maxNumberOfMessages, $this->getTransactionCallback($queue));
$this->invoker->invoke(
$queue,
$maxNumberOfMessages,
$this->getTransactionCallback($queue),
$maxIdleTime,
$sleep
);
}

$this->registry->unregister('isSecureArea');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@
<waitForPageLoad stepKey="waitForInvoicePageToLoad"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessInvoiceMessage"/>
<!--Create Shipment for the order-->
<comment userInput="Create Shipment for the order" stepKey="createShipmentForOrder"/>
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage2"/>
<waitForPageLoad time="30" stepKey="waitForOrderListPageLoading"/>
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrdersPage2"/>
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="openOrderPageForShip"/>
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
<waitForPageLoad stepKey="waitForShipmentPagePage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
<amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
<!-- Search for the product by sku -->
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createDynamicBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
<waitForPageLoad stepKey="waitForSearchButton"/>
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForSearchResults"/>
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm">
<argument name="query" value="$$createDynamicBundleProduct.sku$$"/>
</actionGroup>
<!-- Should not see any search results -->
<dontSee userInput="$$createDynamicBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
<amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.name$$)}}" stepKey="amOnBundleProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/>
<!-- Search for the product by sku -->
<fillField selector="{{StorefrontQuickSearchSection.searchPhrase}}" userInput="$$createFixedBundleProduct.sku$$" stepKey="fillSearchBarByProductSku"/>
<waitForPageLoad stepKey="waitForSearchButton"/>
<click selector="{{StorefrontQuickSearchSection.searchButton}}" stepKey="clickSearchButton"/>
<waitForPageLoad stepKey="waitForSearchResults"/>
<actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm">
<argument name="query" value="$$createFixedBundleProduct.sku$$"/>
</actionGroup>
<!-- Should not see any search results -->
<dontSee userInput="$$createFixedBundleProduct.sku$$" selector="{{StorefrontCatalogSearchMainSection.searchResults}}" stepKey="dontSeeProduct"/>
<see selector="{{StorefrontCatalogSearchMainSection.message}}" userInput="Your search returned no results." stepKey="seeCantFindProductOneMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<seeElement stepKey="LookingForNameOfProduct" selector="{{StorefrontBundledSection.bundleProductName}}"/>

<!--Testing disabled view-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="GoToProductCatalog"/>
<waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="GoToProductCatalog"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="FindProductEditPage">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@

<!-- Create a product to appear in the widget, fill in basic info first -->

<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="amOnProductList"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/>
<click selector="{{AdminProductGridActionSection.addBundleProduct}}" stepKey="clickAddBundleProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="fillProductName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down Expand Up @@ -84,8 +83,7 @@
<grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>

<!-- Find the product that we just created using the product grid -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPage"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct">
<argument name="product" value="BundleProduct"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
</after>

<!-- Start creating a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/>
<waitForPageLoad stepKey="waitForProductList"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductList"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
</after>

<!-- Create a bundle product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageBundle"/>
<actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\BundleGraphQl\Model\Resolver\Options;

use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;

/**
* Format new option uid in base64 encode for entered bundle options
*/
class BundleItemOptionUid implements ResolverInterface
{
/**
* Option type name
*/
private const OPTION_TYPE = 'bundle';

/**
* Create a option uid for entered option in "<option-type>/<option-id>/<option-value-id>/<quantity>" format
*
* @param Field $field
* @param ContextInterface $context
* @param ResolveInfo $info
* @param array|null $value
* @param array|null $args
*
* @return string
*
* @throws GraphQlInputException
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function resolve(
Field $field,
$context,
ResolveInfo $info,
array $value = null,
array $args = null
) {
if (!isset($value['option_id']) || empty($value['option_id'])) {
throw new GraphQlInputException(__('"option_id" value should be specified.'));
}

if (!isset($value['selection_id']) || empty($value['selection_id'])) {
throw new GraphQlInputException(__('"selection_id" value should be specified.'));
}

$optionDetails = [
self::OPTION_TYPE,
$value['option_id'],
$value['selection_id'],
(int) $value['selection_qty']
];

$content = implode('/', $optionDetails);

// phpcs:ignore Magento2.Functions.DiscouragedFunction
return base64_encode($content);
}
}
1 change: 1 addition & 0 deletions app/code/Magento/BundleGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type BundleItemOption @doc(description: "BundleItemOption defines characteristic
price_type: PriceTypeEnum @doc(description: "One of FIXED, PERCENT, or DYNAMIC.")
can_change_quantity: Boolean @doc(description: "Indicates whether the customer can change the number of items for this option.")
product: ProductInterface @doc(description: "Contains details about this product option.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
uid: ID! @doc(description: "A string that encodes option details.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\BundleItemOptionUid") # A Base64 string that encodes option details.
}

type BundleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "BundleProduct defines basic features of a bundle product and contains multiple BundleItems.") {
Expand Down
13 changes: 12 additions & 1 deletion app/code/Magento/Catalog/Model/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
*
* @var string
*/
protected $_cacheTag = self::CACHE_TAG;
protected $_cacheTag = false;

/**
* URL Model instance
Expand Down Expand Up @@ -1111,6 +1111,17 @@ public function afterSave()
return $result;
}

/**
* @inheritDoc
*/
public function getCacheTags()
{
$identities = $this->getIdentities();
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();

return $cacheTags;
}

/**
* Init indexing process after category save
*
Expand Down
21 changes: 18 additions & 3 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Magento\Catalog\Api\ProductLinkRepositoryInterface;
use Magento\Catalog\Model\Product\Attribute\Backend\Media\EntryConverterPool;
use Magento\Catalog\Model\Product\Configuration\Item\Option\OptionInterface;
use Magento\Catalog\Model\FilterProductCustomAttribute;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\ObjectManager;
Expand Down Expand Up @@ -977,6 +976,17 @@ public function afterSave()
return $result;
}

/**
* @inheritDoc
*/
public function getCacheTags()
{
$identities = $this->getIdentities();
$cacheTags = !empty($identities) ? (array) $identities : parent::getCacheTags();

return $cacheTags;
}

/**
* Set quantity for product
*
Expand Down Expand Up @@ -2158,7 +2168,7 @@ public function reset()
*/
public function getCacheIdTags()
{
// phpstan:ignore
// phpstan:ignore "Call to an undefined static method"
$tags = parent::getCacheIdTags();
$affectedCategoryIds = $this->getAffectedCategoryIds();
if (!$affectedCategoryIds) {
Expand Down Expand Up @@ -2339,7 +2349,8 @@ public function isDisabled()
public function getImage()
{
$this->getTypeInstance()->setImageFromChildProduct($this);
// phpstan:ignore

// phpstan:ignore "Call to an undefined static method"
return parent::getImage();
}

Expand Down Expand Up @@ -2403,6 +2414,8 @@ public function reloadPriceInfo()
}
}

//phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore

/**
* Return Data Object data in array format.
*
Expand Down Expand Up @@ -2430,6 +2443,8 @@ public function __toArray() //phpcs:ignore PHPCompatibility.FunctionNameRestrict
return $data;
}

//phpcs:enable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore

/**
* Convert Category model into flat array.
*
Expand Down
Loading

0 comments on commit d6a2fb7

Please sign in to comment.