From 6ae9bd236f42d4b92a7714e9f67a84098f48912f Mon Sep 17 00:00:00 2001 From: Alex Newton Date: Tue, 2 Apr 2024 12:49:38 +0100 Subject: [PATCH] Temporarily take down the support form --- app/views/pages/support.html.erb | 67 +--------- app/views/tickets/new.html.erb | 76 +---------- spec/features/support_spec.rb | 208 +++++++++++++++---------------- 3 files changed, 114 insertions(+), 237 deletions(-) diff --git a/app/views/pages/support.html.erb b/app/views/pages/support.html.erb index 7ec07d40..682fbfee 100644 --- a/app/views/pages/support.html.erb +++ b/app/views/pages/support.html.erb @@ -5,68 +5,11 @@ <% end%>
- -
-
- <%= render "govuk_publishing_components/components/heading", { - text: "Support", - margin_bottom: 6, - heading_level: 1, - font_size: "l", - } %> - -

The Government Digital Service (GDS) maintains the technical service behind data.gov.uk - and helps government publishers to manage and update their data.

- -

It cannot

-
    -
  • help you find or research datasets
  • -
  • provide personal information or medical records
  • -
  • combine data from multiple datasets
  • -
- -

For questions about GOV.UK check the <%= link_to "GOV.UK help pages", "https://www.gov.uk/help", class: "govuk-link" %> or <%= link_to "contact GOV.UK", "https://www.gov.uk/contact/govuk", class: "govuk-link" %>.

-

The NHS <%= link_to "publishes its own data.", "https://digital.nhs.uk/data-and-information/data-collections-and-data-sets/data-sets", class: "govuk-link" %>

- - <%= render "govuk_publishing_components/components/heading", { - text: "If you have a question about a dataset", - margin_bottom: 4, - heading_level: 2, - font_size: "m", - } %> -

If you have a question about a specific dataset, contact the publisher directly.

- -
- <%= render "govuk_publishing_components/components/radio", { - name: "support", - heading: "How can we help you?", - items: [ - { - value: "feedback", - text: "I want to report a problem" - }, - { - value: "data", - text: "I want government to publish new data" - }, - { - value: "publish", - text: "I want to publish for an organisation" - }, - { - value: "accessibility", - text: "I want to report an accessibility issue" - }, - ] - } %> - - <%= render "govuk_publishing_components/components/button", { - text: "Continue", - margin_bottom: true, - } %> -
- -

Please give us your feedback about the site using <%= link_to "our survey", "http://www.smartsurvey.co.uk/s/3SEXD/", class: "govuk-link" %>.

+
+
+

Service unavailable

+

Sorry you can't use this service because of a technical problem.

+

We're working on a fix. Please try again later.

diff --git a/app/views/tickets/new.html.erb b/app/views/tickets/new.html.erb index e4c4b314..096b64d1 100644 --- a/app/views/tickets/new.html.erb +++ b/app/views/tickets/new.html.erb @@ -5,77 +5,11 @@ <% end%>
-
-
- <% if @ticket.errors.any? %> - <% - errors = @ticket.errors.messages.map do |attr, error| - { - text: error[0], - href: "#error-#{attr.to_s}" - } - end - %> - - <%= render "govuk_publishing_components/components/error_summary", { - title: t('.problem'), - items: errors - } %> - <% end %> - - <%= render "govuk_publishing_components/components/heading", { - text: t(".#{@ticket.support}_request"), - margin_bottom: 4, - heading_level: 1, - font_size: "l", - } %> - - <%= form_for @ticket, url: { action: "create", controller: "tickets" } do |f| %> - <% - content_error = t('.enter_a_message') if @ticket.errors[:content].any? - content_error_id = "error-content" if @ticket.errors[:content].any? - name_error = t('.enter_a_name') if @ticket.errors[:name].any? - name_error_id = "error-name" if @ticket.errors[:name].any? - email_error = t('.enter_an_email') if @ticket.errors[:email].any? - email_error_id = "error-email" if @ticket.errors[:email].any? - %> - - <%= render "govuk_publishing_components/components/textarea", { - label: { - text: t('.your_message'), - }, - name: "ticket[content]", - error_message: content_error, - id: content_error_id, - rows: 8, - } %> - - <%= render "govuk_publishing_components/components/input", { - label: { - text: t('.name'), - }, - name: "ticket[name]", - error_message: name_error, - id: name_error_id, - autocomplete: "name", - } %> - - <%= render "govuk_publishing_components/components/input", { - label: { - text: t('.email_address'), - }, - name: "ticket[email]", - error_message: email_error, - id: email_error_id, - hint: t('.use_this_to_reply'), - autocomplete: "email", - } %> - - <%= f.hidden_field(:support, :value => @ticket.support) %> - <%= render "govuk_publishing_components/components/button", { - text: t('.submit'), - } %> - <% end %> +
+
+

Service unavailable

+

Sorry you can't use this service because of a technical problem.

+

We're working on a fix. Please try again later.

diff --git a/spec/features/support_spec.rb b/spec/features/support_spec.rb index 3ce83915..62b5387b 100644 --- a/spec/features/support_spec.rb +++ b/spec/features/support_spec.rb @@ -1,106 +1,106 @@ require "rails_helper" -RSpec.feature "Support tickets", type: :feature do - before do - visit support_path - end - - feature "Reporting a problem" do - let(:ticket) { build :ticket, support: "feedback" } - - scenario "Send a support ticket to Zendesk" do - choose "I want to report a problem" - click_on "Continue" - expect(page).to have_content "Report a problem" - - fill_in "Your message", with: ticket.content - fill_in "Name", with: ticket.name - fill_in "Email address", with: ticket.email - - expect(Zendesk.client) - .to receive_message_chain("tickets.create!") - .with(ticket.to_json) - - click_on "Submit" - expect(page).to have_content "Thanks for contacting data.gov.uk" - end - end - - feature "Asking government to publish new data" do - let(:ticket) { build :ticket, support: "data" } - - scenario "Send a support ticket to Zendesk" do - choose "I want government to publish new data" - click_on "Continue" - expect(page).to have_content "Ask the government to publish new data" - - fill_in "Your message", with: ticket.content - fill_in "Name", with: ticket.name - fill_in "Email address", with: ticket.email - - expect(Zendesk.client) - .to receive_message_chain("tickets.create!") - .with(ticket.to_json) - - click_on "Submit" - expect(page).to have_content "Thanks for contacting data.gov.uk" - end - end - - feature "Becoming a publisher" do - let(:ticket) { build :ticket, support: "publish" } - - scenario "Send a support ticket to Zendesk" do - choose "I want to publish for an organisation" - click_on "Continue" - expect(page).to have_content "Publish for an organisation" - - fill_in "Your message", with: ticket.content - fill_in "Name", with: ticket.name - fill_in "Email address", with: ticket.email - - expect(Zendesk.client) - .to receive_message_chain("tickets.create!") - .with(ticket.to_json) - - click_on "Submit" - expect(page).to have_content "Thanks for contacting data.gov.uk" - end - end - - feature "Recover from invalid data" do - let(:ticket) { build :ticket, email: "foo" } - - scenario "Show the errors in the ticket form" do - choose "I want government to publish new data" - click_on "Continue" - fill_in "Email address", with: ticket.email - - click_on "Submit" - expect(page).to have_content "Enter a valid email address" - expect(page).to have_content "Enter a name" - expect(page).to have_content "Enter a message" - end - end - - feature "Reporting an accessibility issue" do - let(:ticket) { build :ticket, support: "accessibility" } - - scenario "Send a support ticket to Zendesk" do - choose "I want to report an accessibility issue" - click_on "Continue" - expect(page).to have_content "Report an accessibility issue" - - fill_in "Your message", with: ticket.content - fill_in "Name", with: ticket.name - fill_in "Email address", with: ticket.email - - expect(Zendesk.client) - .to receive_message_chain("tickets.create!") - .with(ticket.to_json) - - click_on "Submit" - expect(page).to have_content "Thanks for contacting data.gov.uk" - end - end -end +# RSpec.feature "Support tickets", type: :feature do +# before do +# visit support_path +# end + +# feature "Reporting a problem" do +# let(:ticket) { build :ticket, support: "feedback" } + +# scenario "Send a support ticket to Zendesk" do +# choose "I want to report a problem" +# click_on "Continue" +# expect(page).to have_content "Report a problem" + +# fill_in "Your message", with: ticket.content +# fill_in "Name", with: ticket.name +# fill_in "Email address", with: ticket.email + +# expect(Zendesk.client) +# .to receive_message_chain("tickets.create!") +# .with(ticket.to_json) + +# click_on "Submit" +# expect(page).to have_content "Thanks for contacting data.gov.uk" +# end +# end + +# feature "Asking government to publish new data" do +# let(:ticket) { build :ticket, support: "data" } + +# scenario "Send a support ticket to Zendesk" do +# choose "I want government to publish new data" +# click_on "Continue" +# expect(page).to have_content "Ask the government to publish new data" + +# fill_in "Your message", with: ticket.content +# fill_in "Name", with: ticket.name +# fill_in "Email address", with: ticket.email + +# expect(Zendesk.client) +# .to receive_message_chain("tickets.create!") +# .with(ticket.to_json) + +# click_on "Submit" +# expect(page).to have_content "Thanks for contacting data.gov.uk" +# end +# end + +# feature "Becoming a publisher" do +# let(:ticket) { build :ticket, support: "publish" } + +# scenario "Send a support ticket to Zendesk" do +# choose "I want to publish for an organisation" +# click_on "Continue" +# expect(page).to have_content "Publish for an organisation" + +# fill_in "Your message", with: ticket.content +# fill_in "Name", with: ticket.name +# fill_in "Email address", with: ticket.email + +# expect(Zendesk.client) +# .to receive_message_chain("tickets.create!") +# .with(ticket.to_json) + +# click_on "Submit" +# expect(page).to have_content "Thanks for contacting data.gov.uk" +# end +# end + +# feature "Recover from invalid data" do +# let(:ticket) { build :ticket, email: "foo" } + +# scenario "Show the errors in the ticket form" do +# choose "I want government to publish new data" +# click_on "Continue" +# fill_in "Email address", with: ticket.email + +# click_on "Submit" +# expect(page).to have_content "Enter a valid email address" +# expect(page).to have_content "Enter a name" +# expect(page).to have_content "Enter a message" +# end +# end + +# feature "Reporting an accessibility issue" do +# let(:ticket) { build :ticket, support: "accessibility" } + +# scenario "Send a support ticket to Zendesk" do +# choose "I want to report an accessibility issue" +# click_on "Continue" +# expect(page).to have_content "Report an accessibility issue" + +# fill_in "Your message", with: ticket.content +# fill_in "Name", with: ticket.name +# fill_in "Email address", with: ticket.email + +# expect(Zendesk.client) +# .to receive_message_chain("tickets.create!") +# .with(ticket.to_json) + +# click_on "Submit" +# expect(page).to have_content "Thanks for contacting data.gov.uk" +# end +# end +# end