Browse Source

feat: add new design to scheme page (#1003)

* feat: add new design to scheme page

* feat: add incomplete status

* feat: use confirmed behaviour
pull/1031/head
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
e0a6a719b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/scheme.rb
  2. 22
      app/views/schemes/_scheme_list.html.erb
  3. 6
      db/schema.rb

2
app/models/scheme.rb

@ -214,6 +214,8 @@ class Scheme < ApplicationRecord
end end
def status def status
return :incomplete unless confirmed
open_deactivation = scheme_deactivation_periods.deactivations_without_reactivation.first open_deactivation = scheme_deactivation_periods.deactivations_without_reactivation.first
recent_deactivation = scheme_deactivation_periods.order("created_at").last recent_deactivation = scheme_deactivation_periods.order("created_at").last

22
app/views/schemes/_scheme_list.html.erb

@ -5,31 +5,31 @@
<% end %> <% end %>
<%= table.head do |head| %> <%= table.head do |head| %>
<%= head.row do |row| %> <%= head.row do |row| %>
<% row.cell(header: true, text: "Code", html_attributes: {
scope: "col",
}) %>
<% row.cell(header: true, text: "Scheme", html_attributes: { <% row.cell(header: true, text: "Scheme", html_attributes: {
scope: "col", scope: "col",
}) %> }) %>
<% row.cell(header: true, text: "Locations", html_attributes: { <% row.cell(header: true, text: "Code", html_attributes: {
scope: "col",
}) %>
<% row.cell(header: true, text: "Support provided by", html_attributes: {
scope: "col", scope: "col",
}) %> }) %>
<% row.cell(header: true, text: "Created", html_attributes: { <% row.cell(header: true, text: "Locations", html_attributes: {
scope: "col", scope: "col",
}) %> }) %>
<% if FeatureToggle.scheme_toggle_enabled? %>
<% row.cell(header: true, text: "Status", html_attributes: {
scope: "col",
}) %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% @schemes.each do |scheme| %> <% @schemes.each do |scheme| %>
<%= table.body do |body| %> <%= table.body do |body| %>
<%= body.row do |row| %> <%= body.row do |row| %>
<% row.cell(text: scheme.id_to_display) %>
<% row.cell(text: simple_format(scheme_cell(scheme), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> <% row.cell(text: simple_format(scheme_cell(scheme), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %>
<% row.cell(text: scheme.id_to_display) %>
<% row.cell(text: scheme.locations&.count) %> <% row.cell(text: scheme.locations&.count) %>
<% row.cell(text: scheme.managing_organisation&.name) %> <% if FeatureToggle.scheme_toggle_enabled? %>
<% row.cell(text: scheme.confirmed? ? scheme.created_at.to_formatted_s(:govuk_date) : govuk_tag(colour: "grey", text: "Incomplete")) %> <% row.cell(text: status_tag(scheme.status)) %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>

6
db/schema.rb

@ -374,15 +374,15 @@ ActiveRecord::Schema[7.0].define(version: 2022_11_22_130928) do
t.integer "la_known" t.integer "la_known"
t.integer "income1" t.integer "income1"
t.integer "income1nk" t.integer "income1nk"
t.integer "details_known_2"
t.integer "details_known_3"
t.integer "details_known_4"
t.integer "age4" t.integer "age4"
t.integer "age4_known" t.integer "age4_known"
t.integer "age5" t.integer "age5"
t.integer "age5_known" t.integer "age5_known"
t.integer "age6" t.integer "age6"
t.integer "age6_known" t.integer "age6_known"
t.integer "details_known_2"
t.integer "details_known_3"
t.integer "details_known_4"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id" t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["managing_organisation_id"], name: "index_sales_logs_on_managing_organisation_id" t.index ["managing_organisation_id"], name: "index_sales_logs_on_managing_organisation_id"
t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id" t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id"

Loading…
Cancel
Save