generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the success view for the new import
The new Activity actual, refund and comment import breaks the imported rows in to meaningful types that we want to show to the user. Here we add four new tables for showing the imported objects, we choose to add new ones as the existing shared partials are for a different view and do not have the appropriate content and we prefer the extra partials closer to their use than make more complicated shared partials. We then update the controller to provide the data to the view, this uses the new Import::Csv::ImportedRow object so that, when required, we can provide the row number to the user. Along the way we have to update some specs to account for the new `Import::Csv::ImportedRow` objects being returned by the `FileService`.
- Loading branch information
Showing
11 changed files
with
175 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
%table.govuk-table#actuals | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Actuals | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Value | ||
%tbody.govuk-table__body | ||
- @grouped_actuals.each do |activity, actuals| | ||
%tr.govuk-table__row{ id: "activity_actuals_#{activity.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
%table.govuk-table.actuals | ||
- actuals.each do |actual| | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= actual.financial_quarter_and_year | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= actual.value | ||
- if actual.comment | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-full", scope: "col", colspan: 2} | ||
= actual.comment.body | ||
|
||
|
||
%tr.govuk-table__row.totals | ||
%td.govuk-table__cell Total | ||
%td.govuk-table__cell | ||
%td.govuk-table__cell.govuk-table__cell--numeric | ||
= @total_actuals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
%table.govuk-table#comments | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Activity Comments | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Comment | ||
%tbody.govuk-table__body | ||
- @imported_activity_comments.each do |comment| | ||
%tr.govuk-table__row{ id: "activity_comment_#{comment.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.associated_activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.associated_activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= comment.body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
%table.govuk-table#refunds | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Refunds | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Activity | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} RODA Identifier | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Value | ||
%tbody.govuk-table__body | ||
- @grouped_refunds.each do |activity, refunds| | ||
%tr.govuk-table__row{ id: "activity_actuals_#{activity.id}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.title | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= activity.roda_identifier | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
%table.govuk-table.actuals | ||
- refunds.each do |refund| | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= refund.financial_quarter_and_year | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-one-half", scope: "col"} | ||
= refund.value | ||
- if refund.comment | ||
%tr.govuk-table__row | ||
%td.govuk-table__cell--numeric{class: "govuk-!-width-full", scope: "col", colspan: 2} | ||
= refund.comment.body | ||
|
||
%tr.govuk-table__row.totals | ||
%td.govuk-table__cell Total | ||
%td.govuk-table__cell | ||
%td.govuk-table__cell.govuk-table__cell--numeric | ||
= @total_refunds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
%table.govuk-table#skipped | ||
%caption.govuk-table__caption.govuk-table__caption--m | ||
Skipped rows | ||
%thead.govuk-table__head | ||
%tr.govuk-table__row | ||
%th.govuk-table__header{class: "govuk-!-width-one-third", scope: "col"} Row number | ||
%th.govuk-table__header{class: "govuk-!-width-two-thirds", scope: "col"} RODA Identifier | ||
%tbody.govuk-table__body | ||
- @skipped_rows.each do |row| | ||
%tr.govuk-table__row{ id: "skipped-row-#{row.csv_row_number}" } | ||
%td.govuk-table__cell{class: "govuk-!-width-one-third"} | ||
= row.csv_row_number | ||
%td.govuk-table__cell{class: "govuk-!-width-two-thirds"} | ||
= row.object.roda_identifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters