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

[Forms/UI] fix for "incorrect use of label for=FORM_ELEMENT" bug #7982

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnriedel
Copy link
Contributor

@johnriedel johnriedel commented Jan 13, 2025

Closes #7981

Describe your changes:

  1. When a form key is specified, the associated form control will have the same ID that's specified in the form label's "for" attribute.
  2. If a form key is not specified, the form label's "for" attribute will be hidden and the associated form control's ID attribute will be hidden.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?

Testing Instructions:

Testing autocomplete field:

  1. Click "+Create" in the top left corner and select "Clock"
  2. In the pop-up create dialog, click the Timezone label and the associated control will gain focus.

Testing datetime field:

  1. Click "+Create" in the top left corner and select "Timer"
  2. In the pop-up create dialog, click the Target label and the associated control will gain focus.

Testing fileinput field:

  1. In the browse window on the left side, select "My Items"
  2. Click the action menu ellipsis (...) on the right side of the "My Items" main window (near the right side of the screen just to the left of the Inspect window.
  3. Select the "Import fom JSON" option.
  4. In the Import from JSON popup-modal, click the "Select File" label to the left of the "Select File..." button and the associated control will gain focus.

Testing locator field:

  1. Click "+Create" in the top left corner and select "Clock"
  2. In the pop-up create dialog, click the "Save In" label and the associated control will gain focus.

Testing number field:

  1. Click "+Create" in the top left corner and select "Gauge"
  2. In the pop-up create dialog, click the "Float Precision" label and the associated control will gain focus.

Testing select field:

  1. Click "+Create" in the top left corner and select "Gauge"
  2. In the pop-up create dialog, click the "Gauge Type" label and the associated control will gain focus.

Testing textarea field:

  1. Click "+Create" in the top left corner and select "Gauge"
  2. In the pop-up create dialog, click the "Notes" label and the associated control will gain focus.

Testing text field:

  1. Click "+Create" in the top left corner and select "Gauge"
  2. In the pop-up create dialog, click the "Title" label and the associated control will gain focus.

Testing toggle switch field:

  1. Click "+Create" in the top left corner and select "Gauge"
  2. In the pop-up create dialog, click the "Display current value" label and the associated control will gain focus/toggle.

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 50.20%. Comparing base (5be103e) to head (e3e6642).

Files with missing lines Patch % Lines
src/api/forms/components/controls/LocatorField.vue 0.00% 2 Missing ⚠️
...pi/forms/components/controls/AutoCompleteField.vue 0.00% 1 Missing ⚠️
...rc/api/forms/components/controls/DatetimeField.vue 0.00% 1 Missing ⚠️
src/api/forms/components/controls/FileInput.vue 0.00% 1 Missing ⚠️
src/api/forms/components/controls/NumberField.vue 0.00% 1 Missing ⚠️
src/api/forms/components/controls/SelectField.vue 0.00% 1 Missing ⚠️
...rc/api/forms/components/controls/TextAreaField.vue 0.00% 0 Missing and 1 partial ⚠️
...pi/forms/components/controls/ToggleSwitchField.vue 0.00% 1 Missing ⚠️
...c/plugins/gauge/components/GaugeFormController.vue 0.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (5be103e) and HEAD (e3e6642). Click for more details.

HEAD has 145 uploads less than BASE
Flag BASE (5be103e) HEAD (e3e6642)
unit 55 1
e2e-ci 8 0
e2e-full 84 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7982      +/-   ##
==========================================
- Coverage   57.70%   50.20%   -7.50%     
==========================================
  Files         678      678              
  Lines       27428    27440      +12     
  Branches     2691     2700       +9     
==========================================
- Hits        15826    13775    -2051     
- Misses      11264    13323    +2059     
- Partials      338      342       +4     
Flag Coverage Δ
e2e-ci ?
e2e-full 23.65% <ø> (-18.36%) ⬇️
unit 49.32% <16.66%> (-0.20%) ⬇️
Files with missing lines Coverage Δ
src/api/forms/components/FormRow.vue 76.47% <ø> (ø)
src/plugins/charts/scatter/plugin.js 31.81% <ø> (-31.82%) ⬇️
src/plugins/displayLayout/DisplayLayoutType.js 33.33% <ø> (-66.67%) ⬇️
src/plugins/gauge/GaugePlugin.js 22.22% <ø> (-19.45%) ⬇️
src/ui/components/SearchComponent.vue 60.00% <100.00%> (+10.00%) ⬆️
src/ui/layout/MctTree.vue 26.68% <100.00%> (+0.17%) ⬆️
...pi/forms/components/controls/AutoCompleteField.vue 1.40% <0.00%> (-0.03%) ⬇️
...rc/api/forms/components/controls/DatetimeField.vue 2.77% <0.00%> (-0.08%) ⬇️
src/api/forms/components/controls/FileInput.vue 0.00% <0.00%> (ø)
src/api/forms/components/controls/NumberField.vue 0.00% <0.00%> (ø)
... and 5 more

... and 206 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5be103e...e3e6642. Read the comment docs.

@johnriedel johnriedel marked this pull request as ready for review January 14, 2025 01:51
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.

Incorrect use of <label for=FORM_ELEMENT>
1 participant