Skip to content

Conversation

@muskgupta
Copy link
Member

Description

Fixed the enabled and visible attributes to reflect correctly in forms for button core component.

JIRA : https://jira.corp.adobe.com/browse/FORMS-15167

Related Issue

Motivation and Context

Without this change, the button component in forms was not correctly populating true and false values to 'data-cmp-enabled' and 'data-cmp-visible' attributes.

How Has This Been Tested?

Tested the changes using cypress.

Screenshots (if appropriate):

Screenshot 2024-07-08 at 2 00 08 PM

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.

@muskgupta muskgupta changed the base branch from master to dev July 8, 2024 10:31
@muskgupta muskgupta requested a review from sakshi-arora1 July 8, 2024 10:42
@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 100 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 93 96 100 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 88 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 90 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@codecov
Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.73%. Comparing base (231a14a) to head (370d255).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #1308   +/-   ##
=========================================
  Coverage     81.73%   81.73%           
  Complexity      853      853           
=========================================
  Files            97       97           
  Lines          2267     2267           
  Branches        305      305           
=========================================
  Hits           1853     1853           
  Misses          255      255           
  Partials        159      159           

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

expect(formContainer._model.items.length, "model and view elements match").to.equal(Object.keys(formContainer._fields).length);
Object.entries(formContainer._fields).forEach(([id, field]) => {
if(field.options.visible === "true") {
if(field.options.visible === "true" && field.getModel()._jsonModel.fieldType==='text-input') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there a change in an existing test case ? This can impact backward compatibility

Copy link
Member Author

Choose a reason for hiding this comment

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

Attributes 'data-cmp-enabled' and 'data-cmp-visible' are causing button to be present always in the form which is why the checkHTML will fail if we do not explicitly check for 'text-input'. I have confirmed all components in both textinput and customtextinput test files have all components with fieldType 'text-input' apart from a submit button.

Copy link
Collaborator

@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.

check comments

@rismehta rismehta merged commit d206192 into dev Jul 26, 2024
@rismehta rismehta deleted the ButtonCCFix branch July 26, 2024 06:13
dmaurya929 pushed a commit that referenced this pull request Aug 13, 2024
* Fixing enabled and visible attributes of Button CC

* Updating test cases to check fieldType to support button attribute changes

---------

Co-authored-by: Muskan Gupta <muskgupta@Muskans-MacBook-Pro.local>
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.

4 participants