Browse Source

link to bulk upload spec and templates (#1476)

pull/1342/head
Phil Lee 2 years ago committed by GitHub
parent
commit
7a34f4a6a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/controllers/bulk_upload_lettings_logs_controller.rb
  2. 7
      app/controllers/bulk_upload_sales_logs_controller.rb
  3. 27
      app/models/forms/bulk_upload_lettings/guidance.rb
  4. 14
      app/models/forms/bulk_upload_lettings/prepare_your_file.rb
  5. 27
      app/models/forms/bulk_upload_sales/guidance.rb
  6. 14
      app/models/forms/bulk_upload_sales/prepare_your_file.rb
  7. 4
      app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb
  8. 2
      app/views/bulk_upload_lettings_results/show.html.erb
  9. 2
      app/views/bulk_upload_lettings_results/summary.html.erb
  10. 4
      app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb
  11. 2
      app/views/bulk_upload_sales_results/show.html.erb
  12. 6
      app/views/bulk_upload_shared/guidance.html.erb
  13. 2
      config/routes.rb
  14. BIN
      public/files/bulk-upload-lettings-specification-2023-24.xlsx
  15. 0
      public/files/bulk-upload-lettings-template-2022-23.xlsx
  16. BIN
      public/files/bulk-upload-lettings-template-2023-24.xlsx
  17. BIN
      public/files/bulk-upload-sales-specification-2023-24.xlsx
  18. 0
      public/files/bulk-upload-sales-template-2022-23.xlsx
  19. BIN
      public/files/bulk-upload-sales-template-2023-24.xlsx

7
app/controllers/bulk_upload_lettings_logs_controller.rb

@ -21,11 +21,6 @@ class BulkUploadLettingsLogsController < ApplicationController
end end
end end
def guidance
@form = Forms::BulkUploadLettings::PrepareYourFile.new
render "bulk_upload_shared/guidance"
end
private private
def current_year def current_year
@ -44,6 +39,8 @@ private
Forms::BulkUploadLettings::Year.new(form_params) Forms::BulkUploadLettings::Year.new(form_params)
when "prepare-your-file" when "prepare-your-file"
Forms::BulkUploadLettings::PrepareYourFile.new(form_params) Forms::BulkUploadLettings::PrepareYourFile.new(form_params)
when "guidance"
Forms::BulkUploadLettings::Guidance.new(form_params)
when "needstype" when "needstype"
Forms::BulkUploadLettings::Needstype.new(form_params) Forms::BulkUploadLettings::Needstype.new(form_params)
when "upload-your-file" when "upload-your-file"

7
app/controllers/bulk_upload_sales_logs_controller.rb

@ -21,11 +21,6 @@ class BulkUploadSalesLogsController < ApplicationController
end end
end end
def guidance
@form = Forms::BulkUploadSales::PrepareYourFile.new
render "bulk_upload_shared/guidance"
end
private private
def current_year def current_year
@ -42,6 +37,8 @@ private
Forms::BulkUploadSales::Year.new(form_params) Forms::BulkUploadSales::Year.new(form_params)
when "prepare-your-file" when "prepare-your-file"
Forms::BulkUploadSales::PrepareYourFile.new(form_params) Forms::BulkUploadSales::PrepareYourFile.new(form_params)
when "guidance"
Forms::BulkUploadSales::Guidance.new(form_params)
when "upload-your-file" when "upload-your-file"
Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:)) Forms::BulkUploadSales::UploadYourFile.new(form_params.merge(current_user:))
when "checking-file" when "checking-file"

27
app/models/forms/bulk_upload_lettings/guidance.rb

@ -0,0 +1,27 @@
module Forms
module BulkUploadLettings
class Guidance
include ActiveModel::Model
include ActiveModel::Attributes
include Rails.application.routes.url_helpers
attribute :year, :integer
def view_path
"bulk_upload_shared/guidance"
end
def back_path
bulk_upload_lettings_log_path(id: "prepare-your-file", form: { year: })
end
def template_path
Forms::BulkUploadLettings::PrepareYourFile.new(year:).template_path
end
def specification_path
Forms::BulkUploadLettings::PrepareYourFile.new(year:).specification_path
end
end
end
end

14
app/models/forms/bulk_upload_lettings/prepare_your_file.rb

@ -26,11 +26,21 @@ module Forms
end end
def template_path def template_path
"/files/bulk-upload-lettings-template-v1.xlsx" case year
when 2022
"/files/bulk-upload-lettings-template-2022-23.xlsx"
when 2023
"/files/bulk-upload-lettings-template-2023-24.xlsx"
end
end end
def specification_path def specification_path
"/files/bulk-upload-lettings-specification-2022-23.xlsx" case year
when 2022
"/files/bulk-upload-lettings-specification-2022-23.xlsx"
when 2023
"/files/bulk-upload-lettings-specification-2023-24.xlsx"
end
end end
def year_combo def year_combo

27
app/models/forms/bulk_upload_sales/guidance.rb

@ -0,0 +1,27 @@
module Forms
module BulkUploadSales
class Guidance
include ActiveModel::Model
include ActiveModel::Attributes
include Rails.application.routes.url_helpers
attribute :year, :integer
def view_path
"bulk_upload_shared/guidance"
end
def back_path
bulk_upload_sales_log_path(id: "prepare-your-file", form: { year: })
end
def template_path
Forms::BulkUploadSales::PrepareYourFile.new(year:).template_path
end
def specification_path
Forms::BulkUploadSales::PrepareYourFile.new(year:).specification_path
end
end
end
end

14
app/models/forms/bulk_upload_sales/prepare_your_file.rb

@ -24,11 +24,21 @@ module Forms
end end
def template_path def template_path
"/files/bulk-upload-sales-template-v1.xlsx" case year
when 2022
"/files/bulk-upload-sales-template-2022-23.xlsx"
when 2023
"/files/bulk-upload-sales-template-2023-24.xlsx"
end
end end
def specification_path def specification_path
"/files/bulk-upload-sales-specification-2022-23.xlsx" case year
when 2022
"/files/bulk-upload-sales-specification-2022-23.xlsx"
when 2023
"/files/bulk-upload-sales-specification-2023-24.xlsx"
end
end end
def year_combo def year_combo

4
app/views/bulk_upload_lettings_logs/forms/prepare_your_file.html.erb

@ -13,14 +13,14 @@
<h2 class="govuk-heading-m">Create your file</h2> <h2 class="govuk-heading-m">Create your file</h2>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Download the <%= govuk_link_to "bulk lettings template", @form.template_path %></li> <li>Download the <%= govuk_link_to "bulk lettings template", @form.template_path %></li>
<li>Export the data from your housing management system, matching the template. <%= govuk_link_to "Find out more about exporting your data", guidance_bulk_upload_lettings_logs_path %></li> <li>Export the data from your housing management system, matching the template. <%= govuk_link_to "Find out more about exporting your data", bulk_upload_lettings_log_path(id: "guidance", form: { year: @form.year }) %></li>
<li>If you cannot export it in this format, you may have to input it manually</li> <li>If you cannot export it in this format, you may have to input it manually</li>
<li>You can not have a file with both general needs logs and supported housing logs. These must be in separate files</li> <li>You can not have a file with both general needs logs and supported housing logs. These must be in separate files</li>
</ul> </ul>
<h2 class="govuk-heading-m">Check your data</h2> <h2 class="govuk-heading-m">Check your data</h2>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Check data is complete and formatted correctly, using data specifications (opens in a new tab)</li> <li>Check data is complete and formatted correctly, using <%= govuk_link_to "data specifications", @form.specification_path, target: "_blank" %></li>
</ul> </ul>
<h2 class="govuk-heading-m">Save your file</h2> <h2 class="govuk-heading-m">Save your file</h2>

