-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #16893: [Forwardport] FIX for issue#14869 - Wrong price at backend after update (by @mage2pratik) - #17020: [Forwardport] hide cookie notice instead of reloading site (by @torhoehn) - #17014: [Forwardport] Fixes white color coding standard. (by @chirag-wagento) - #17016: [Forwardport] Avoid undefined index warning when using uppercase reserved word (by @FreekVandeursen) - #17017: [Forwardport] Wrong namespace defined in compare.phtml (by @ronak2ram) - #16997: [Forwardport] Corrected Magento_Framework's test xml file. (by @ihor-sviziev) - #16996: [Forwardport] Updated Magento_Newsletter's block file. (by @ihor-sviziev) - #16994: [Forwardport] Responsive Design Footers bottom of screen on mobile devices #15118 (by @ihor-sviziev) - #16993: [Forwardport] FIXED - appended payment code to ID field to make it unique (by @ihor-sviziev) - #16998: [Forwardport] Added 'title' attribute to 'a' link. (by @ihor-sviziev) - #16973: [Forwardport] Removed double occurrence of keywords in sentences. (by @gelanivishal) - magento/graphql-ce#126: 120 implement store configs coverage (by @VitaliyBoyko) - magento/graphql-ce#99: #96 Make category query compatible with staging (by @roma-glushko) - #16734: [forwardport] #16559 fix icon color variable naming (by @Karlasa) Fixed GitHub Issues: - #14869: M 2.2.3 price per website - wrong price at backend by a create order after update (reported by @Webroju) has been fixed in #16893 by @mage2pratik in 2.3-develop branch Related commits: 1. 49926d7 2. 35b968e - #15118: Responsive Design, Footers do not snap to bottom of screen on mobile devices (reported by @gwharton) has been fixed in #16994 by @ihor-sviziev in 2.3-develop branch Related commits: 1. f7228d0 - #13692: In payment step of checkout I cannot unselect #billing-save-in-address-book checkbox in non-first payment method (reported by @NeosKnowledgeBasePluswerk) has been fixed in #16993 by @ihor-sviziev in 2.3-develop branch Related commits: 1. a659f4b - #120: Default trigger coupon via URL (reported by @seansan) has been fixed in magento/graphql-ce#126 by @VitaliyBoyko in 2.3-develop branch Related commits: 1. e1f53d4 2. 5229cd6 3. af4b258 4. 3b64955 5. b5a2a98 6. e85a6e5 7. 8f3c6e9
- Loading branch information
Showing
45 changed files
with
383 additions
and
90 deletions.
There are no files selected for viewing
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
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
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
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/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.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\StoreGraphQl\Model\Resolver\Store; | ||
|
||
use Magento\Store\Api\Data\StoreConfigInterface; | ||
use Magento\Store\Api\StoreConfigManagerInterface; | ||
use Magento\Store\Api\StoreRepositoryInterface; | ||
use Magento\Store\Api\StoreResolverInterface; | ||
|
||
/** | ||
* StoreConfig field data provider, used for GraphQL request processing. | ||
*/ | ||
class StoreConfigDataProvider | ||
{ | ||
/** | ||
* @var StoreConfigManagerInterface | ||
*/ | ||
private $storeConfigManager; | ||
|
||
/** | ||
* @var StoreResolverInterface | ||
*/ | ||
private $storeResolver; | ||
|
||
/** | ||
* @var StoreRepositoryInterface | ||
*/ | ||
private $storeRepository; | ||
|
||
/** | ||
* @param StoreConfigManagerInterface $storeConfigManager | ||
* @param StoreResolverInterface $storeResolver | ||
* @param StoreRepositoryInterface $storeRepository | ||
*/ | ||
public function __construct( | ||
StoreConfigManagerInterface $storeConfigManager, | ||
StoreResolverInterface $storeResolver, | ||
StoreRepositoryInterface $storeRepository | ||
) { | ||
$this->storeConfigManager = $storeConfigManager; | ||
$this->storeResolver = $storeResolver; | ||
$this->storeRepository = $storeRepository; | ||
} | ||
|
||
/** | ||
* Get store config for current store | ||
* | ||
* @return array | ||
*/ | ||
public function getStoreConfig() : array | ||
{ | ||
$storeId = $this->storeResolver->getCurrentStoreId(); | ||
$store = $this->storeRepository->getById($storeId); | ||
$storeConfig = current($this->storeConfigManager->getStoreConfigs([$store->getCode()])); | ||
|
||
return $this->hidrateStoreConfig($storeConfig); | ||
} | ||
|
||
/** | ||
* Transform StoreConfig object to in array format | ||
* | ||
* @param StoreConfigInterface $storeConfig | ||
* @return array | ||
*/ | ||
private function hidrateStoreConfig($storeConfig): array | ||
{ | ||
/** @var StoreConfigInterface $storeConfig */ | ||
$storeConfigData = [ | ||
'id' => $storeConfig->getId(), | ||
'code' => $storeConfig->getCode(), | ||
'website_id' => $storeConfig->getWebsiteId(), | ||
'locale' => $storeConfig->getLocale(), | ||
'base_currency_code' => $storeConfig->getBaseCurrencyCode(), | ||
'default_display_currency_code' => $storeConfig->getDefaultDisplayCurrencyCode(), | ||
'timezone' => $storeConfig->getTimezone(), | ||
'weight_unit' => $storeConfig->getWeightUnit(), | ||
'base_url' => $storeConfig->getBaseUrl(), | ||
'base_link_url' => $storeConfig->getBaseLinkUrl(), | ||
'base_static_url' => $storeConfig->getSecureBaseStaticUrl(), | ||
'base_media_url' => $storeConfig->getBaseMediaUrl(), | ||
'secure_base_url' => $storeConfig->getSecureBaseUrl(), | ||
'secure_base_link_url' => $storeConfig->getSecureBaseLinkUrl(), | ||
'secure_base_static_url' => $storeConfig->getSecureBaseStaticUrl(), | ||
'secure_base_media_url' => $storeConfig->getSecureBaseMediaUrl() | ||
]; | ||
|
||
return $storeConfigData; | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigResolver.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,63 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\StoreGraphQl\Model\Resolver; | ||
|
||
use Magento\Framework\GraphQl\Config\Element\Field; | ||
use Magento\Framework\GraphQl\Query\Resolver\Value; | ||
use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; | ||
use Magento\Framework\GraphQl\Query\ResolverInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider; | ||
|
||
/** | ||
* StoreConfig page field resolver, used for GraphQL request processing. | ||
*/ | ||
class StoreConfigResolver implements ResolverInterface | ||
{ | ||
/** | ||
* @var StoreConfigDataProvider | ||
*/ | ||
private $storeConfigDataProvider; | ||
|
||
/** | ||
* @var ValueFactory | ||
*/ | ||
private $valueFactory; | ||
|
||
/** | ||
* @param StoreConfigDataProvider $storeConfigsDataProvider | ||
* @param ValueFactory $valueFactory | ||
*/ | ||
public function __construct( | ||
StoreConfigDataProvider $storeConfigsDataProvider, | ||
ValueFactory $valueFactory | ||
) { | ||
$this->valueFactory = $valueFactory; | ||
$this->storeConfigDataProvider = $storeConfigsDataProvider; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function resolve( | ||
Field $field, | ||
$context, | ||
ResolveInfo $info, | ||
array $value = null, | ||
array $args = null | ||
) : Value { | ||
|
||
$storeConfigData = $this->storeConfigDataProvider->getStoreConfig(); | ||
|
||
$result = function () use ($storeConfigData) { | ||
return !empty($storeConfigData) ? $storeConfigData : []; | ||
}; | ||
|
||
return $this->valueFactory->create($result); | ||
} | ||
} |
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
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
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
Oops, something went wrong.