Compare commits

...

2 Commits

Author SHA1 Message Date
Oscar Richardson 063d82cd4f
Make log deletion use edit cut-off date, not creation cut-off date. (#3388) 3 weeks ago
Oscar Richardson 7b2387e44e
CLDC-4517: Use new CORE service desk and new email address (#3387) 3 weeks ago
  1. 2
      app/constants/global_constants.rb
  2. 2
      app/policies/lettings_log_policy.rb
  3. 2
      app/policies/sales_log_policy.rb
  4. 6
      app/views/content/accessibility_statement.md
  5. 2
      app/views/start/index.html.erb
  6. 2
      spec/components/data_protection_confirmation_banner_component_spec.rb
  7. 4
      spec/mailers/csv_download_mailer_spec.rb
  8. 30
      spec/policies/lettings_log_policy_spec.rb
  9. 32
      spec/policies/sales_log_policy_spec.rb
  10. 5
      spec/requests/content_controller_spec.rb
  11. 2
      spec/requests/organisations_controller_spec.rb

2
app/constants/global_constants.rb

@ -1,5 +1,5 @@
module GlobalConstants module GlobalConstants
HELPDESK_URL = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11".freeze HELPDESK_URL = "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54".freeze
COUNTRIES_ANSWER_OPTIONS = { COUNTRIES_ANSWER_OPTIONS = {
"" => "Select an option", "" => "Select an option",

2
app/policies/lettings_log_policy.rb

@ -10,7 +10,7 @@ class LettingsLogPolicy
return false unless log && user return false unless log && user
# Can only delete editable logs # Can only delete editable logs
return false unless log.collection_period_open? return false unless log.collection_period_open_for_editing?
# Support users can delete any log # Support users can delete any log
return true if user.support? return true if user.support?

2
app/policies/sales_log_policy.rb

@ -10,7 +10,7 @@ class SalesLogPolicy
return false unless log && user return false unless log && user
# Can only delete editable logs # Can only delete editable logs
return false unless log.collection_period_open? return false unless log.collection_period_open_for_editing?
# Support users can delete any log # Support users can delete any log
return true if user.support? return true if user.support?

6
app/views/content/accessibility_statement.md

@ -27,16 +27,16 @@ We know some parts of this website are not fully accessible:
If you need information on this website in a different format like accessible PDF, large print, easy read, audio recording or braille, you can contact us by: If you need information on this website in a different format like accessible PDF, large print, easy read, audio recording or braille, you can contact us by:
- email: [mhclg.digital-services@communities.gov.uk](mailto: mhclg.digital-services@communities.gov.uk) - email: [svc-SubmitCOREData@communities.gov.uk](mailto:svc-SubmitCOREData@communities.gov.uk)
- phone: 0333 202 5084 - phone: 0333 202 5084
We’ll consider your request and get back to you in 2 working days. We’ll consider your request and get back to you in 2 working days.
You can also [contact us through the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). You can also [contact us through the helpdesk](<%= GlobalConstants::HELPDESK_URL %>).
### Reporting accessibility problems with this website ### Reporting accessibility problems with this website
We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). We’re always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, [contact the helpdesk](<%= GlobalConstants::HELPDESK_URL %>).
### Enforcement procedure ### Enforcement procedure

2
app/views/start/index.html.erb

@ -21,7 +21,7 @@
<h2 class="govuk-heading-m">Before you start</h2> <h2 class="govuk-heading-m">Before you start</h2>
<p class="govuk-body">Use your account details to sign in.</p> <p class="govuk-body">Use your account details to sign in.</p>
<p class="govuk-body">If you need to set up a new account, speak to your organisation’s CORE data coordinator. If you don’t know who that is, <%= govuk_link_to("contact the helpdesk", GlobalConstants::HELPDESK_URL) %>.</p> <p class="govuk-body">If you need to set up a new account, speak to your organisation’s CORE data coordinator. If you don’t know who that is, <%= govuk_link_to("contact the helpdesk", GlobalConstants::HELPDESK_URL) %>.</p>
<p class="govuk-body">You can <%= govuk_mail_to("mhclg.digital-services@communities.gov.uk", "request an account", subject: "CORE: Request a new account") %> if your organisation doesn’t have one.</p> <p class="govuk-body">You can <%= govuk_mail_to("svc-SubmitCOREData@communities.gov.uk", "request an account", subject: "CORE: Request a new account") %> if your organisation doesn’t have one.</p>
<p class="govuk-body"><strong><%= govuk_link_to guidance_path do %>Guidance for submitting social housing lettings and sales data (CORE)<% end %></strong></p> <p class="govuk-body"><strong><%= govuk_link_to guidance_path do %>Guidance for submitting social housing lettings and sales data (CORE)<% end %></strong></p>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m govuk-!-margin-top-8 govuk-!-margin-bottom-8"> <hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m govuk-!-margin-top-8 govuk-!-margin-bottom-8">
<%= render partial: "layouts/collection_resources" %> <%= render partial: "layouts/collection_resources" %>

2
spec/components/data_protection_confirmation_banner_component_spec.rb

@ -31,7 +31,7 @@ RSpec.describe DataProtectionConfirmationBannerComponent, type: :component do
expect(component.display_banner?).to be(true) expect(component.display_banner?).to be(true)
expect(render).to have_link( expect(render).to have_link(
"Contact helpdesk to assign a data protection officer", "Contact helpdesk to assign a data protection officer",
href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54",
) )
expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.") expect(render).to have_selector("p", text: "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement.")
end end

4
spec/mailers/csv_download_mailer_spec.rb

@ -42,7 +42,7 @@ RSpec.describe CsvDownloadMailer do
## Missing town or city ## Missing town or city
The town or city in some logs is missing. This data is required in the new version of CORE.\n", The town or city in some logs is missing. This data is required in the new version of CORE.\n",
how_to_fix: "You need to:\n how_to_fix: "You need to:\n
- download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). - download [this spreadsheet for lettings logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54).
- fill in the missing address data - fill in the missing address data
- check that the existing address data is correct\n", - check that the existing address data is correct\n",
duration: "20 minutes", duration: "20 minutes",
@ -70,7 +70,7 @@ In some of your logs, the UPRN is the same as the purchaser code, but these are
If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n", If a log has the correct UPRN, leave the UPRN unchanged. If the UPRN is incorrect, clear the value and provide the full address instead. Alternatively, you can change the UPRN on the CORE system.\n",
how_to_fix: "You need to:\n how_to_fix: "You need to:\n
- download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11). - download [this spreadsheet for sales logs](#{link}). This link will expire in one week. To request another link, [contact the CORE helpdesk](https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54).
- check that the address data is correct - check that the address data is correct
- correct any address errors\n", - correct any address errors\n",
duration: "20 minutes", duration: "20 minutes",

30
spec/policies/lettings_log_policy_spec.rb

@ -8,7 +8,7 @@ RSpec.describe LettingsLogPolicy do
context "when log nil" do context "when log nil" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
@ -18,7 +18,7 @@ RSpec.describe LettingsLogPolicy do
context "when user nil" do context "when user nil" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
@ -26,21 +26,31 @@ RSpec.describe LettingsLogPolicy do
end end
end end
context "when collection period closed" do context "when collection period closed for editing" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(build(:user, :support), log) expect(policy).not_to permit(build(:user, :support), log)
end end
end end
context "when collection period open" do context "when new logs can no longer be created but the log is still editable" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(true) allow(log).to receive_messages(collection_period_open?: false, collection_period_open_for_editing?: true)
end
it "allows deletion of log" do
expect(policy).to permit(build(:user, :support), log)
end
end
context "when collection period open for editing" do
before do
allow(log).to receive(:collection_period_open_for_editing?).and_return(true)
end end
context "when not started" do context "when not started" do
@ -60,13 +70,13 @@ RSpec.describe LettingsLogPolicy do
let(:user_of_managing_org) { create(:user, :data_coordinator, organisation: log.managing_organisation) } let(:user_of_managing_org) { create(:user, :data_coordinator, organisation: log.managing_organisation) }
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(user, log) expect(policy).not_to permit(user, log)
end end
it "allows deletion of log" do it "allows deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).to permit(user_of_managing_org, log) expect(policy).to permit(user_of_managing_org, log)
end end
@ -84,7 +94,7 @@ RSpec.describe LettingsLogPolicy do
let(:user) { create(:user) } let(:user) { create(:user) }
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(user, log) expect(policy).not_to permit(user, log)
end end

32
spec/policies/sales_log_policy_spec.rb

@ -8,7 +8,7 @@ RSpec.describe SalesLogPolicy do
context "when log nil" do context "when log nil" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
@ -18,7 +18,7 @@ RSpec.describe SalesLogPolicy do
context "when user nil" do context "when user nil" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
@ -26,21 +26,31 @@ RSpec.describe SalesLogPolicy do
end end
end end
context "when collection period closed" do context "when collection period closed for editing" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(false) allow(log).to receive(:collection_period_open_for_editing?).and_return(false)
end end
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(build(:user, :support), log) expect(policy).not_to permit(build(:user, :support), log)
end end
end end
context "when collection period open" do context "when new logs can no longer be created but the log is still editable" do
before do before do
allow(log).to receive(:collection_period_open?).and_return(true) allow(log).to receive_messages(collection_period_open?: false, collection_period_open_for_editing?: true)
end
it "allows deletion of log" do
expect(policy).to permit(build(:user, :support), log)
end
end
context "when collection period open for editing" do
before do
allow(log).to receive(:collection_period_open_for_editing?).and_return(true)
end end
context "when not started" do context "when not started" do
@ -60,13 +70,13 @@ RSpec.describe SalesLogPolicy do
let(:user_of_owning_org) { create(:user, :data_coordinator, organisation: log.owning_organisation) } let(:user_of_owning_org) { create(:user, :data_coordinator, organisation: log.owning_organisation) }
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(user, log) expect(policy).not_to permit(user, log)
end end
it "allows deletion of log" do it "allows deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).to permit(user_of_owning_org, log) expect(policy).to permit(user_of_owning_org, log)
end end
@ -76,7 +86,7 @@ RSpec.describe SalesLogPolicy do
let(:user) { create(:user, :support) } let(:user) { create(:user, :support) }
it "does allow deletion of log" do it "does allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).to permit(user, log) expect(policy).to permit(user, log)
end end
@ -86,7 +96,7 @@ RSpec.describe SalesLogPolicy do
let(:user) { create(:user) } let(:user) { create(:user) }
it "does not allow deletion of log" do it "does not allow deletion of log" do
expect(log).to receive(:collection_period_open?) expect(log).to receive(:collection_period_open_for_editing?)
expect(policy).not_to permit(user, log) expect(policy).not_to permit(user, log)
end end

5
spec/requests/content_controller_spec.rb

@ -31,6 +31,11 @@ RSpec.describe ContentController, type: :request do
it "returns the page" do it "returns the page" do
expect(page).to have_title("Accessibility statement") expect(page).to have_title("Accessibility statement")
end end
it "links to the helpdesk" do
expect(page).to have_link("contact us through the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54")
expect(page).to have_link("contact the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54")
end
end end
describe "render data sharing agreement" do describe "render data sharing agreement" do

2
spec/requests/organisations_controller_spec.rb

@ -497,7 +497,7 @@ RSpec.describe OrganisationsController, type: :request do
it "displays a link to merge organisations" do it "displays a link to merge organisations" do
expect(page).to have_content("To report a merge or update your organisation details, ") expect(page).to have_content("To report a merge or update your organisation details, ")
expect(page).to have_link("contact the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/6/group/11") expect(page).to have_link("contact the helpdesk", href: "https://mhclgdigital.atlassian.net/servicedesk/customer/portal/54")
end end
it "does not display merge history if there is none" do it "does not display merge history if there is none" do

Loading…
Cancel
Save