From a82da500ca4af4abcfc6a0eb0911734b82ed4cae Mon Sep 17 00:00:00 2001 From: Andy Sellick Date: Mon, 20 Jan 2025 16:17:20 +0000 Subject: [PATCH] Update calls to textarea with the `id` option --- app/views/components/docs/markdown_editor.yml | 10 +++++----- app/views/coronavirus/pages/_form.html.erb | 2 +- app/views/coronavirus/sub_sections/_form.html.erb | 4 ++-- app/views/review/submit_2i_verdict.erb | 2 +- app/views/review/submit_for_2i.html.erb | 2 +- app/views/step_by_step_pages/_form.html.erb | 4 ++-- .../internal_change_notes.html.erb | 2 +- app/views/steps/_form.html.erb | 2 +- spec/components/markdown_editor_spec.rb | 12 ++++++------ 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/views/components/docs/markdown_editor.yml b/app/views/components/docs/markdown_editor.yml index e214964e3..d54bb9104 100644 --- a/app/views/components/docs/markdown_editor.yml +++ b/app/views/components/docs/markdown_editor.yml @@ -25,7 +25,7 @@ examples: text: Body textarea: name: markdown-editor - id: markdown-editor + textarea_id: markdown-editor with_bullet_list_button: data: controls: @@ -34,7 +34,7 @@ examples: text: Body textarea: name: markdown-editor - id: markdown-editor + textarea_id: markdown-editor with_headings_buttons: data: controls: @@ -43,7 +43,7 @@ examples: text: Body textarea: name: markdown-editor - id: markdown-editor + textarea_id: markdown-editor with_blockquote_button: data: controls: @@ -52,7 +52,7 @@ examples: text: Body textarea: name: markdown-editor - id: markdown-editor + textarea_id: markdown-editor with_numbered_list_button: data: controls: @@ -61,4 +61,4 @@ examples: text: Body textarea: name: markdown-editor - id: markdown-editor + textarea_id: markdown-editor diff --git a/app/views/coronavirus/pages/_form.html.erb b/app/views/coronavirus/pages/_form.html.erb index 5f24d5e9e..40ed90234 100644 --- a/app/views/coronavirus/pages/_form.html.erb +++ b/app/views/coronavirus/pages/_form.html.erb @@ -16,7 +16,7 @@ }, textarea: { name: "landing_page[header_body]", - id: "header_body", + textarea_id: "header_body", rows: 20, value: @page.header_body, }, diff --git a/app/views/coronavirus/sub_sections/_form.html.erb b/app/views/coronavirus/sub_sections/_form.html.erb index 907d144ec..ed7eb2bee 100644 --- a/app/views/coronavirus/sub_sections/_form.html.erb +++ b/app/views/coronavirus/sub_sections/_form.html.erb @@ -50,7 +50,7 @@ bold: true, }, name: "sub_section[action_link_summary]", - id: "action_link_summary", + textarea_id: "action_link_summary", value: @sub_section.action_link_summary, rows: 5, error_message: error_items(@sub_section.errors.messages, :action_link_summary), @@ -77,7 +77,7 @@ }, textarea: { name: "sub_section[content]", - id: "content", + textarea_id: "content", rows: 20, value: @sub_section.content, }, diff --git a/app/views/review/submit_2i_verdict.erb b/app/views/review/submit_2i_verdict.erb index c88df96ec..83a6e6abb 100644 --- a/app/views/review/submit_2i_verdict.erb +++ b/app/views/review/submit_2i_verdict.erb @@ -39,7 +39,7 @@ label: { text: t("step_by_step_pages.#{review_phrase}.label"), }, - id: "additional-comments", + textarea_id: "additional-comments", name: textarea_name, } %> diff --git a/app/views/review/submit_for_2i.html.erb b/app/views/review/submit_for_2i.html.erb index 5aa9e8029..48a0ca22f 100644 --- a/app/views/review/submit_for_2i.html.erb +++ b/app/views/review/submit_for_2i.html.erb @@ -29,7 +29,7 @@ text: t("step_by_step_pages.submit_for_2i.label"), bold: true, }, - id: "additional-comments", + textarea_id: "additional-comments", name: "additional_comments", } %> <% end %> diff --git a/app/views/step_by_step_pages/_form.html.erb b/app/views/step_by_step_pages/_form.html.erb index e7f63fec7..aad5a68ca 100644 --- a/app/views/step_by_step_pages/_form.html.erb +++ b/app/views/step_by_step_pages/_form.html.erb @@ -43,7 +43,7 @@ text: t("step_by_step_pages.form.introduction.label"), bold: true, }, - id: "step_by_step_page_introduction", + textarea_id: "step_by_step_page_introduction", name: "step_by_step_page[introduction]", value: step_by_step_page.introduction, } %> @@ -59,7 +59,7 @@ text: t("step_by_step_pages.form.meta_description.label"), bold: true, }, - id: "step_by_step_page_meta_description", + textarea_id: "step_by_step_page_meta_description", name: "step_by_step_page[description]", value: step_by_step_page.description, } %> diff --git a/app/views/step_by_step_pages/internal_change_notes.html.erb b/app/views/step_by_step_pages/internal_change_notes.html.erb index bafd0111b..d45f6b44b 100644 --- a/app/views/step_by_step_pages/internal_change_notes.html.erb +++ b/app/views/step_by_step_pages/internal_change_notes.html.erb @@ -32,7 +32,7 @@ text: t("step_by_step_pages.internal_change_notes.label"), bold: true, }, - id: "internal-change-note-description", + textarea_id: "internal-change-note-description", name: "internal_change_note[description]", } %> <% end %> diff --git a/app/views/steps/_form.html.erb b/app/views/steps/_form.html.erb index bc43deeb1..f68193f69 100644 --- a/app/views/steps/_form.html.erb +++ b/app/views/steps/_form.html.erb @@ -115,7 +115,7 @@ }, textarea: { name: "step[contents]", - id: "step-content", + textarea_id: "step-content", rows: 20, value: step.contents, }, diff --git a/spec/components/markdown_editor_spec.rb b/spec/components/markdown_editor_spec.rb index 2bfde4cfc..e2a5f1e38 100644 --- a/spec/components/markdown_editor_spec.rb +++ b/spec/components/markdown_editor_spec.rb @@ -14,7 +14,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".govuk-label[for='markdown-editor']", text: "Body" @@ -30,7 +30,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".app-c-markdown-editor__toolbar-button[title='Bullets']", count: 1 @@ -44,7 +44,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".app-c-markdown-editor__toolbar-button[title='Heading level 2']", count: 1 @@ -59,7 +59,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".app-c-markdown-editor__toolbar-button[title='Blockquote']", count: 1 @@ -73,7 +73,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".app-c-markdown-editor__toolbar-button[title='Numbered list']", count: 1 @@ -87,7 +87,7 @@ }, textarea: { name: "markdown-editor", - id: "markdown-editor", + textarea_id: "markdown-editor", } assert_select ".govuk-error-message", text: "Error: Something is wrong"