2
app/views/bulk_upload_lettings_results/show.html.erb

@ -4,7 +4,7 @@
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1> <h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1>
<div class="govuk-body"> <div class="govuk-body">
Here’s a list of everything that you need to fix your spreadsheet. You can download the specification to help you fix the cells in your CSV file. Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadLettings::PrepareYourFile.new(year: @bulk_upload.year).specification_path, target: "_blank" %> to help you fix the cells in your CSV file.
</div> </div>
<h2 class="govuk-heading-m"><%= @bulk_upload.filename %></h2> <h2 class="govuk-heading-m"><%= @bulk_upload.filename %></h2>

2
app/views/bulk_upload_lettings_results/summary.html.erb

@ -4,7 +4,7 @@
<h1 class="govuk-heading-l">Fix <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> and upload file again</h1> <h1 class="govuk-heading-l">Fix <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> and upload file again</h1>
<p class="govuk-body-l"> <p class="govuk-body-l">
We could not create logs from your bulk upload. Below is a list of everything that you need to fix your spreadsheet. You can download the specification to help you fix the cells in your CSV file. We could not create logs from your bulk upload. Below is a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadLettings::PrepareYourFile.new(year: @bulk_upload.year).specification_path, target: "_blank" %> to help you fix the cells in your CSV file.
</p> </p>
<p class="govuk-body-l"> <p class="govuk-body-l">

4
app/views/bulk_upload_sales_logs/forms/prepare_your_file.html.erb

@ -13,13 +13,13 @@
<h2 class="govuk-heading-m">Create your file</h2> <h2 class="govuk-heading-m">Create your file</h2>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Download the <%= govuk_link_to "bulk sales template", @form.template_path %></li> <li>Download the <%= govuk_link_to "bulk sales template", @form.template_path %></li>
<li>Export the data from your housing management system, matching the template. <%= govuk_link_to "Find out more about exporting your data", guidance_bulk_upload_sales_logs_path %></li> <li>Export the data from your housing management system, matching the template. <%= govuk_link_to "Find out more about exporting your data", bulk_upload_sales_log_path(id: "guidance", form: { year: @form.year }) %></li>
<li>If you cannot export it in this format, you may have to input it manually</li> <li>If you cannot export it in this format, you may have to input it manually</li>
</ul> </ul>
<h2 class="govuk-heading-m">Check your data</h2> <h2 class="govuk-heading-m">Check your data</h2>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>Check data is complete and formatted correctly, using data specifications (opens in a new tab)</li> <li>Check data is complete and formatted correctly, using data <%= govuk_link_to "specifications", @form.specification_path, target: "_blank" %></li>
</ul> </ul>
<h2 class="govuk-heading-m">Save your file</h2> <h2 class="govuk-heading-m">Save your file</h2>

2
app/views/bulk_upload_sales_results/show.html.erb

@ -4,7 +4,7 @@
<h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1> <h1 class="govuk-heading-l">We found <%= pluralize(@bulk_upload.bulk_upload_errors.count, "error") %> in your file</h1>
<div class="govuk-body"> <div class="govuk-body">
Here’s a list of everything that you need to fix your spreadsheet. You can download the specification to help you fix the cells in your CSV file. Here’s a list of everything that you need to fix your spreadsheet. You can download the <%= govuk_link_to "specification", Forms::BulkUploadSales::PrepareYourFile.new(year: @bulk_upload.year).specification_path, target: "_blank" %> to help you fix the cells in your CSV file.
</div> </div>
<h2 class="govuk-heading-m"><%= @bulk_upload.filename %></h2> <h2 class="govuk-heading-m"><%= @bulk_upload.filename %></h2>

6
app/views/bulk_upload_shared/guidance.html.erb

