Skip to content

Commit

Permalink
Merge pull request #401 from bcgov/dev-JC-NP-FOIMOD-3405
Browse files Browse the repository at this point in the history
Dev jc np foimod 3405
  • Loading branch information
jocelyncabildo-aot authored Sep 24, 2024
2 parents eceddad + 30e0e8a commit 46e98b8
Show file tree
Hide file tree
Showing 23 changed files with 1,126 additions and 298 deletions.
33 changes: 26 additions & 7 deletions api/emailLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ function EmailLayout() {
<tr><td style="padding-left:20px;">${value}</td></tr>\n`;
};

this.tableRowNoLabel = function(value) {
return `<tr><td style="padding-left:20px;">${value}</td></tr>\n`;
};

this.dateFormat = function(isoDateStr) {
// HTML5 date is ALWAYS formatted yyyy-mm-dd.
// ISO Date is ALWAYS formatted yyyy-mm-ddT00:00:00.000Z.
Expand Down Expand Up @@ -265,6 +269,17 @@ function EmailLayout() {

}

this.requestAdditional = function(additionalOptions)
{
let result = this.tableHeader('Additional Records Specified');

additionalOptions.forEach(options =>{
result += this.tableRowNoLabel(options.name);
});

return result;
}

this.adoptiveParents = function(data) {
const mother = this.joinBySpace(data.motherFirstName, data.motherLastName);
const father = this.joinBySpace(data.fatherFirstName, data.fatherLastName);
Expand Down Expand Up @@ -382,13 +397,17 @@ function EmailLayout() {
);
}

if(data.requestData.selectAbout.yourself && !data.requestData.selectAbout.child && !data.requestData.selectAbout.another)
{
content += this.requesttopic(data.requestData.selectedtopics,data.requestData.requestType.adoption,
data.requestData.requestType.childprotectionchild,data.requestData.requestType.childprotectionparent,
data.requestData.requestType.fosterparent,data.requestData.requestType.youthincarechild,data.requestData.requestType.youthincareparent
)
}
if(data.requestData.selectAbout.yourself)
{
content += this.requesttopic(data.requestData.selectedtopics,data.requestData.requestType.adoption,
data.requestData.requestType.childprotectionchild,data.requestData.requestType.childprotectionparent,
data.requestData.requestType.fosterparent,data.requestData.requestType.youthincarechild,data.requestData.requestType.youthincareparent
)
}

if(data.requestData.selectedadditionaloptions && data.requestData.selectedadditionaloptions.length > 0) {
content += this.requestAdditional(data.requestData.selectedadditionaloptions);
}

// if we have 'childInformation' then include the block
if (data.requestData.selectAbout.child) {
Expand Down
172 changes: 148 additions & 24 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 46e98b8

Please sign in to comment.