Skip to content

Commit

Permalink
Update calls to textarea with the id option
Browse files Browse the repository at this point in the history
  • Loading branch information
andysellick committed Jan 20, 2025
1 parent 73f66c3 commit a82da50
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions app/views/components/docs/markdown_editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ examples:
text: Body
textarea:
name: markdown-editor
id: markdown-editor
textarea_id: markdown-editor
with_bullet_list_button:
data:
controls:
Expand All @@ -34,7 +34,7 @@ examples:
text: Body
textarea:
name: markdown-editor
id: markdown-editor
textarea_id: markdown-editor
with_headings_buttons:
data:
controls:
Expand All @@ -43,7 +43,7 @@ examples:
text: Body
textarea:
name: markdown-editor
id: markdown-editor
textarea_id: markdown-editor
with_blockquote_button:
data:
controls:
Expand All @@ -52,7 +52,7 @@ examples:
text: Body
textarea:
name: markdown-editor
id: markdown-editor
textarea_id: markdown-editor
with_numbered_list_button:
data:
controls:
Expand All @@ -61,4 +61,4 @@ examples:
text: Body
textarea:
name: markdown-editor
id: markdown-editor
textarea_id: markdown-editor
2 changes: 1 addition & 1 deletion app/views/coronavirus/pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
textarea: {
name: "landing_page[header_body]",
id: "header_body",
textarea_id: "header_body",
rows: 20,
value: @page.header_body,
},
Expand Down
4 changes: 2 additions & 2 deletions app/views/coronavirus/sub_sections/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -77,7 +77,7 @@
},
textarea: {
name: "sub_section[content]",
id: "content",
textarea_id: "content",
rows: 20,
value: @sub_section.content,
},
Expand Down
2 changes: 1 addition & 1 deletion app/views/review/submit_2i_verdict.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
label: {
text: t("step_by_step_pages.#{review_phrase}.label"),
},
id: "additional-comments",
textarea_id: "additional-comments",
name: textarea_name,
} %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/review/submit_for_2i.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/step_by_step_pages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
} %>
Expand All @@ -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,
} %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/steps/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
textarea: {
name: "step[contents]",
id: "step-content",
textarea_id: "step-content",
rows: 20,
value: step.contents,
},
Expand Down
12 changes: 6 additions & 6 deletions spec/components/markdown_editor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
textarea: {
name: "markdown-editor",
id: "markdown-editor",
textarea_id: "markdown-editor",
}

assert_select ".govuk-label[for='markdown-editor']", text: "Body"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit a82da50

Please sign in to comment.