From f1ddfd5430c7d304492dc0f11a6bfb286cb6b08d Mon Sep 17 00:00:00 2001 From: "John C. Riedel" Date: Mon, 13 Jan 2025 22:29:34 +0000 Subject: [PATCH] [Forms/UI] fix for "incorrect use of label for=FORM_ELEMENT" bug --- e2e/README.md | 2 +- e2e/appActions.js | 2 +- e2e/tests/functional/forms.e2e.spec.js | 4 ++-- src/api/forms/components/FormRow.vue | 6 +++++- .../forms/components/controls/AutoCompleteField.vue | 5 ++++- src/api/forms/components/controls/DatetimeField.vue | 7 ++++++- src/api/forms/components/controls/FileInput.vue | 5 +++-- src/api/forms/components/controls/LocatorField.vue | 6 ++++++ src/api/forms/components/controls/NumberField.vue | 4 +++- src/api/forms/components/controls/SelectField.vue | 4 +++- src/api/forms/components/controls/TextAreaField.vue | 12 ++++-------- .../forms/components/controls/ToggleSwitchField.vue | 4 ++-- src/plugins/charts/scatter/plugin.js | 1 - src/plugins/displayLayout/DisplayLayoutType.js | 4 ++++ src/plugins/gauge/GaugePlugin.js | 2 +- src/plugins/gauge/components/GaugeFormController.vue | 7 +++++-- src/ui/components/SearchComponent.vue | 7 +++++++ src/ui/layout/MctTree.vue | 7 +++++++ 18 files changed, 64 insertions(+), 25 deletions(-) diff --git a/e2e/README.md b/e2e/README.md index 881d8d23279..33491b7ebde 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -426,7 +426,7 @@ By adhering to this principle, we can create tests that are both robust and refl // Fill the "Notes" section with information about the // currently running test and its project. const { testNotes } = page; - const notesInput = page.locator('form[name="mctForm"] #notes-textarea'); + const notesInput = page.locator('form[name="mctForm"] #form-notes'); await notesInput.fill(testNotes); ``` diff --git a/e2e/appActions.js b/e2e/appActions.js index 7bb82726f20..89e617d71b5 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -93,7 +93,7 @@ async function createDomainObjectWithDefaults(page, { type, name, parent = 'mine // Fill the "Notes" section with information about the // currently running test and its project. // eslint-disable-next-line playwright/no-raw-locators - await page.locator('#notes-textarea').fill(page.testNotes); + await page.locator('#form-notes').fill(page.testNotes); } await page.getByRole('button', { name: 'Save' }).click(); diff --git a/e2e/tests/functional/forms.e2e.spec.js b/e2e/tests/functional/forms.e2e.spec.js index bda12a48944..6523496eba3 100644 --- a/e2e/tests/functional/forms.e2e.spec.js +++ b/e2e/tests/functional/forms.e2e.spec.js @@ -223,8 +223,8 @@ test.describe('Persistence operations @couchdb @network', () => { // Both pages: Fill the "Notes" section with information about the // currently running test and its project. const testNotes = page.testNotes; - const notesInput = page.locator('form[name="mctForm"] #notes-textarea'); - const notesInput2 = page2.locator('form[name="mctForm"] #notes-textarea'); + const notesInput = page.locator('form[name="mctForm"] #form-notes'); + const notesInput2 = page2.locator('form[name="mctForm"] #form-notes'); await Promise.all([notesInput.fill(testNotes), notesInput2.fill(testNotes)]); // Page 2: Click "OK" to create the domain object and wait for navigation. diff --git a/src/api/forms/components/FormRow.vue b/src/api/forms/components/FormRow.vue index ce1c88e403d..a940de144c0 100644 --- a/src/api/forms/components/FormRow.vue +++ b/src/api/forms/components/FormRow.vue @@ -22,7 +22,11 @@