-
Notifications
You must be signed in to change notification settings - Fork 79
CIF-2034: XF placeholder - make it independent from URL selector #565
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #565 +/- ##
============================================
- Coverage 87.45% 87.38% -0.07%
- Complexity 1294 1301 +7
============================================
Files 235 237 +2
Lines 6059 6089 +30
Branches 888 900 +12
============================================
+ Hits 5299 5321 +22
- Misses 587 588 +1
- Partials 173 180 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
|
||
| private Resource xfResource; | ||
| private String name; | ||
| private AbstractCategoryRetriever categoryRetriever; |
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.
Normally the retrievers should be exposed via getters, so they can be accessed when applying Sling model delegation. But I don't think it's needed here, since the retrievers are only required for identifier lookup and I don't see a use case why the query would be extended.
|
|
||
| if (VALID_CATEGORY_IDENTIFIERS.contains(identifier.getLeft())) { | ||
| categoriesIdentifier = identifier.getRight(); | ||
| if (identifier.getRight() != null) { |
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.
VALID_CATEGORY_IDENTIFIERS is now unused and may be removed.
Description
XFs are to be tagged with the category identifier (ID or UID) as per CA config.
If the URLProvider is configured to use another category field, then a graphQL query is executed to fetch the right identifier.
Same applies for products
Related Issue
CIF-2034
Motivation and Context
The current XF placeholder component is limited in finding related XF for product or category pages based on the URL selector only. This requires the URL selector used to be the same the XFs are tagged with.
How Has This Been Tested?
Unit tests
Screenshots (if appropriate):
Types of changes
Checklist: