diff --git a/src/ches/emailConstants.js b/src/ches/emailConstants.js index 084827d..f122068 100644 --- a/src/ches/emailConstants.js +++ b/src/ches/emailConstants.js @@ -1,5 +1,5 @@ -export const adminEmails = ["faisal.hamood@gov.bc.ca", "jason.leach@fullboar.ca", "oamar.kanji@gov.bc.ca"]; -export const adminPublicEmails = []; +export const adminEmails = `${process.env.PRIVATE_ADMIN_EMAILS}`.split(',') +export const adminPublicEmails = `${process.env.PUBLIC_ADMIN_EMAILS}`.split(',') export const ministriesNames = [ { diff --git a/src/ches/emailHandlersPublic.ts b/src/ches/emailHandlersPublic.ts index 48693a1..10b1d2f 100644 --- a/src/ches/emailHandlersPublic.ts +++ b/src/ches/emailHandlersPublic.ts @@ -117,7 +117,6 @@ export const sendProvisionedEmails = async (request) => { export const sendEditRequestEmails = async (editRequest) => { - try { await chesService.send({ bodyType: "html", @@ -142,7 +141,6 @@ export const sendEditRequestEmails = async (editRequest) => { } catch (error) { console.error(error); } - // *** What about no quota change and no contact change? }; export const sendRejectEmail = async (request) => { diff --git a/src/ches/emailHelpers.ts b/src/ches/emailHelpers.ts index b0ff489..93fd55d 100644 --- a/src/ches/emailHelpers.ts +++ b/src/ches/emailHelpers.ts @@ -47,7 +47,7 @@ export const generateEmailTemplatePrivateData = ( : { ...incomingProject }; const secondaryTechnicalLead = - (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead.id !== project.secondaryTechnicalLead.id + (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead?.id !== project.secondaryTechnicalLead?.id ? project.secondaryTechnicalLead : !!requestedProject.secondaryTechnicalLead ? requestedProject.secondaryTechnicalLead : null; const primaryTechnicalLead = project.primaryTechnicalLead; const projectOwner = project.projectOwner; @@ -241,10 +241,9 @@ export const generateEmailTemplatePublicData = ( : { ...incomingProject }; - const secondaryTechnicalLead = - (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead.id !== project.secondaryTechnicalLead.id - ? project.secondaryTechnicalLead : !!requestedProject.secondaryTechnicalLead ? requestedProject.secondaryTechnicalLead : null; - const primaryTechnicalLead = project.primaryTechnicalLead; + const secondaryTechnicalLead = (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead?.id !== project.secondaryTechnicalLead?.id + ? project.secondaryTechnicalLead : !!requestedProject.secondaryTechnicalLead ? requestedProject.secondaryTechnicalLead : null; + const primaryTechnicalLead = project.primaryTechnicalLead; const projectOwner = project.projectOwner; @@ -281,6 +280,12 @@ export const generateEmailTemplatePublicData = ( BudgetProdReq: project.budget.prod, BudgetToolsReq: project.budget.tools, AccountCodingReq: project.accountCoding.replace(/(.{3})(.{5})(.{5})(.{4})(.{7})/g, "$1 $2 $3 $4 $5"), + isPOChanged: requestedProject.projectOwner.email !== project.projectOwner.email, + POReq: requestedProject.projectOwner.email, + isPrimeTLChanged:requestedProject.primaryTechnicalLead.email!== project.primaryTechnicalLead.email, + PrimeTLReq:requestedProject.primaryTechnicalLead.email, + isSecTLChanged:requestedProject.secondaryTechnicalLead?requestedProject.secondaryTechnicalLead.email!== project.secondaryTechnicalLead.email:undefined, + SecTLReq:requestedProject.secondaryTechnicalLead?requestedProject.secondaryTechnicalLead.email:null, ...other, }; }; \ No newline at end of file diff --git a/src/ches/publicEmailTemplates/edit-request-received.html b/src/ches/publicEmailTemplates/edit-request-received.html index fd4b8ee..628432a 100644 --- a/src/ches/publicEmailTemplates/edit-request-received.html +++ b/src/ches/publicEmailTemplates/edit-request-received.html @@ -317,6 +317,159 @@ {% endif %} + {% if isPOChanged %} +
+ +
+
+

+ Project Owner: +

+
+
+ +
+
+

+ {{ POReq }} +

+
+
+ +
+ {% endif %} + {% if isPrimeTLChanged %} +
+ +
+
+

+ Primary Technical Lead: +

+
+
+ +
+
+

+ {{ PrimeTLReq }} +

+
+
+ +
+ {% endif %} + {% if isSecTLChanged && SecTLEmail %} +
+ +
+
+

+ Secondary Technical Lead: +

+
+
+ +
+
+

+ {{ SecTLReq }} +

+
+
+ +
+ {% endif %}
 
  @@ -597,6 +750,159 @@
{% endif %} + {% if isPOChanged %} +
+ +
+
+

+ Project Owner: +

+
+
+ +
+
+

+ {{ POEmail }} +

+
+
+ +
+ {% endif %} + {% if isPrimeTLChanged %} +
+ +
+
+

+ Primary Technical Lead: +

+
+
+ +
+
+

+ {{ PriTLEmail }} +

+
+
+ +
+ {% endif %} + {% if isSecTLChanged && SecTLEmail %} +
+ +
+
+

+ Secondary Technical Lead: +

+
+
+ +
+
+

+ {{ SecTLEmail }} +

+
+
+ +
+ {% endif %}
 
- Your request for a new project set for your product on the AWS is complete. Log on to the cluster console using the link above and you'll see the project set. If you have any more questions reach out to the Cloud Pathfinder Team in the RocketChat channel -