Skip to content

Commit a36a806

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into EPAM-PR-35
2 parents 01e70db + 664a673 commit a36a806

File tree

85 files changed

+2939
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2939
-392
lines changed

app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function __construct(
6161
* Add parent id/sku pair to use for option filter at fetch time.
6262
*
6363
* @param int $parentId
64+
* @param int $parentEntityId
6465
* @param string $sku
6566
*/
6667
public function addParentFilterData(int $parentId, int $parentEntityId, string $sku) : void

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
163163
{
164164
$adminValues = [];
165165
foreach ($optionsValues as $optionKey => $values) {
166-
if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
166+
if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
167167
$adminValues[] = reset($values);
168168
}
169169
}

app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
*/
1616
class LevelCalculator
1717
{
18+
/**
19+
* @var ResourceConnection
20+
*/
21+
private $resourceConnection;
22+
23+
/**
24+
* @var Category
25+
*/
26+
private $resourceCategory;
27+
1828
/**
1929
* @param ResourceConnection $resourceConnection
2030
* @param Category $resourceCategory
@@ -39,6 +49,7 @@ public function calculate(int $rootCategoryId) : int
3949
$select = $connection->select()
4050
->from($this->resourceConnection->getTableName('catalog_category_entity'), 'level')
4151
->where($this->resourceCategory->getLinkField() . " = ?", $rootCategoryId);
52+
4253
return (int) $connection->fetchOne($select);
4354
}
4455
}

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
3737
<!--see Insert Widget button disabled-->
3838
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
39-
<!--see Cancel button enabed-->
39+
<!--see Cancel button enabled-->
4040
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4141
<!--Select "Widget Type"-->
4242
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="CMS Page Link" stepKey="selectCMSPageLink" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
4343
<!--see Insert Widget button disabled-->
4444
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
45-
<!--see Cancel button enabed-->
45+
<!--see Cancel button enabled-->
4646
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4747
<!--Select "Widget Type"-->
4848
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Catalog Products List" stepKey="selectCatalogProductsList" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<waitForPageLoad stepKey="wait2"/>
4242
<!--see Insert Widget button disabled-->
4343
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
44-
<!--see Cancel button enabed-->
44+
<!--see Cancel button enabled-->
4545
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4646
<!--Select "Widget Type"-->
4747
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Compared Products" stepKey="selectRecentlyComparedProducts" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<see userInput="Inserting a widget does not create a widget instance." stepKey="seeMessage" />
4141
<!--see Insert Widget button disabled-->
4242
<see selector="{{WidgetSection.InsertWidgetBtnDisabled}}" userInput="Insert Widget" stepKey="seeInsertWidgetDisabled" />
43-
<!--see Cancel button enabed-->
43+
<!--see Cancel button enabled-->
4444
<see selector="{{WidgetSection.CancelBtnEnabled}}" userInput="Cancel" stepKey="seeCancelBtnEnabled" />
4545
<!--Select "Widget Type"-->
4646
<selectOption selector="{{WidgetSection.WidgetType}}" userInput="Recently Viewed Products" stepKey="selectRecentlyViewedProducts" />

app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,25 @@
88
namespace Magento\ConfigurableProductGraphQl\Model;
99

1010
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
11+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as Type;
1112

1213
/**
13-
* {@inheritdoc}
14+
* @inheritdoc
1415
*/
1516
class ConfigurableProductTypeResolver implements TypeResolverInterface
1617
{
1718
/**
18-
* {@inheritdoc}
19+
* Configurable product type resolver code
1920
*/
20-
public function resolveType(array $data) : string
21+
const TYPE_RESOLVER = 'ConfigurableProduct';
22+
23+
/**
24+
* @inheritdoc
25+
*/
26+
public function resolveType(array $data): string
2127
{
22-
if (isset($data['type_id']) && $data['type_id'] == 'configurable') {
23-
return 'ConfigurableProduct';
28+
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
29+
return self::TYPE_RESOLVER;
2430
}
2531
return '';
2632
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CustomerGraphQl\Model\Customer;
9+
10+
use Magento\Customer\Api\AccountManagementInterface;
11+
use Magento\Customer\Api\Data\CustomerInterface;
12+
use Magento\Customer\Api\Data\CustomerInterfaceFactory;
13+
use Magento\Framework\Api\DataObjectHelper;
14+
use Magento\Framework\Exception\LocalizedException;
15+
use Magento\Framework\Exception\NoSuchEntityException;
16+
use Magento\Store\Model\StoreManagerInterface;
17+
18+
/**
19+
* Class CreateAccount creates new customer account
20+
*/
21+
class CreateAccount
22+
{
23+
/**
24+
* @var DataObjectHelper
25+
*/
26+
private $dataObjectHelper;
27+
28+
/**
29+
* @var CustomerInterfaceFactory
30+
*/
31+
private $customerFactory;
32+
33+
/**
34+
* @var AccountManagementInterface
35+
*/
36+
private $accountManagement;
37+
38+
/**
39+
* @var StoreManagerInterface
40+
*/
41+
private $storeManager;
42+
43+
/**
44+
* @param DataObjectHelper $dataObjectHelper
45+
* @param CustomerInterfaceFactory $customerFactory
46+
* @param StoreManagerInterface $storeManager
47+
* @param AccountManagementInterface $accountManagement
48+
*/
49+
public function __construct(
50+
DataObjectHelper $dataObjectHelper,
51+
CustomerInterfaceFactory $customerFactory,
52+
StoreManagerInterface $storeManager,
53+
AccountManagementInterface $accountManagement
54+
) {
55+
$this->dataObjectHelper = $dataObjectHelper;
56+
$this->customerFactory = $customerFactory;
57+
$this->accountManagement = $accountManagement;
58+
$this->storeManager = $storeManager;
59+
}
60+
61+
/**
62+
* Creates new customer account
63+
*
64+
* @param array $args
65+
* @return CustomerInterface
66+
* @throws LocalizedException
67+
* @throws NoSuchEntityException
68+
*/
69+
public function execute(array $args): CustomerInterface
70+
{
71+
$customerDataObject = $this->customerFactory->create();
72+
$this->dataObjectHelper->populateWithArray(
73+
$customerDataObject,
74+
$args['input'],
75+
CustomerInterface::class
76+
);
77+
$store = $this->storeManager->getStore();
78+
$customerDataObject->setWebsiteId($store->getWebsiteId());
79+
$customerDataObject->setStoreId($store->getId());
80+
81+
$password = array_key_exists('password', $args['input']) ? $args['input']['password'] : null;
82+
83+
return $this->accountManagement->createAccount($customerDataObject, $password);
84+
}
85+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CustomerGraphQl\Model\Customer;
9+
10+
use Magento\Customer\Api\Data\CustomerInterface;
11+
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
12+
use Magento\Authorization\Model\UserContextInterface;
13+
14+
/**
15+
* Set up user context after creating new customer account
16+
*/
17+
class SetUpUserContext
18+
{
19+
/**
20+
* Set up user context after creating new customer account
21+
*
22+
* @param ContextInterface $context
23+
* @param CustomerInterface $customer
24+
*/
25+
public function execute(ContextInterface $context, CustomerInterface $customer)
26+
{
27+
$context->setUserId((int)$customer->getId());
28+
$context->setUserType(UserContextInterface::USER_TYPE_CUSTOMER);
29+
}
30+
}

0 commit comments

Comments
 (0)