Browse Source

Adjust styling and tests

pull/2545/head
Manny Dinssa 2 years ago
parent
commit
e6c40cf8d3
  1. 6
      app/components/bulk_upload_error_row_component.html.erb
  2. 6
      app/components/bulk_upload_error_row_component.rb
  3. 2
      app/frontend/styles/application.scss
  4. 2
      spec/views/bulk_upload_lettings_results/show.html.erb_spec.rb
  5. 2
      spec/views/bulk_upload_lettings_results/summary.html.erb_spec.rb
  6. 2
      spec/views/bulk_upload_sales_results/show.html.erb_spec.rb
  7. 2
      spec/views/bulk_upload_sales_results/summary.html.erb_spec.rb

6
app/components/bulk_upload_error_row_component.html.erb

@ -1,9 +1,9 @@
<div class="govuk-summary-card govuk-!-margin-bottom-6"> <div class="govuk-summary-card govuk-!-margin-bottom-6">
<div class="govuk-summary-card__title-wrapper"> <div class="govuk-summary-card__title-wrapper">
<% if lettings? %> <% if lettings? %>
<h3 class="govuk-summary-card__title"><strong>Row <%= row %></strong> <%= tenant_code_html %> <%= property_ref_html %></h3> <h3 class="govuk-summary-card__title govuk-!-font-weight-regular"><strong>Row <%= row %></strong> <%= tenant_code_html %> <%= property_ref_html %></h3>
<% else %> <% else %>
<h3 class="govuk-summary-card__title"><strong>Row <%= row %></strong> <%= purchaser_code_html %></h3> <h3 class="govuk-summary-card__title govuk-!-font-weight-regular"><strong>Row <%= row %></strong> <%= purchaser_code_html %></h3>
<% end %> <% end %>
</div> </div>
@ -56,7 +56,7 @@
<% row.with_cell(text: error.cell) %> <% row.with_cell(text: error.cell) %>
<% row.with_cell(text: question_for_field(error.field)) %> <% row.with_cell(text: question_for_field(error.field)) %>
<% if index == 0 %> <% if index == 0 %>
<% row.with_cell(text: error_message, rowspan: errors.size, html_attributes: { class: "govuk-!-font-weight-bold" }) %> <% row.with_cell(text: error_message, rowspan: errors.size, html_attributes: { class: "govuk-!-font-weight-bold bulk-upload-error-message" }) %>
<% end %> <% end %>
<% row.with_cell(text: error.field.humanize) %> <% row.with_cell(text: error.field.humanize) %>
<% end %> <% end %>

6
app/components/bulk_upload_error_row_component.rb

@ -18,7 +18,7 @@ class BulkUploadErrorRowComponent < ViewComponent::Base
def tenant_code_html def tenant_code_html
return if tenant_code.blank? return if tenant_code.blank?
content_tag :span, class: "govuk-!-margin-left-3", style: "font-weight: 400;" do content_tag :span, class: "govuk-!-margin-left-3" do
"Tenant code: #{tenant_code}" "Tenant code: #{tenant_code}"
end end
end end
@ -30,7 +30,7 @@ class BulkUploadErrorRowComponent < ViewComponent::Base
def purchaser_code_html def purchaser_code_html
return if purchaser_code.blank? return if purchaser_code.blank?
content_tag :span, class: "govuk-!-margin-left-3", style: "font-weight: 400;" do content_tag :span, class: "govuk-!-margin-left-3" do
"Purchaser code: #{purchaser_code}" "Purchaser code: #{purchaser_code}"
end end
end end
@ -42,7 +42,7 @@ class BulkUploadErrorRowComponent < ViewComponent::Base
def property_ref_html def property_ref_html
return if property_ref.blank? return if property_ref.blank?
content_tag :span, class: "govuk-!-margin-left-3", style: "font-weight: 400;" do content_tag :span, class: "govuk-!-margin-left-3" do
"Property reference: #{property_ref}" "Property reference: #{property_ref}"
end end
end end

2
app/frontend/styles/application.scss

@ -91,6 +91,6 @@ $govuk-breakpoints: (
border-top: 1px solid #b1b4b6; border-top: 1px solid #b1b4b6;
} }
.grouped-rows.last-row td { .grouped-rows.last-row td, .grouped-rows .bulk-upload-error-message {
border-bottom: 1px solid #b1b4b6; border-bottom: 1px solid #b1b4b6;
} }

2
spec/views/bulk_upload_lettings_results/show.html.erb_spec.rb

@ -33,7 +33,7 @@ RSpec.describe "bulk_upload_lettings_results/show.html.erb" do
fragment = Capybara::Node::Simple.new(rendered) fragment = Capybara::Node::Simple.new(rendered)
expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 3)).to eql(%w[Z100 AA100]) expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 4)).to eql(%w[Z100 AA100])
end end
end end
end end

2
spec/views/bulk_upload_lettings_results/summary.html.erb_spec.rb

@ -33,7 +33,7 @@ RSpec.describe "bulk_upload_lettings_results/summary.html.erb" do
fragment = Capybara::Node::Simple.new(rendered) fragment = Capybara::Node::Simple.new(rendered)
expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 3)).to eql(%w[Z100 AA100]) expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 4)).to eql(%w[Z100 AA100])
end end
end end
end end

2
spec/views/bulk_upload_sales_results/show.html.erb_spec.rb

@ -32,7 +32,7 @@ RSpec.describe "bulk_upload_sales_results/show.html.erb" do
render render
fragment = Capybara::Node::Simple.new(rendered) fragment = Capybara::Node::Simple.new(rendered)
expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 3)).to eql(%w[Z100 AA100]) expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 4)).to eql(%w[Z100 AA100])
end end
end end
end end

2
spec/views/bulk_upload_sales_results/summary.html.erb_spec.rb

@ -33,7 +33,7 @@ RSpec.describe "bulk_upload_sales_results/summary.html.erb" do
fragment = Capybara::Node::Simple.new(rendered) fragment = Capybara::Node::Simple.new(rendered)
expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 3)).to eql(%w[Z100 AA100]) expect(fragment.find_css("table tbody td").map(&:inner_text).values_at(0, 4)).to eql(%w[Z100 AA100])
end end
end end
end end

Loading…
Cancel
Save