-
Notifications
You must be signed in to change notification settings - Fork 155
Conversation
<argument name="extendedConfigs" xsi:type="array"> | ||
<!-- Begin Store Configuration Web Default Pages --> | ||
<item name="front" xsi:type="string">web/default/front</item> | ||
<item name="cms_home_page" xsi:type="string">web/default/cms_home_page</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such implementation introduces an implicit dependency on CMS and Theme modules. Since both of these modules will require GraphQL coverage I think it's better to move declarations of exporting config path to corresponding modules (CmsGraphQl and ThemeGraphQl)
@@ -54,8 +45,7 @@ public function __construct( | |||
*/ | |||
public function getStoreConfig() : array | |||
{ | |||
$storeId = $this->storeResolver->getCurrentStoreId(); | |||
$store = $this->storeRepository->getById($storeId); | |||
$store = $this->storeManager->getStore(); | |||
$storeConfig = current($this->storeConfigManager->getStoreConfigs([$store->getCode()])); | |||
|
|||
return $this->hidrateStoreConfig($storeConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"hidrate" should be "hydrate"
<arguments> | ||
<argument name="extendedConfigs" xsi:type="array"> | ||
<!-- Begin Store Configuration Web Default Pages --> | ||
<item name="front" xsi:type="string">web/default/front</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as proposition, and I would like to have an opinion of @paliarush or @vrann, maybe define some standard at least in Magento code, then items names will look like:
web_default_front - which is equal to web/default/front ? Then for developers will be easier to find items without looking into documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point.
Would be nice to avoid having coupling between di.xml and schema.graphqls and have just one declaration in schema.graphqls, but unfortunately config_path_with_underscore cannot be reliably converted to config/path/with_underscore.
*/ | ||
public function testExtendedStoreConfig() | ||
{ | ||
$front = 'test_page'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check those values? Looks like they are not same in database:
Magento\GraphQl\Store\StoreConfigResolverTest::testExtendedStoreConfig
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'test_page'
+'cms'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magentoConfigFixture
does not work at the moment in Web API tests, @melnikovi is working on the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should skip/rewrite this test until config fixture is supported.
@@ -52,7 +61,10 @@ public function resolve( | |||
array $args = null | |||
) : Value { | |||
|
|||
$storeConfigData = $this->storeConfigDataProvider->getStoreConfig(); | |||
$storeConfigData = array_merge( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use just one config provider and the list of accessible fields should be filtered according to the extensible di.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @paliarush
God point
But, the decision with one config provider doesn't right here.
We getting configs from different sources, StoreConfigDataProvider gets data from StoreConfigInterface unlike ExtendedStoreConfigDataProvider which gets data from ScopeConfigInterface.
It is not possible to get all StoreConfigInterface fields from ScopeConfigInterface.
For example base_url not present in core_config_data and defines in app/code/Magento/Store/Model/Store.php:607.
"magento/framework": "*" | ||
}, | ||
"suggest": { | ||
"magento/module-graph-ql": "*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have dependency on CMS module (or at least suggest
, if there are no hard dependencies)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
I guess Travis will fail in this case with the "redundant dependency" error.
…t and config tests
-- add block_rollback fixture
…https://github.com/magento/graphql-ce into 128-extend-store-config-coverage Signed-off-by: vitaliyboyko <[email protected]> Conflicts: app/code/Magento/CmsGraphQl/README.md app/code/Magento/CmsGraphQl/composer.json app/code/Magento/CmsGraphQl/etc/schema.graphqls app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigResolver.php composer.lock
Signed-off-by: vitaliyboyko <[email protected]>
|
Signed-off-by: vitaliyboyko <[email protected]>
…nfig-fixture' of https://github.com/magento/graphql-ce into 128-extend-store-config-coverage
Signed-off-by: vitaliyboyko <[email protected]>
Signed-off-by: vitaliyboyko <[email protected]>
…re-config-coverage # Conflicts: # app/code/Magento/BundleGraphQl/Model/Resolver/BundleItemLinks.php # app/code/Magento/StoreGraphQl/Model/Resolver/Store/StoreConfigDataProvider.php # app/code/Magento/StoreGraphQl/Model/Resolver/StoreConfigResolver.php # composer.lock # dev/tests/api-functional/testsuite/Magento/GraphQl/Cms/CmsBlockTest.php
…https://github.com/magento/graphql-ce into 128-extend-store-config-coverage
Signed-off-by: vitaliyboyko <[email protected]>
Implementation has been moved to other pr: |
Added extended params to store config.
Fixed Issues (if relevant)
Added configs:
front : "Default Web URL"
cms_home_page : "CMS Home Page"
no_route : "Default No-route URL"
cms_no_route : "CMS No Route Page"
cms_no_cookies : "CMS No Cookies Page"
show_cms_breadcrumbs : "Show Breadcrumbs for CMS Pages"
head_shortcut_icon : "Favicon Icon"
default_title : "Default Page Title"
title_prefix : "Page Title Prefix"
title_suffix : "Page Title Suffix"
default_description : "Default Meta Description"
default_keywords : "Default Meta Keywords"
head_includes : "Scripts and Style Sheets"
demonotice : "Display Demo Store Notice"
header_logo_src : "Logo Image"
logo_width : "Logo Attribute Width"
logo_height : "Logo Attribute Height"
welcome : "Welcome Text"
logo_alt : "Logo Image Alt"
absolute_footer : "Footer Miscellaneous HTML"
copyright : "Copyright"