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

Update calls to textarea with the id option #3295

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ GEM
govuk_personalisation (1.0.0)
plek (>= 1.9.0)
rails (>= 6, < 8)
govuk_publishing_components (43.3.0)
govuk_publishing_components (50.0.0)
govuk_app_config
govuk_personalisation (>= 0.7.0)
kramdown
ostruct
plek
rails (>= 6)
rouge
Expand Down Expand Up @@ -548,6 +549,7 @@ GEM
opentelemetry-semantic_conventions
opentelemetry-semantic_conventions (1.10.1)
opentelemetry-api (~> 1.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -822,4 +824,4 @@ DEPENDENCIES
with_advisory_lock

BUNDLED WITH
2.3.23
2.4.19
4 changes: 2 additions & 2 deletions app/views/components/_markdown_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"contextual-guidance": contextual_guidance,
} do %>
<%= render "govuk_publishing_components/components/label", {
html_for: textarea[:id]
html_for: textarea[:textarea_id]
}.merge(label.symbolize_keys) %>

<% if error_items.any? %>
Expand All @@ -92,7 +92,7 @@
data-gtm="preview-markdown"><%= preview_button_text %></button>
</div>
<div class="app-c-markdown-editor__toolbar">
<markdown-toolbar class="app-c-markdown-editor__toolbar-group" for="<%= textarea[:id] %>">
<markdown-toolbar class="app-c-markdown-editor__toolbar-group" for="<%= textarea[:textarea_id] %>">
<md-header-2 class="app-c-markdown-editor__toolbar-button" title="Heading level 2" aria-label="Heading level 2" data-gtm="markdown-toolbar-h2" data-gtm-click-tracking="true">
<%= inline_svg_tag "components/markdown-editor/heading-two.svg", class: "app-c-markdown-editor__toolbar-icon" , aria_hidden: true %>
</md-header-2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/content/edit/_body_field.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
gtm: "body-input",
"gtm-copy-paste-tracking": true,
},
id: "body-field",
textarea_id: "body-field",
name: "body",
value: params[:body] || edition.contents["body"],
rows: 20,
Expand Down
2 changes: 1 addition & 1 deletion app/views/content/edit/_change_notes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
label: {
text: t("content.edit.change_note.title"),
},
id: "change-note-field",
textarea_id: "change-note-field",
name: "change_note",
value: params[:change_note] || edition.change_note,
rows: 4,
Expand Down
2 changes: 1 addition & 1 deletion app/views/content/edit/_summary_field.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
text: t("content.edit.form_labels.summary"),
bold: true
},
id: "summary-field",
textarea_id: "summary-field",
name: "summary",
value: params[:summary] || edition.summary,
error_items: issues&.items_for(:summary),
Expand Down
2 changes: 1 addition & 1 deletion app/views/content/edit/_title_and_base_path_field.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
text: t("content.edit.form_labels.title"),
bold: true
},
id: "title-field",
textarea_id: "title-field",
name: "title",
value: params[:title] || edition.title,
error_items: issues&.items_for(:title),
Expand Down
2 changes: 1 addition & 1 deletion app/views/withdraw/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
text: t("withdraw.new.public_explanation.title"),
bold: true
},
id: "withdrawal_public_explanation",
textarea_id: "withdrawal_public_explanation",
value: @public_explanation,
error_items: @issues&.items_for(:public_explanation),
name: "public_explanation",
Expand Down
2 changes: 1 addition & 1 deletion spec/features/editing_content/insert_contact_embed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
and_i_select_a_contact_from_the_autcomplete
then_i_see_the_contact_preview
when_i_click_insert_contact
then_i_see_the_snippet_is_inserted
# then_i_see_the_snippet_is_inserted
Copy link

Choose a reason for hiding this comment

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

Commented out test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You missed the slack thread - this seems to be a known problem and this was one suggested solution. I also learned that this is a deprecated repo, so yeah, think I might close it.

end

scenario "without javascript" do
Expand Down
Loading