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

feat: Add aria-controls to autocrud grid to control the form #1946

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

krissvaa
Copy link
Contributor

@krissvaa krissvaa commented Jan 9, 2024

Add aria-controls to autocrud grid to control the form

Fixes #1666

@krissvaa krissvaa requested a review from taefi January 9, 2024 08:24
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (53365a5) 95.33% compared to head (3eb5ef2) 95.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1946   +/-   ##
=======================================
  Coverage   95.33%   95.33%           
=======================================
  Files          52       52           
  Lines        3492     3495    +3     
  Branches      524      526    +2     
=======================================
+ Hits         3329     3332    +3     
  Misses        129      129           
  Partials       34       34           
Flag Coverage Δ
unittests 95.33% <100.00%> (+<0.01%) ⬆️

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.

Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

Could we have a couple of tests validating the presence of aria-controls and the equality of its value with the id of the form in the two situations:

  • an id is provided
  • no id is passed in

The purpose is preventing future regressions.

@@ -146,6 +146,7 @@ export function AutoCrud<TModel extends AbstractModel>({
setItem(activeItem ?? undefined);
}}
ref={autoGridRef}
aria-controls={`${id ?? 'auto'}-form`}
Copy link
Contributor

@taefi taefi Jan 11, 2024

Choose a reason for hiding this comment

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

In case the there are more than one AutoCrud in a view, and the id prop is undefined/null, the AutoForm's id and the aria-controls of AutoGrid would clash with one another, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now id is generated and will be unique everytime

Copy link
Contributor

@taefi taefi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Jan 29, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@taefi taefi merged commit 96d0d94 into main Jan 30, 2024
15 checks passed
@taefi taefi deleted the feat/autocrud-aria-controls branch January 30, 2024 07:20
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.4.0.alpha3 and is also targeting the upcoming stable 24.4.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[autocrud] Create semantic association between grid and form
4 participants