Skip to content

Commit 96dec49

Browse files
authored
Merge pull request #9592 from magento-gl/spartans_pr_11022025
[Spartans] BugFixes Delivery
2 parents 2b17d9b + 2af81a2 commit 96dec49

File tree

15 files changed

+282
-38
lines changed

15 files changed

+282
-38
lines changed

app/code/Magento/BundleGraphQl/etc/schema.graphqls

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright © Magento, Inc. All rights reserved.
2-
# See COPYING.txt for license details.
1+
# Copyright 2018 Adobe.
2+
# All Rights Reserved.
33

44
type Mutation {
55
addBundleProductsToCart(input: AddBundleProductsToCartInput @doc(description: "An input object that defines which bundle products to add to the cart.")): AddBundleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description: "Add one or more bundle products to the specified cart. We recommend using `addProductsToCart` instead.")
@@ -103,6 +103,7 @@ enum ShipBundleItemsEnum @doc(description: "Defines whether bundle items must be
103103

104104
type BundleOrderItem implements OrderItemInterface @doc(description: "Defines bundle product options for `OrderItemInterface`.") {
105105
bundle_options: [ItemSelectedBundleOption] @doc(description: "A list of bundle options that are assigned to the bundle product.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Order\\Item\\BundleOptions")
106+
parent_sku: String @doc(description: "The SKU of parent product.")
106107
}
107108

108109
type BundleInvoiceItem implements InvoiceItemInterface @doc(description: "Defines bundle product options for `InvoiceItemInterface`.") {

app/code/Magento/Cms/Test/Mftf/Section/CmsPagesPageActionsSection.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2017 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -15,9 +15,9 @@
1515
<element name="searchInput" type="input" selector="#fulltext"/>
1616
<element name="searchButton" type="button" selector="//*[@id='fulltext']/parent::*/button"/>
1717
<element name="addNewPageButton" type="button" selector="#add" timeout="30"/>
18-
<element name="select" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//button[text()='Select']" parameterized="true"/>
19-
<element name="edit" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Edit']" parameterized="true"/>
20-
<element name="preview" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='View']" parameterized="true"/>
18+
<element name="select" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//button[text()='Select']" parameterized="true"/>
19+
<element name="edit" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//a[text()='Edit']" parameterized="true"/>
20+
<element name="preview" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//a[text()='View']" parameterized="true"/>
2121
<element name="clearAllButton" type="button" selector="//div[@class='admin__data-grid-header']//button[contains(text(), 'Clear all')]" timeout="60"/>
2222
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
2323
<element name="activeFilters" type="button" selector="//div[@class='admin__data-grid-header']//span[contains(text(), 'Active filters:')]" />
@@ -27,7 +27,7 @@
2727
<element name="activeFilter" type="button" selector="(//div[contains(@class, 'admin__data-grid-filters-current') and contains(@class, '_show')])[1]"/>
2828
<element name="savePageSuccessMessage" type="text" selector=".message-success"/>
2929
<element name="savePageWarningMessage" type="text" selector=".message-warning"/>
30-
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" parameterized="true"/>
30+
<element name="delete" type="button" selector="//div[text()='{{var1}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//a[text()='Delete']" parameterized="true"/>
3131
<element name="deleteConfirm" type="button" selector=".action-primary.action-accept" timeout="60"/>
3232
<element name="pageRowCheckboxByIdentifier" type="checkbox" selector="//table[@data-role='grid']//td[count(../../..//th[./*[.='URL Key']]/preceding-sibling::th) + 1][./*[.='{{identifier}}']]/../td//input[@data-action='select-row']" parameterized="true" />
3333
<element name="massActionsButton" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[contains(@class, 'action-select')]" />

app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2017 Adobe.
5+
* All Rights Reserved.
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
@@ -85,4 +85,11 @@
8585
<type name="Magento\Quote\Model\Quote">
8686
<plugin name="update_customized_options" type="Magento\ConfigurableProductGraphQl\Plugin\Quote\UpdateCustomizedOptions"/>
8787
</type>
88+
<type name="Magento\SalesGraphQl\Model\TypeResolver\OrderItem">
89+
<arguments>
90+
<argument name="productTypeMap" xsi:type="array">
91+
<item name="configurable" xsi:type="string">ConfigurableOrderItem</item>
92+
</argument>
93+
</arguments>
94+
</type>
8895
</config>

app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright © Magento, Inc. All rights reserved.
2-
# See COPYING.txt for license details.
1+
# Copyright 2018 Adobe.
2+
# All Rights Reserved.
33
type Mutation {
44
addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput @doc(description: "An input object that defines which configurable products to add to the cart.")): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") @doc(description: "Add one or more configurable products to the specified cart. We recommend using `addProductsToCart` instead.")
55
}
@@ -111,3 +111,7 @@ type ConfigurableProductOptionValue @doc(description: "Defines a value for a con
111111
type StoreConfig {
112112
configurable_thumbnail_source : String @doc(description: "Indicates whether the `parent` or child (`itself`) thumbnail should be used in the cart for configurable products.")
113113
}
114+
115+
type ConfigurableOrderItem implements OrderItemInterface {
116+
parent_sku: String @doc(description: "The SKU of parent product.")
117+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2018 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminCustomerGroupGridActionsSection">
12-
<element name="selectButton" type="button" selector="//div[text()='{{groupName}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//button[text()='Select']" timeout="30" parameterized="true"/>
13-
<element name="deleteAction" type="button" selector="//div[text()='{{groupName}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='Delete']" timeout="30" parameterized="true"/>
12+
<element name="selectButton" type="button" selector="//div[text()='{{groupName}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//button[text()='Select']" timeout="30" parameterized="true"/>
13+
<element name="deleteAction" type="button" selector="//div[text()='{{groupName}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell data-action-position']//a[text()='Delete']" timeout="30" parameterized="true"/>
1414
<element name="actionsMenuButton" type="text" selector="//div[text()='{{groupName}}']/parent::td//following-sibling::td[@class='data-grid-actions-cell']//a[text()='{{selectItem}}']" timeout="30" parameterized="true"/>
1515
</section>
1616
</sections>

app/code/Magento/LoginAsCustomerFrontendUi/ViewModel/Configuration.php

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -12,6 +12,8 @@
1212
use Magento\Framework\App\ObjectManager;
1313
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1414
use Magento\LoginAsCustomerApi\Api\GetLoggedAsCustomerAdminIdInterface;
15+
use Magento\Framework\App\Config\ScopeConfigInterface;
16+
use Magento\Store\Model\StoreManagerInterface;
1517

1618
/**
1719
* View model to get extension configuration in the template
@@ -33,20 +35,36 @@ class Configuration implements \Magento\Framework\View\Element\Block\ArgumentInt
3335
*/
3436
private $getLoggedAsCustomerAdminId;
3537

38+
/**
39+
* @var ScopeConfigInterface
40+
*/
41+
private $scopeConfig;
42+
43+
/**
44+
* @var StoreManagerInterface
45+
*/
46+
private $storeManager;
47+
3648
/**
3749
* @param ConfigInterface $config
3850
* @param HttpContext $httpContext
51+
* @param ScopeConfigInterface $scopeConfig
52+
* @param StoreManagerInterface $storeManager
3953
* @param GetLoggedAsCustomerAdminIdInterface $getLoggedAsCustomerAdminId
4054
*/
4155
public function __construct(
4256
ConfigInterface $config,
4357
HttpContext $httpContext,
58+
ScopeConfigInterface $scopeConfig,
59+
StoreManagerInterface $storeManager,
4460
?GetLoggedAsCustomerAdminIdInterface $getLoggedAsCustomerAdminId = null
4561
) {
4662
$this->config = $config;
4763
$this->httpContext = $httpContext;
4864
$this->getLoggedAsCustomerAdminId = $getLoggedAsCustomerAdminId
4965
?? ObjectManager::getInstance()->get(GetLoggedAsCustomerAdminIdInterface::class);
66+
$this->scopeConfig = $scopeConfig;
67+
$this->storeManager = $storeManager;
5068
}
5169

5270
/**
@@ -68,4 +86,19 @@ private function isLoggedIn(): bool
6886
{
6987
return (bool)$this->httpContext->getValue(Context::CONTEXT_AUTH);
7088
}
89+
90+
/**
91+
* Is B2b enabled
92+
*
93+
* @return bool
94+
* @throws \Magento\Framework\Exception\NoSuchEntityException
95+
*/
96+
public function isB2bEnabled(): bool
97+
{
98+
return (bool)$this->scopeConfig->getValue(
99+
"btob/website_configuration/company_active",
100+
\Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE,
101+
$this->storeManager->getStore()->getWebsiteId()
102+
);
103+
}
71104
}

app/code/Magento/LoginAsCustomerFrontendUi/view/frontend/templates/html/notices.phtml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**
88
* @var \Magento\Framework\View\Element\Template $block
99
* @var \Magento\Framework\Escaper $escaper
1010
*/
11-
$viewFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerFrontendUi::images/magento-icon.svg');
11+
if ($block->getConfig()->isB2bEnabled()) {
12+
$adobeFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerFrontendUi::images/adobe-icon.svg');
13+
} else {
14+
$adobeFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerFrontendUi::images/magento-icon.svg');
15+
}
1216
?>
1317
<?php if ($block->getConfig()->isEnabled()): ?>
1418
<div class="lac-notification-sticky"
@@ -17,7 +21,7 @@ $viewFileUrl = $block->getViewFileUrl('Magento_LoginAsCustomerFrontendUi::images
1721
<div class="lac-notification clearfix" data-bind="visible: isVisible" style="display: none">
1822
<div class="top-container">
1923
<div class="lac-notification-icon wrapper">
20-
<img class="logo-img" src="<?= $escaper->escapeUrl($viewFileUrl) ?>" alt="Magento" />
24+
<img class="logo-img" src="<?= $escaper->escapeUrl($adobeFileUrl) ?>" alt="Magento" />
2125
</div>
2226
<div class="lac-notification-text wrapper">
2327
<span data-bind="html: notificationText"></span>

app/code/Magento/LoginAsCustomerFrontendUi/view/frontend/web/css/source/_module.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Copyright © Magento, Inc. All rights reserved.
3-
* See COPYING.txt for license details.
2+
* Copyright 2014 Adobe
3+
* All Rights Reserved.
44
*/
55

66
//
@@ -29,7 +29,7 @@
2929
margin: 10px 25px 10px 10px;
3030

3131
.logo-img {
32-
display: block
32+
display: block;
3333
}
3434
}
3535

Lines changed: 1 addition & 0 deletions
Loading

app/code/Magento/Paypal/Controller/Transparent/Redirect.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2020 Adobe
4+
* All rights reserved.
55
*/
66
namespace Magento\Paypal\Controller\Transparent;
77

88
use Magento\Framework\App\Action\Action;
99
use Magento\Framework\App\Action\Context;
10+
use Magento\Framework\App\Action\HttpGetActionInterface;
1011
use Magento\Framework\App\Action\HttpPostActionInterface;
1112
use Magento\Framework\App\CsrfAwareActionInterface;
1213
use Magento\Framework\App\Request\InvalidRequestException;
@@ -20,7 +21,7 @@
2021
/**
2122
* Class for redirecting the Paypal response result to Magento controller.
2223
*/
23-
class Redirect extends Action implements CsrfAwareActionInterface, HttpPostActionInterface
24+
class Redirect extends Action implements CsrfAwareActionInterface, HttpPostActionInterface, HttpGetActionInterface
2425
{
2526
/**
2627
* @var LayoutFactory
@@ -81,6 +82,7 @@ public function validateForCsrf(RequestInterface $request): ?bool
8182
*/
8283
public function execute()
8384
{
85+
$this->mapGatewayResponse();
8486
$gatewayResponse = (array)$this->getRequest()->getPostValue();
8587
$this->logger->debug(
8688
['PayPal PayflowPro redirect:' => $gatewayResponse],
@@ -94,4 +96,20 @@ public function execute()
9496

9597
return $resultLayout;
9698
}
99+
100+
/**
101+
* Fill post data with gateway response params
102+
*
103+
* @return void
104+
*/
105+
private function mapGatewayResponse(): void
106+
{
107+
if (!empty($this->getRequest()->getPostValue())) {
108+
return;
109+
}
110+
$gatewayResponse = $this->getRequest()->getParams();
111+
if (!empty($gatewayResponse)) {
112+
$this->getRequest()->setPostValue($gatewayResponse);
113+
}
114+
}
97115
}

0 commit comments

Comments
 (0)