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. 12
      app/models/forms/bulk_upload_lettings/prepare_your_file.rb
  5. 27
      app/models/forms/bulk_upload_sales/guidance.rb
  6. 12
      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
def guidance
@form = Forms::BulkUploadLettings::PrepareYourFile.new
render "bulk_upload_shared/guidance"
end
private
def current_year
@ -44,6 +39,8 @@ private
Forms::BulkUploadLettings::Year.new(form_params)
when "prepare-your-file"
Forms::BulkUploadLettings::PrepareYourFile.new(form_params)
when "guidance"
Forms::BulkUploadLettings::Guidance.new(form_params)
when "needstype"
Forms::BulkUploadLettings::Needstype.new(form_params)
when "upload-your-file"

7
app/controllers/bulk_upload_sales_logs_controller.rb

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

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

@ -26,11 +26,21 @@ module Forms
end
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
def specification_path
case year
when 2022
"/files/bulk-upload-lettings-specification-2022-23.xlsx"
when 2023
"/files/bulk-upload-lettings-specification-2023-24.xlsx"
end
end
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

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

@ -24,11 +24,21 @@ module Forms
end
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
def specification_path
case year
when 2022
"/files/bulk-upload-sales-specification-2022-23.xlsx"
when 2023
"/files/bulk-upload-sales-specification-2023-24.xlsx"
end
end
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>
<ul class="govuk-list govuk-list--bullet">
<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>You can not have a file with both general needs logs and supported housing logs. These must be in separate files</li>
</ul>
<h2 class="govuk-heading-m">Check your data</h2>
<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>
<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>
<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>
<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>
<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 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>
<ul class="govuk-list govuk-list--bullet">
<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>
</ul>
<h2 class="govuk-heading-m">Check your data</h2>
<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>
<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>
<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>
<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 %>
<%= govuk_back_link href: :back %>
<%= govuk_back_link href: @form.back_path %>
<% end %>
<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>
<% end %>
<%= 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">
<li>required fields</li>
<li>each field's valid response</li>
@ -45,7 +45,7 @@
<div class="govuk-!-padding-bottom-4">
<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>
</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
collection do
get :start
get "guidance", to: "bulk_upload_lettings_logs#guidance"
end
end
@ -169,7 +168,6 @@ Rails.application.routes.draw do
resources :bulk_upload_sales_logs, path: "bulk-upload-logs" do
collection do
get :start
get "guidance", to: "bulk_upload_sales_logs#guidance"
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