Skip to content
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

Merged
merged 27 commits into from
Jul 17, 2024

Conversation

alwinjoseph02
Copy link
Collaborator

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 96.10390% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.14%. Comparing base (2ea43ba) to head (7eac3d3).

Files Patch % Lines
.../components/internal/services/UrlProviderImpl.java 95.34% 0 Missing and 2 partials ⚠️
...al/services/urlformats/CategoryPageWithUrlKey.java 0.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
integration 51.63% <48.05%> (-0.20%) ⬇️
jest 86.68% <ø> (ø)
karma 95.54% <ø> (ø)
unittests 87.44% <96.10%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alwinjoseph02 alwinjoseph02 changed the title SITES-21947: Add function to set category filter type SITES-22965: Add function to set category filter type Jun 27, 2024
@alwinjoseph02 alwinjoseph02 marked this pull request as ready for review July 2, 2024 08:11
@@ -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;
Copy link
Collaborator

@LSantha LSantha Jul 9, 2024

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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* 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;
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too: categoryIdType

@LSantha
Copy link
Collaborator

LSantha commented Jul 9, 2024

@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

@LSantha
Copy link
Collaborator

LSantha commented Jul 17, 2024

@alwinjoseph02 , LGTM! Thank you.

@LSantha LSantha merged commit 6c9245f into master Jul 17, 2024
19 checks passed
@LSantha LSantha deleted the feature/SITES-21947 branch July 17, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants