Skip to content

Commit

Permalink
[Brent] Include location_name field in CSV export
Browse files Browse the repository at this point in the history
  • Loading branch information
davea committed Sep 15, 2023
1 parent 887feca commit 4963cef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions perllib/FixMyStreet/Cobrand/Brent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ sub dashboard_export_problems_add_columns {

$csv->add_csv_columns(
street_name => 'Street Name',
location_name => 'Location Name',
created_by => 'Created By',
email => 'Email',
usrn => 'USRN',
Expand Down Expand Up @@ -260,6 +261,7 @@ sub dashboard_export_problems_add_columns {

return {
street_name => $report->nearest_address_parts->{street},
location_name => $report->get_extra_field_value('location_name') || '',
created_by => $report->name || '',
email => $report->user->email || '',
usrn => $report->get_extra_field_value('usrn') || '',
Expand Down
6 changes: 6 additions & 0 deletions t/cobrand/brent.t
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,12 @@ subtest 'Dashboard CSV extra columns' => sub {
$flexible_problem->update;
$mech->get_ok('/dashboard?export=1');
ok $mech->content_like(qr/Flexible problem.*?,121,Y,Yes,No,"Small van load",Appliance,/, "Flytip request values added");
$flexible_problem->set_extra_fields(
{name => 'location_name', value => 'Test Park'},
);
$flexible_problem->update;
$mech->get_ok('/dashboard?export=1');
ok $mech->content_like(qr/Flexible problem.*?,,,"Test Park","Test User",.*?,,,121,Y,,,,,,,,/, "Location name added") or diag $mech->content;
}
};

Expand Down

0 comments on commit 4963cef

Please sign in to comment.