-
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
SITES-22965: Add function to set category filter type #1011
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1011 +/- ##
============================================
+ Coverage 89.11% 89.14% +0.02%
- Complexity 2226 2247 +21
============================================
Files 355 355
Lines 10042 10097 +55
Branches 1447 1461 +14
============================================
+ Hits 8949 9001 +52
Misses 790 790
- Partials 303 306 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…ible with urlPath
@@ -106,6 +108,8 @@ private void initModel() { | |||
// After the identifier type has been determined, the specific list will be used further | |||
List<String> categoryIdentifiers = new ArrayList<>(); | |||
assetOverride = new HashMap<>(); | |||
String categoryIdType = null; | |||
String categoryFilterType; |
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.
Could you check if you really need this categoryFilterType variable? It looks like it's serving basically the same purpose as categoryIdType. If so, please keep categoryIdType only.
@@ -76,6 +77,7 @@ public class FeaturedCategoryListImpl extends DataLayerComponent implements Feat | |||
private static final String CATEGORY_IDENTIFIER = "categoryId"; | |||
private static final String ASSET_PROP = "asset"; | |||
private static final String ITEMS_PROP = "items"; | |||
private static final String CATEGORY_IDENTIFIER_TYPE = "categoryIdType"; |
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.
You may want to put this on the public interface like here: https://github.com/adobe/aem-core-cif-components/pull/1011/files#diff-5e1c4c18538024ef6a86682d30b765717aeea3d4af9372f76de7b34190c67afdR44
* Filter type that should be used when fetched. usually uid but we can define it explicitly in the implementation | ||
* specific and should be checked in subclass implementations. | ||
*/ | ||
protected String filterType; |
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.
Here also categoryIdType is a better name and is consistent with the setter method bellow.
* Set the Category filter type which will using during fetch. Categories are retrieved using | ||
* this filter type if not set then it will use UID. | ||
* | ||
* @param filterType Filter Type |
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.
Parameter name: categoryIdType
* @param filterType Filter Type | ||
*/ | ||
public void setCategoryIdType(String filterType) { | ||
this.filterType = filterType; |
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.
this.categoryIdType = categoryIdType
* Filter type that should be used when fetched. usually uid but we can define it explicitly in the implementation | ||
* specific and should be checked in subclass implementations. | ||
*/ | ||
protected String filterType; |
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.
Again, use categoryIdType.
* Set the Category filter type which will using during fetch. Categories are retrieved using | ||
* this filter type if not set then it will use UID. | ||
* | ||
* @param filterType Filter Type |
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.
Here too: categoryIdType
@alwinjoseph02 , could you please update the readme of components where you added the new JCR property (categoryIdType) like here https://github.com/adobe/aem-core-cif-components/tree/master/ui.apps/src/main/content/jcr_root/apps/core/cif/components/commerce/featuredcategorylist/v1/featuredcategorylist#edit-dialog-properties |
@alwinjoseph02 , LGTM! Thank you. |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: