From 70974a0f41efaeb6eb5acd11f29e41ba6be99f45 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Wed, 8 Nov 2023 20:46:52 +0000 Subject: [PATCH] Help us CTA from delivery error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Finding contact details can take a fair amount of work. Users are often happy to help, but the only signpost we have for this is when submitting the classification. They might not have time to source a new address there and then – and the form itself could be improved – but a reminder for them and other users viewing the requests might help distribute some of this work to the community. Fixes https://github.com/mysociety/alaveteli/issues/1782. --- app/helpers/info_request_helper.rb | 10 +++++++--- doc/CHANGES.md | 2 ++ spec/helpers/info_request_helper_spec.rb | 12 ++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/helpers/info_request_helper.rb b/app/helpers/info_request_helper.rb index 3954b2814b..135b65b865 100644 --- a/app/helpers/info_request_helper.rb +++ b/app/helpers/info_request_helper.rb @@ -185,10 +185,14 @@ def status_text_internal_review(info_request, _opts = {}) public_body_link: public_body_link(info_request.public_body)) end - def status_text_error_message(_info_request, _opts = {}) + def status_text_error_message(info_request, _opts = {}) + body = info_request.public_body _('There was a delivery error or similar, which ' \ - 'needs fixing by the {{site_name}} team.', - site_name: site_name) + 'needs fixing by the {{site_name}} team. Can you help by ' \ + 'finding updated contact ' \ + 'details?', + site_name: site_name, + change_request_url: new_change_request_body_path(body: body.url_name)) end def status_text_requires_admin(_info_request, _opts = {}) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index fd2c76f18c..185e621a1b 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -2,6 +2,8 @@ ## Highlighted Features +* Signpost users to find new contact details for requests with delivery errors + (Gareth Rees) * Add admin view of unmasked version of main body part attachments (Gareth Rees) * Add internal ID number to authority CSV download (Alex Parsons, Graeme Porteous) diff --git a/spec/helpers/info_request_helper_spec.rb b/spec/helpers/info_request_helper_spec.rb index 7455ebe966..a25c1d3185 100644 --- a/spec/helpers/info_request_helper_spec.rb +++ b/spec/helpers/info_request_helper_spec.rb @@ -359,9 +359,17 @@ context 'error_message' do it 'returns a description' do - allow(info_request).to receive(:calculate_status).and_return("error_message") + allow(info_request). + to receive(:public_body).and_return(double(url_name: 'foo')) + + allow(info_request). + to receive(:calculate_status).and_return('error_message') + expected = 'There was a delivery error or similar, ' \ - 'which needs fixing by the Alaveteli team.' + 'which needs fixing by the Alaveteli team. Can you help ' \ + 'by finding updated ' \ + 'contact details?' + expect(status_text(info_request)).to eq(expected) end