@ -1,5 +1,5 @@
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link href: :back %> <%= govuk_back_link href: @form.back_path %>
<% end %> <% end %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">
@ -33,7 +33,7 @@
<p class="govuk-!-font-weight-bold">It can take HMS providers a while to update these per new collection year, so you may have to wait for updates to export, or adjust your data manually post-export.</p> <p class="govuk-!-font-weight-bold">It can take HMS providers a while to update these per new collection year, so you may have to wait for updates to export, or adjust your data manually post-export.</p>
<% end %> <% end %>
<%= govuk_details(summary_text: "My organisation does not have a CMS") do %> <%= govuk_details(summary_text: "My organisation does not have a CMS") do %>
<p class="govuk-body">Your organisation’s IT team may be able to export CSV data for you - <%= govuk_link_to "find out more about data specification", @form.specification_path %>. This document outlines:</p> <p class="govuk-body">Your organisation’s IT team may be able to export CSV data for you - <%= govuk_link_to "find out more about data specification", @form.specification_path, target: "_blank" %>. This document outlines:</p>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>required fields</li> <li>required fields</li>
<li>each field's valid response</li> <li>each field's valid response</li>
@ -45,7 +45,7 @@
<div class="govuk-!-padding-bottom-4"> <div class="govuk-!-padding-bottom-4">
<h2 class="govuk-heading-s">Getting help</h2> <h2 class="govuk-heading-s">Getting help</h2>
<p class="govuk-body">There is no step-by-step bulk upload guide like there is with single log upload. However, you can download <%= govuk_link_to "our template", @form.template_path %>, which you can copy-paste data into from your systems column-by-column. You can also view a post-upload report showing any data errors, and our <%= govuk_link_to "data specification", @form.specification_path %> can help fix these.</p> <p class="govuk-body">There is no step-by-step bulk upload guide like there is with single log upload. However, you can download <%= govuk_link_to "our template", @form.template_path %>, which you can copy-paste data into from your systems column-by-column. You can also view a post-upload report showing any data errors, and our <%= govuk_link_to "data specification", @form.specification_path, target: "_blank" %> can help fix these.</p>
<p class="govuk-body">If you still need support mapping data in the way we need, DLUHC’s helpdesk can help. If your data is across multiple systems, or is hard to export as a single file in the correct format, you could try different exports, or copy-pasting data by hand.</p> <p class="govuk-body">If you still need support mapping data in the way we need, DLUHC’s helpdesk can help. If your data is across multiple systems, or is hard to export as a single file in the correct format, you could try different exports, or copy-pasting data by hand.</p>
</div> </div>
</div> </div>

2
config/routes.rb

@ -134,7 +134,6 @@ Rails.application.routes.draw do
resources :bulk_upload_lettings_logs, path: "bulk-upload-logs", only: %i[show update] do resources :bulk_upload_lettings_logs, path: "bulk-upload-logs", only: %i[show update] do
collection do collection do
get :start get :start
get "guidance", to: "bulk_upload_lettings_logs#guidance"
end end
end end
@ -169,7 +168,6 @@ Rails.application.routes.draw do
resources :bulk_upload_sales_logs, path: "bulk-upload-logs" do resources :bulk_upload_sales_logs, path: "bulk-upload-logs" do
collection do collection do
get :start get :start
get "guidance", to: "bulk_upload_sales_logs#guidance"
end end
end end

BIN
public/files/bulk-upload-lettings-specification-2023-24.xlsx

Binary file not shown.

0
public/files/bulk-upload-lettings-template-v1.xlsx → public/files/bulk-upload-lettings-template-2022-23.xlsx

BIN
public/files/bulk-upload-lettings-template-2023-24.xlsx

Binary file not shown.

BIN
public/files/bulk-upload-sales-specification-2023-24.xlsx

Binary file not shown.

0
public/files/bulk-upload-sales-template-v1.xlsx → public/files/bulk-upload-sales-template-2022-23.xlsx

BIN
public/files/bulk-upload-sales-template-2023-24.xlsx

Binary file not shown.
Loading…
Cancel
Save