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

Adding fallback for forms component #2568

Merged
merged 8 commits into from
Nov 22, 2023
Merged

Conversation

dmaurya929
Copy link
Contributor

@dmaurya929 dmaurya929 commented Aug 7, 2023

Q                       A
Fixed Issues? FORMS-7969
Patch: Bug Fix?
Minor: New Feature?
Major: Breaking Change?
Tests Added + Pass? Yes
Documentation Provided Yes (code comments and or markdown)
Any Dependency Changes?
License Apache License, Version 2.0

@sonarcloud
Copy link

sonarcloud bot commented Aug 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5156fbb) 87.34% compared to head (bd46083) 87.34%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2568   +/-   ##
=========================================
  Coverage     87.34%   87.34%           
  Complexity     2648     2648           
=========================================
  Files           232      232           
  Lines          7080     7080           
  Branches       1073     1073           
=========================================
  Hits           6184     6184           
  Misses          359      359           
  Partials        537      537           

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

@dmaurya929
Copy link
Contributor Author

@vladbailescu please help to review and merge this PR.
Adding fallback for select panel title for Forms component.

@dmaurya929
Copy link
Contributor Author

@vladbailescu please help to review and merge this PR. Adding fallback for select panel title for Forms component.

gentle reminder
cc: @vladbailescu

@sonarcloud
Copy link

sonarcloud bot commented Sep 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@LSantha
Copy link
Contributor

LSantha commented Sep 19, 2023

@dmaurya929 , is there a ticket for this PR anywhere, describing the issue, how to reproduce it etc.?

@LSantha LSantha self-requested a review September 19, 2023 12:28
@@ -444,6 +444,10 @@
subTitle = item[PN_PANEL_TITLE];
} else if (item.title) {
subTitle = item.title;
} else if (item.label && item.label.value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are item.label, item.label.value and item.name somehow specific to your custom component data model? I cannot find these properties in the component models provided in this project. Could you show me where do they come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's not specific to custom component. This is part of the headless specification of the forms core components. For instance look at [1].
[1]: https://aemcomponents.dev/content/core-components-examples/library/adaptive-form/emailinput.html#tabs-13ca5be0c7-item-46a8eee3d4-tab

Copy link
Contributor

@LSantha LSantha Sep 29, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will add an extra property cq:panelTitle in model json which will not adhere headless specification of forms. Other way would be to override this implementaion in Forms (it will require exposing class to namespace i.e CQ.CoreComponents.PanelSelector )
Does cq: prefix for wcm component mean some internal fields ?
cc: @rismehta

Copy link
Contributor

Choose a reason for hiding this comment

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

@LSantha , in the context of forms, we follow a specific specification, and it's important that the JSON aligns with this specification. While we already align with certain WCM properties like :items and :itemsOrder, which are part of the public core component documentation, it's worth noting that cq:panelTitle is an internal WCM property. Therefore, I believe there might be a need for a client-side hook to override this panel title behavior since it's not part of any specification.

Copy link
Contributor Author

@dmaurya929 dmaurya929 Nov 2, 2023

Choose a reason for hiding this comment

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

@LSantha I have removed forms-specific change. Basically I have exposed PanelSelector to CQ.CoreComponents namespace, it is already mentioned in docs but wasn't exposed.
Please review and merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @dmaurya929 , LGTM.

Copy link
Contributor

@rismehta rismehta left a comment

Choose a reason for hiding this comment

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

LGTM. @vladbailescu @LSantha Could you review this, relevant PR in forms where we are using this an extension point, adobe/aem-core-forms-components#957 (review)

Copy link

sonarcloud bot commented Nov 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@LSantha LSantha merged commit 14e70e3 into adobe:main Nov 22, 2023
10 checks passed
@LSantha LSantha added this to the 2.24.0 milestone Feb 2, 2024
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