forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
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 front_order_list
- Loading branch information
Showing
125 changed files
with
3,531 additions
and
1,390 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
26 changes: 26 additions & 0 deletions
26
.../Catalog/Test/Mftf/ActionGroup/AdminProductFormCategoryExistInCategoryListActionGroup.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,26 @@ | ||
<?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="AdminProductFormCategoryExistInCategoryListActionGroup"> | ||
<annotations> | ||
<description>Check Category exist in Category list for Assign to Product.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="categoryName" type="string"/> | ||
</arguments> | ||
|
||
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> | ||
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="{{categoryName}}" | ||
stepKey="fillSearchCategory"/> | ||
<see selector="{{AdminProductFormSection.selectCategory(categoryName)}}" userInput="{{categoryName}}" | ||
stepKey="seeCategory"/> | ||
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategorySelect"/> | ||
</actionGroup> | ||
</actionGroups> |
26 changes: 26 additions & 0 deletions
26
...talog/Test/Mftf/ActionGroup/AdminProductFormCategoryNotExistInCategoryListActionGroup.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,26 @@ | ||
<?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="AdminProductFormCategoryNotExistInCategoryListActionGroup"> | ||
<annotations> | ||
<description>Check Category not exist in Category list for Assign to Product.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="categoryName" type="string"/> | ||
</arguments> | ||
|
||
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> | ||
<fillField selector="{{AdminProductFormSection.searchCategory}}" userInput="{{categoryName}}" | ||
stepKey="fillSearchCategory"/> | ||
<dontSee selector="{{AdminProductFormSection.selectCategory(categoryName)}}" userInput="{{categoryName}}" | ||
stepKey="seeCategory"/> | ||
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategorySelect"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSubmitCategoriesPopupActionGroup.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,18 @@ | ||
<?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="AdminSubmitCategoriesPopupActionGroup"> | ||
<annotations> | ||
<description>Clicks the "Done" button on the Search Categories popup.</description> | ||
</annotations> | ||
|
||
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneButton" /> | ||
</actionGroup> | ||
</actionGroups> |
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
94 changes: 94 additions & 0 deletions
94
app/code/Magento/GiftMessageGraphQl/Model/Resolver/Cart/GiftMessage.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,94 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GiftMessageGraphQl\Model\Resolver\Cart; | ||
|
||
use Magento\Framework\Exception\LocalizedException; | ||
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\Resolver\Value; | ||
use Magento\Framework\GraphQl\Query\ResolverInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Magento\GiftMessage\Api\CartRepositoryInterface; | ||
use Magento\GiftMessage\Helper\Message as GiftMessageHelper; | ||
|
||
/** | ||
* Class provides ability to get GiftMessage for cart | ||
*/ | ||
class GiftMessage implements ResolverInterface | ||
{ | ||
/** | ||
* @var CartRepositoryInterface | ||
*/ | ||
private $cartRepository; | ||
|
||
/** | ||
* @var GiftMessageHelper | ||
*/ | ||
private $giftMessageHelper; | ||
|
||
/** | ||
* @param CartRepositoryInterface $cartRepository | ||
* @param GiftMessageHelper $giftMessageHelper | ||
*/ | ||
public function __construct( | ||
CartRepositoryInterface $cartRepository, | ||
GiftMessageHelper $giftMessageHelper | ||
) { | ||
$this->cartRepository = $cartRepository; | ||
$this->giftMessageHelper = $giftMessageHelper; | ||
} | ||
|
||
/** | ||
* Return information about Gift message of cart | ||
* | ||
* @param Field $field | ||
* @param ContextInterface $context | ||
* @param ResolveInfo $info | ||
* @param array|null $value | ||
* @param array|null $args | ||
* | ||
* @return array|Value|mixed | ||
* | ||
* @throws GraphQlInputException | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function resolve( | ||
Field $field, | ||
$context, | ||
ResolveInfo $info, | ||
array $value = null, | ||
array $args = null | ||
) { | ||
if (!isset($value['model'])) { | ||
throw new GraphQlInputException(__('"model" value should be specified')); | ||
} | ||
|
||
$cart = $value['model']; | ||
|
||
if (!$this->giftMessageHelper->isMessagesAllowed('order', $cart)) { | ||
return null; | ||
} | ||
|
||
try { | ||
$giftCartMessage = $this->cartRepository->get($cart->getId()); | ||
} catch (LocalizedException $e) { | ||
throw new GraphQlInputException(__('Can\'t load cart.')); | ||
} | ||
|
||
if (!isset($giftCartMessage)) { | ||
return null; | ||
} | ||
|
||
return [ | ||
'to' => $giftCartMessage->getRecipient() ?? '', | ||
'from' => $giftCartMessage->getSender() ?? '', | ||
'message'=> $giftCartMessage->getMessage() ?? '' | ||
]; | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
app/code/Magento/GiftMessageGraphQl/Model/Resolver/Order/GiftMessage.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,78 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GiftMessageGraphQl\Model\Resolver\Order; | ||
|
||
use Magento\Framework\Exception\LocalizedException; | ||
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\Resolver\Value; | ||
use Magento\Framework\GraphQl\Query\ResolverInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Magento\GiftMessage\Api\OrderRepositoryInterface; | ||
|
||
/** | ||
* Class for getting GiftMessage from CustomerOrder | ||
*/ | ||
class GiftMessage implements ResolverInterface | ||
{ | ||
/** | ||
* @var OrderRepositoryInterface | ||
*/ | ||
private $orderRepository; | ||
|
||
/** | ||
* @param OrderRepositoryInterface $orderRepository | ||
*/ | ||
public function __construct( | ||
OrderRepositoryInterface $orderRepository | ||
) { | ||
$this->orderRepository = $orderRepository; | ||
} | ||
|
||
/** | ||
* Return information about gift message for order | ||
* | ||
* @param Field $field | ||
* @param ContextInterface $context | ||
* @param ResolveInfo $info | ||
* @param array|null $value | ||
* @param array|null $args | ||
* | ||
* @return array|Value|mixed | ||
* @throws GraphQlInputException | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
public function resolve( | ||
Field $field, | ||
$context, | ||
ResolveInfo $info, | ||
array $value = null, | ||
array $args = null | ||
) { | ||
if (!isset($value['id'])) { | ||
throw new GraphQlInputException(__('"id" value should be specified')); | ||
} | ||
|
||
try { | ||
$orderGiftMessage = $this->orderRepository->get($value['id']); | ||
} catch (LocalizedException $e) { | ||
throw new GraphQlInputException(__('Can\'t load gift message for order')); | ||
} | ||
|
||
if (!isset($orderGiftMessage)) { | ||
return null; | ||
} | ||
|
||
return [ | ||
'to' => $orderGiftMessage->getRecipient() ?? '', | ||
'from' => $orderGiftMessage->getSender() ?? '', | ||
'message'=> $orderGiftMessage->getMessage() ?? '' | ||
]; | ||
} | ||
} |
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,3 @@ | ||
# GiftMessageGraphQl | ||
|
||
**GiftMessageGraphQl** provides information about gift messages for cart, cart items, order and order items. |
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,25 @@ | ||
{ | ||
"name": "magento/module-gift-message-graph-ql", | ||
"description": "N/A", | ||
"type": "magento2-module", | ||
"require": { | ||
"php": "~7.3.0||~7.4.0", | ||
"magento/framework": "*", | ||
"magento/module-gift-message": "*" | ||
}, | ||
"suggest": { | ||
"magento/module-graph-ql": "*" | ||
}, | ||
"license": [ | ||
"OSL-3.0", | ||
"AFL-3.0" | ||
], | ||
"autoload": { | ||
"files": [ | ||
"registration.php" | ||
], | ||
"psr-4": { | ||
"Magento\\GiftMessageGraphQl\\": "" | ||
} | ||
} | ||
} |
Oops, something went wrong.