Skip to content

Commit

Permalink
Merge pull request #8282 from alphagov/remove-obsolete-date-selection…
Browse files Browse the repository at this point in the history
…-component

Remove unused datetime select component
  • Loading branch information
ryanb-gds authored Sep 21, 2023
2 parents f8c50c2 + 109d403 commit d353912
Show file tree
Hide file tree
Showing 30 changed files with 44 additions and 261 deletions.
2 changes: 1 addition & 1 deletion app/views/admin/call_for_evidence_responses/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
legend_text: "Published on (required)",
heading_size: "l"
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
prefix: prefix,
field_name: "published_on",
date_only: true,
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/calls_for_evidence/_date_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
heading_size: "l",
id: "edition_opening_at",
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
field_name: "opening_at",
prefix: "edition",
error_items: errors_for(edition.errors, :opening_at),
Expand Down Expand Up @@ -50,7 +50,7 @@
heading_size: "l",
id: "edition_closing_at",
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
field_name: "closing_at",
prefix: "edition",
error_items: errors_for(edition.errors, :closing_at),
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/consultation_responses/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
legend_text: "Published on (required)",
heading_size: "l"
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
prefix: prefix,
field_name: "published_on",
date_only: true,
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/consultations/_date_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
heading_size: "l",
id: "edition_opening_at",
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
field_name: "opening_at",
prefix: "edition",
error_items: errors_for(edition.errors, :opening_at),
Expand Down Expand Up @@ -50,7 +50,7 @@
heading_size: "l",
id: "edition_closing_at",
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
field_name: "closing_at",
prefix: "edition",
error_items: errors_for(edition.errors, :closing_at),
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/editions/_first_published_at.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% first_published_at_fields = render("components/datetime_fields_with_govuk_date_component", {
<% first_published_at_fields = render("components/datetime_fields", {
field_name: "first_published_at",
prefix: "edition",
date_hint: "For example, 01 08 2022",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/editions/_review_reminder_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
track_label: "Set a reminder to review this content after it has been published",
track_action: "clicked",
},
conditional: render("components/datetime_fields_with_govuk_date_component", {
conditional: render("components/datetime_fields", {
field_name: "review_at",
prefix: "edition[document_attributes][review_reminder_attributes]",
date_only: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
label: "Schedule for publication",
value: 1,
checked: params[:scheduled_publication_active] == "1" || edition.scheduled_publication.present?,
conditional: render("components/datetime_fields_with_govuk_date_component", {
conditional: render("components/datetime_fields", {
field_name: "scheduled_publication",
prefix: "edition",
error_items: errors_for(edition.errors, :scheduled_publication),
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/governments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
legend_text: "Dates",
heading_size: "l"
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_only: true,
prefix: "government",
field_name: "start_date",
Expand Down Expand Up @@ -51,7 +51,7 @@
error_items: errors_for(government.errors, :start_date)
} %>

<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_only: true,
prefix: "government",
field_name: "end_date",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/offsite_links/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
end
} %>

<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
prefix: "offsite_link",
field_name: "date",
date_heading: "Date",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/organisations/_closed_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
} %>

<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_only: true,
prefix: "organisation",
field_name: "closed_at",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/review_reminders/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= form_with model: review_reminder, url: [:admin, document, review_reminder] do |form| %>
<%= render("components/datetime_fields_with_govuk_date_component", {
<%= render("components/datetime_fields", {
field_name: "review_at",
prefix: "review_reminder",
date_only: true,
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/role_appointments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
} do %>
<%= render "start_date_field", heading_size: "m", form: form %>

<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_heading: "End date",
heading_size: "m",
field_name: "ended_at",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_heading: "Start date (required)",
heading_size: heading_size,
field_name: "started_at",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/speeches/_delivered_on_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
heading_size: "l",
id: "edition_delivered_on",
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
field_name: "delivered_on",
prefix: "edition",
error_items: errors_for(edition.errors, :delivered_on),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
legend_text: "Release date",
heading_size: "l"
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
id: "statistics_announcement_date_change_release_date",
date_heading: "Date (required)",
field_name: "release_date",
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/statistics_announcements/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
legend_text: "Release date",
heading_size: "l"
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
id: "statistics_announcement_statistics_announcement_dates_release_date",
date_heading: "Date (required)",
field_name: "release_date",
Expand Down
4 changes: 2 additions & 2 deletions app/views/admin/topical_events/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
heading_size: "l",
margin_bottom: 2
} do %>
<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_only: true,
prefix: "topical_event",
field_name: "start_date",
Expand Down Expand Up @@ -96,7 +96,7 @@
error_items: errors_for(topical_event.errors, :start_date)
} %>

<%= render "components/datetime_fields_with_govuk_date_component", {
<%= render "components/datetime_fields", {
date_only: true,
prefix: "topical_event",
field_name: "end_date",
Expand Down
File renamed without changes.
199 changes: 0 additions & 199 deletions app/views/components/_datetime_fields.html.erb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
fill_in :statistics_announcement_title, with: announcement_title
fill_in :statistics_announcement_summary, with: "Summary of publication"
within "#statistics_announcement_statistics_announcement_dates_release_date" do
fill_in_govuk_publishing_date_and_time_field(1.year.from_now.to_s)
fill_in_date_and_time_field(1.year.from_now.to_s)
end
select organisation.name, from: :statistics_announcement_organisations

Expand All @@ -141,7 +141,7 @@
click_on "Change dates"

within "#statistics_announcement_date_change_release_date" do
fill_in_govuk_publishing_date_and_time_field("14-Dec-#{Time.zone.today.year.next} 09:30")
fill_in_date_and_time_field("14-Dec-#{Time.zone.today.year.next} 09:30")
end

choose "Exact date (confirmed)"
Expand Down
Loading

0 comments on commit d353912

Please sign in to comment.