-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIF-1202 - Update the CIF Core Components to use configurations from /conf #184
Conversation
Update the `MagentoGraphqlClient` to read configuration data from `/conf`. Update the unit tests
Fix unit tests so that they don't fail when the ConfigurationBuilder is not available
…/conf Fix the MagentoGraphqlClientTest
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 make sure that you don't automatically reformat the lines you don't edit? Otherwise your PR includes a lot of noise and it's hard to spot the changes related to the issue ... thx.
} | ||
if (configBuilder != null) { | ||
ValueMap properties = configBuilder.name(CONFIGURATION_NAME).asValueMap(); | ||
storeCode = properties.get(STORE_CODE_PROPERTY, readFallBackConfiguration(resource, STORE_CODE_PROPERTY)); |
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.
Same comment as previous PR, only call the method if needed.
@@ -1,154 +1,160 @@ | |||
{ | |||
"pageA": { |
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.
Because your IDE reformatted the entire file, it's very hard to find out what you really modified ...
Configuration serviceConfiguration = configurationAdmin.getConfiguration( | ||
"org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy"); | ||
|
||
Dictionary<String, Object> props = new Hashtable<>(); |
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 document what this does?... and isn't there anything better to setup this test from org.apache.sling.testing.caconfig-mock-plugin
? I expected that the content you added to jcr-conf.json
would be enough ...
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.
The Sling CAConfig API uses different property names (sling:configs
instead of settings
,sling:configRef
instead of cq:conf
etc) so I configured the mock components as they are in AEM. Of course, I could've just used those Sling properties in the test JSON but I wanted the test content to be as close as possible to our AEM use case.
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.
Thanks for the info ... just out of curiosity, how is this configured then in AEM? I tried to find a config for caconfig
and that kind of things but couldn't find anything that would for example define what you do here "by hand".
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.
(one eternity later...)
There is a bunch of Apache Sling Context-Aware Configuration ...
components at http://localhost:4502/system/console/configMgr
- optimize the "fallback solution" so that the fallback configuration is only read when the context configuration is missing
Codecov Report
@@ Coverage Diff @@
## master #184 +/- ##
============================================
+ Coverage 59.92% 60.05% +0.13%
- Complexity 532 537 +5
============================================
Files 147 147
Lines 4344 4366 +22
Branches 738 744 +6
============================================
+ Hits 2603 2622 +19
Misses 1652 1652
- Partials 89 92 +3
Continue to review full report at Codecov.
|
} | ||
; |
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.
Please remove this line
Update the GraphqlClientDatasource to support not showing the "empty" option.
Update unit tests for the GraphQL clients datasource
- fix git merge issue
Remove the "Commerce" tab from the page configuration dialog since it's not needed anymore.
…the page properties if the property is missing in /conf
…`/conf` only when the `magentoRootCategoryId` is not found in the page properties. Remove the "Store config" property from the catalog page properties
…ents into issue/CIF-1134
…ents into issue/CIF-1134
Description
The
MagentoGraphqlClient
is updated to read the configuration from the context, falling back to the old method (node properties) in case the configuration is missing.The unit tests are updated as well and they are using the Sling Context-Aware Configuration Mock plugin which provides context-aware configuration capabilities to the Aem Context.
Related Issue
CIF-1202
Motivation and Context
Unify configuration of the CIF Connector and CIF Core Components
How Has This Been Tested?
Functional tests and unit tests
Screenshots (if appropriate):
Types of changes
Checklist: