Skip to content

Commit

Permalink
R1.5 update (#1081)
Browse files Browse the repository at this point in the history
* Embcessmod 373 phone email update (#1015)

* Add new checkboxes to self registration

* Add custom validation for no email and phone

* Update review of self reg to show no email/phone number

* Add new validation for email and phone number to registration-maker

* Uncommented code

* Add Strathcona Regional District to communities (#1017)

* Change viewEvacuee to properly include city (#1019)

* Add country to viewEvacuee (#1021)

* Embcessmod 373 fixes (#1022)

* Add required class to Telephone/Email labels

* Add required class to telephone/email in registration-maker

* Change required validation on phone number

* Fix typo in registration summary

* Add CSS to fix layout of checkboxes

* Fix issue where no email/no phone inputs did not save state when editing registration

* Add no email and no phone properties to registration reducer

* Fix bug where telephone number was not actually required

* uncommented code

* Embcessmod 373 fixes (#1024)

* Fix bug with validatiors

* Fixed bug with empty no email/phone checkboxes

* Set ERA version 1.2 (#1025)

* EMBCESSMOD-242 tool tip text

* reverted index order for needs assessment

* Fixed wrong revert change

* EMBCESSMOD-310 Self-Registration - Needs Assessment Fields Wrong Order

* EMBCESSMOD-335 reversed values for Food, Lodging, Clothing, Transportation, Incidentals

* EMBCESSMOD-335 additional fix to reversed values

* EMBCESSMOD-320 Unique Task#

* Fixed unit tests compilation

* Added data protection keys persistent folder setting

* Simplified dependencies for now

* Set ERA version to 1.2

Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>

* ERA Release Version 

Added FileVersion and AssemblyVersion

* Embcessmod 306 self reg evac from (#1027)

* Add validators for evacuated from

* Add checkbox for primary addr is same as evac'd from

* Add communities selector

* Text change

* Fixed issue with community component not displaying

* Add evac from to registration summary

* Remove test console.log

* Change wording on email in self-reg confirmation (#1028)

* Add different styles depending on env (#1030)

* Add different styles depending on env

* Fix formatting issue in constants file

* Added new environment variable

* Embcessmod 449 env banner (#1032)

* Add different styles depending on env

* Fix formatting issue in constants file

* Added new environment variable

* Add initial modal popup

* Add styles for different envs to modal

* Add Big Lake to Communities.json (#1034)

* Add environment modal to login link in header (#1035)

* R2 landing page updates (#1037)

* EMBCESSMOD-242 tool tip text

* reverted index order for needs assessment

* Fixed wrong revert change

* EMBCESSMOD-310 Self-Registration - Needs Assessment Fields Wrong Order

* EMBCESSMOD-335 reversed values for Food, Lodging, Clothing, Transportation, Incidentals

* EMBCESSMOD-335 additional fix to reversed values

* EMBCESSMOD-320 Unique Task#

* Fixed unit tests compilation

* Added data protection keys persistent folder setting

* Simplified dependencies for now

* Set ERA version to 1.2

* R2 landing page updates

Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>

* R2 landing page image fix (#1038)

* EMBCESSMOD-242 tool tip text

* reverted index order for needs assessment

* Fixed wrong revert change

* EMBCESSMOD-310 Self-Registration - Needs Assessment Fields Wrong Order

* EMBCESSMOD-335 reversed values for Food, Lodging, Clothing, Transportation, Incidentals

* EMBCESSMOD-335 additional fix to reversed values

* EMBCESSMOD-320 Unique Task#

* Fixed unit tests compilation

* Added data protection keys persistent folder setting

* Simplified dependencies for now

* Set ERA version to 1.2

* R2 landing page updates

* R2 landing page image fix

Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>

* Embcessmod 306 updates (#1039)

* Change environment names to be more consistent

* Add function to handle mapping primary address to evacuated from

* Save value of Evac'd From Primary Addr when editing

* Embcessmod 306 updates (#1040)

* Change environment names to be more consistent

* Add function to handle mapping primary address to evacuated from

* Save value of Evac'd From Primary Addr when editing

* Fix issue with changing evacuated from primary address from 'no' to 'yes'

* Change env modal text to match wireframes (#1041)

* Display correct env modal body text (#1043)

* Add migration to fix view (#1042)

* Embcessmod 306 updates (#1049)

* Change environment names to be more consistent

* Add function to handle mapping primary address to evacuated from

* Save value of Evac'd From Primary Addr when editing

* Fix issue with changing evacuated from primary address from 'no' to 'yes'

* Fix bug where evac from in summary is wrong

* Hide env banner for prod self-reg (#1050)

* Embcessmod 494 (#1047)

* Display correct env modal body text

* Add Bulkley-Nechako community

* Add new communities to Communities.json

* Add communities to correct region

* Embcessmod 306 fixes (#1052)

* Add valueChange event to evacFromPrimaryAddr

* Change displayRegistration() to patch evacuatedFrom control outside of from.patchValue function

* Add migration to update babine lake (#1053)

* Embcessmod 490 add contact info (#1055)

* Add contact info for all logged in roles

* Add contact info for 'everyone' role

* Fix alignment of contact info for signed-out roles

* Remove commented code

* Update language on training and material page (#1056)

* EMBCESSMOD-549 URL updates to embc domain for era training and prod (#1057)

* EMBCESSMOD-242 tool tip text

* reverted index order for needs assessment

* Fixed wrong revert change

* EMBCESSMOD-310 Self-Registration - Needs Assessment Fields Wrong Order

* EMBCESSMOD-335 reversed values for Food, Lodging, Clothing, Transportation, Incidentals

* EMBCESSMOD-335 additional fix to reversed values

* EMBCESSMOD-320 Unique Task#

* Fixed unit tests compilation

* Added data protection keys persistent folder setting

* Simplified dependencies for now

* Set ERA version to 1.2

* R2 landing page updates

* R2 landing page image fix

* EMBCESSMOD-549 URL updates to embc domain for era training and prod

Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>

* Update language on training and material page (#1058)

* Embcessmod 441 additional train mats (#1060)

* Add new facilitator links

* Change icon to PowerPoint

* Moved PDF icon to correct link

* Embcessmod 475 release notes (#1059)

* Add era updates release section to useful info page

* Change url of updates pdf

* Change release number to 1.x

* R1.4 update (#1062)

* EMBCESSMOD-242 tool tip text

* reverted index order for needs assessment

* Fixed wrong revert change

* EMBCESSMOD-310 Self-Registration - Needs Assessment Fields Wrong Order

* EMBCESSMOD-335 reversed values for Food, Lodging, Clothing, Transportation, Incidentals

* EMBCESSMOD-335 additional fix to reversed values

* EMBCESSMOD-320 Unique Task#

* Fixed unit tests compilation

* Added data protection keys persistent folder setting

* Simplified dependencies for now

* Set ERA version to 1.2

* R2 landing page updates

* R2 landing page image fix

* EMBCESSMOD-549 URL updates to embc domain for era training and prod

* fixed self registration link to use embc.gov.bc.ca domain

Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>

* Embcessmod 436 csv export (#1064)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Embcessmod 436 csv export (#1065)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Embcessmod 436 csv export (#1066)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Embcessmod 436 csv export (#1067)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Embcessmod 436 csv export (#1068)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Embcessmod 436 csv export (#1069)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Embcessmod 436 csv export (#1070)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* EMBCESSMOD-592: fixed tasks list search queries and display (#1072)

* Embcessmod 436 csv export (#1071)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* EMBCESSMOD-592: fixed tasks list search queries and display  (#1073)

* EMBCESSMOD-592: fixed tasks list search queries and display

* Added active/expired flag to filter api call

* Embcessmod 436 csv export (#1074)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* Reversed Evacuated To and From in the search paramters for export

* Embcessmod 436 csv export (#1075)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* Reversed Evacuated To and From in the search paramters for export

* Add code to swap Evac_To and From in search params export

* Export fixes (#1076)

* Fix issue when searching by dob

* Remove unused search fields

* Embcessmod 436 csv export (#1077)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* Reversed Evacuated To and From in the search paramters for export

* Add code to swap Evac_To and From in search params export

* Fix issue when searching by dob

* Remove unused search fields

* Add code to handle null radio buttons

* Remove commented out code

* Embcessmod 436 csv export (#1078)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* Reversed Evacuated To and From in the search paramters for export

* Add code to swap Evac_To and From in search params export

* Fix issue when searching by dob

* Remove unused search fields

* Add code to handle null radio buttons

* Remove commented out code

* Add function for friendly search param names

* Change referral query to strip commas from purchaser column

* Fix issue with comma in Purchaser column

* Remove unecessary cast

* Embcessmod 436 csv export (#1080)

* Add File-Saver package

* Add EvacueeReportItem and query

* Add Where Clause to Evacuee Export

* Removed old download function

* Add export validation for super users

* Change evacuee report routing

* Rename evacuee export function

* Add referrals export with where clauses

* Add click event for referral export

* Update search button styles

* Update Referral Query and manually calculate pdt for file name

* Change the date calculation in title to use TimeZoneInfo

* Change file naming to match supplier

* Change OS switch statement to old style

* Remove unused line

* Add search params to reports

* Fix whitespace that was annoying me

* Fix validation logic for superusers exporting

* Uncommented date of birth field

* Change PK of EvacueeReportItem

* Remove commented out code

* Swap Evacuated_From and Evacuated_To in export

* Change Evac From and To in export query

* Reversed Evacuated To and From in the search paramters for export

* Add code to swap Evac_To and From in search params export

* Fix issue when searching by dob

* Remove unused search fields

* Add code to handle null radio buttons

* Remove commented out code

* Add function for friendly search param names

* Change referral query to strip commas from purchaser column

* Fix issue with comma in Purchaser column

* Remove unecessary cast

* Change reg completed and refs provided search params depending on report

Co-authored-by: Wes R <[email protected]>
Co-authored-by: Curtis <[email protected]>
Co-authored-by: Yossi T <[email protected]>
Co-authored-by: Yossi Tamari <[email protected]>
  • Loading branch information
5 people authored Jul 7, 2020
1 parent b6f5d06 commit b6979f3
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 261 deletions.
146 changes: 73 additions & 73 deletions embc-app/Controllers/EvacueesController.cs
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
using Gov.Jag.Embc.Public.DataInterfaces;
using Gov.Jag.Embc.Public.Utils;
using Gov.Jag.Embc.Public.ViewModels.Search;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Text;
using System.Threading.Tasks;

namespace Gov.Jag.Embc.Public.Controllers
{
[Route("api/[controller]")]
[Authorize]
public class EvacueesController : Controller
{
private readonly IDataInterface dataInterface;

public EvacueesController(IDataInterface dataInterface)
{
this.dataInterface = dataInterface;
}

[HttpGet]
public async Task<IActionResult> Get([FromQuery] EvacueeSearchQueryParameters query, string format = "json")
{
if (format.Equals("csv", System.StringComparison.OrdinalIgnoreCase))
{
var evacuees = await dataInterface.GetEvacueeReportAsync(query);

var fileName = $"Evacuees_Export_{ DateTime.Now:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV()), "text/csv;charset=utf-8", fileName);
}
else
{
var evacuees = await dataInterface.GetEvacueesPaginatedAsync(query);
return Json(evacuees);
}
}

[HttpGet("getevacueereport")]
public async Task<IActionResult> EvacueeReport([FromQuery] EvacueeSearchQueryParameters query)
{
var evacuees = await dataInterface.GetEvacueeReportAsync(query);
var today = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, GetPSTTimeZone());
var fileName = $"Evacuees_Export_{ today:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV(query)), "text/csv;charset=utf-8", fileName);
}

[HttpGet("getevacueereferralreport")]
public async Task<IActionResult> EvacueeReferralReport([FromQuery] EvacueeSearchQueryParameters query)
{
var evacuees = await dataInterface.GetEvacueeReferralReportAsync(query);
var today = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, GetPSTTimeZone());
var fileName = $"Referral_Export_{ today:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV(query)), "text/csv;charset=utf-8", fileName);
}

private string GetPSTTimeZone()
{
switch (Environment.OSVersion.Platform)
{
case PlatformID.Win32NT:
return "Pacific Standard Time";
case PlatformID.Unix:
return "Canada/Pacific";
default:
throw new NotSupportedException();


}
}
}
}
using Gov.Jag.Embc.Public.DataInterfaces;
using Gov.Jag.Embc.Public.Utils;
using Gov.Jag.Embc.Public.ViewModels.Search;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Text;
using System.Threading.Tasks;

namespace Gov.Jag.Embc.Public.Controllers
{
[Route("api/[controller]")]
[Authorize]
public class EvacueesController : Controller
{
private readonly IDataInterface dataInterface;

public EvacueesController(IDataInterface dataInterface)
{
this.dataInterface = dataInterface;
}

[HttpGet]
public async Task<IActionResult> Get([FromQuery] EvacueeSearchQueryParameters query, string format = "json")
{
if (format.Equals("csv", System.StringComparison.OrdinalIgnoreCase))
{
var evacuees = await dataInterface.GetEvacueeReportAsync(query);

var fileName = $"Evacuees_Export_{ DateTime.Now:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV()), "text/csv;charset=utf-8", fileName);
}
else
{
var evacuees = await dataInterface.GetEvacueesPaginatedAsync(query);
return Json(evacuees);
}
}

[HttpGet("getevacueereport")]
public async Task<IActionResult> EvacueeReport([FromQuery] EvacueeSearchQueryParameters query)
{
var evacuees = await dataInterface.GetEvacueeReportAsync(query);
var today = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, GetPSTTimeZone());
var fileName = $"Evacuees_Export_{ today:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV(query, true)), "text/csv;charset=utf-8", fileName);
}

[HttpGet("getevacueereferralreport")]
public async Task<IActionResult> EvacueeReferralReport([FromQuery] EvacueeSearchQueryParameters query)
{
var evacuees = await dataInterface.GetEvacueeReferralReportAsync(query);
var today = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, GetPSTTimeZone());
var fileName = $"Referral_Export_{ today:yyyyMMdd_HHmmss}.csv";
return File(Encoding.UTF8.GetBytes(evacuees.ToCSV(query, false)), "text/csv;charset=utf-8", fileName);
}

private string GetPSTTimeZone()
{
switch (Environment.OSVersion.Platform)
{
case PlatformID.Win32NT:
return "Pacific Standard Time";
case PlatformID.Unix:
return "Canada/Pacific";
default:
throw new NotSupportedException();


}
}
}
}
Loading

0 comments on commit b6979f3

Please sign in to comment.