Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
hot fixies and query url changed (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolezhanchik committed Sep 6, 2023
1 parent 7c34f62 commit e57f624
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/ches/emailHandlersPrivate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const sendEditRequestEmails = async (project, requestedProject) => {
quotaChanged(project, requestedProject) &&
!contactChanged(project, requestedProject)
) {
await chesService.send({
await chesService.send({
bodyType: "html",
body: swig.renderFile(
"./src/ches/privateEmailTemplates/quota-request-received-email.html",
Expand Down
16 changes: 8 additions & 8 deletions src/ches/emailHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const generateEmailTemplatePrivateData = (
? requestedProject.testQuota.cpu.cpuRequests
: null,
testQuotaMemoryRequested:
requestedProject.testQuota.memoryRequests !==
requestedProject.testQuota.memory.memoryRequests !==
project.testQuota.memory.memoryRequests
? requestedProject.testQuota.memory.memoryRequests
: null,
Expand Down Expand Up @@ -241,9 +241,9 @@ export const generateEmailTemplatePublicData = (
: { ...incomingProject };


const secondaryTechnicalLead = (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead?.id !== project.secondaryTechnicalLead?.id
const secondaryTechnicalLead = (!!project.secondaryTechnicalLead || !!requestedProject.secondaryTechnicalLead) && requestedProject.secondaryTechnicalLead?.id !== project.secondaryTechnicalLead?.id
? project.secondaryTechnicalLead : !!requestedProject.secondaryTechnicalLead ? requestedProject.secondaryTechnicalLead : null;
const primaryTechnicalLead = project.primaryTechnicalLead;
const primaryTechnicalLead = project.primaryTechnicalLead;
const projectOwner = project.projectOwner;


Expand Down Expand Up @@ -280,12 +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,
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,
isPrimeTLChanged: requestedProject.primaryTechnicalLead.email !== project.primaryTechnicalLead.email,
PrimeTLReq: requestedProject.primaryTechnicalLead.email,
isSecTLChanged: requestedProject.secondaryTechnicalLead?.email !== project.secondaryTechnicalLead?.email,
SecTLReq: requestedProject.secondaryTechnicalLead ? requestedProject.secondaryTechnicalLead.email : null,
...other,
};
};
12 changes: 6 additions & 6 deletions src/ches/privateEmailTemplates/quota-and-tlpo-changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -543,7 +543,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -594,7 +594,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1251,7 +1251,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1302,7 +1302,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1353,7 +1353,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -581,7 +581,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -632,7 +632,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down
14 changes: 7 additions & 7 deletions src/ches/privateEmailTemplates/quota-request-received-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -525,7 +525,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -576,7 +576,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1233,7 +1233,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1284,7 +1284,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1335,7 +1335,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1519,7 +1519,7 @@
<![endif]-->
</div>
{% endif %}
{% if isToolsQuotaChanged and toolsQuotaStorageRequested %}
{% if testQuotaStorageRequested and toolsQuotaStorageRequested %}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down
12 changes: 6 additions & 6 deletions src/ches/privateEmailTemplates/request-denial-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -552,7 +552,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -602,7 +602,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1249,7 +1249,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1299,7 +1299,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1349,7 +1349,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down
12 changes: 6 additions & 6 deletions src/ches/privateEmailTemplates/super-admin-request-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -521,7 +521,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -572,7 +572,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1229,7 +1229,7 @@
</td>
</tr>
</table>
{% if isDevelopmentQuotaChanged and testQuotaCPURequested%}
{% if isTestQuotaChanged and testQuotaCPURequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1280,7 +1280,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaMemoryRequested%}
{% if isTestQuotaChanged and testQuotaMemoryRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -1331,7 +1331,7 @@
<![endif]-->
</div>
{% endif %}
{% if isProductionQuotaChanged and testQuotaStorageRequested%}
{% if isTestQuotaChanged and testQuotaStorageRequested%}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down
12 changes: 6 additions & 6 deletions src/ches/publicEmailTemplates/edit-request-received.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
text-align:right;
padding-right:10%;
">
{{ PrimeTLReq }}
{{ PriTLEmail }}
</p>
</div>
</div>
Expand All @@ -419,7 +419,7 @@
<![endif]-->
</div>
{% endif %}
{% if isSecTLChanged && SecTLEmail %}
{% if isSecTLChanged %}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -459,7 +459,7 @@
text-align:right;
padding-right:10%;
">
{{ SecTLReq }}
{{ SecTLEmail || "No Secondary Tech Lead" }}
</p>
</div>
</div>
Expand Down Expand Up @@ -841,7 +841,7 @@
text-align:right;
padding-right:10%;
">
{{ PriTLEmail }}
{{ PrimeTLReq }}
</p>
</div>
</div>
Expand All @@ -852,7 +852,7 @@
<![endif]-->
</div>
{% endif %}
{% if isSecTLChanged && SecTLEmail %}
{% if isSecTLChanged %}
<div class="two-col"
style="text-align:center;font-size:0;background-color: #ffffff; ">
<!--[if mso]>
Expand Down Expand Up @@ -892,7 +892,7 @@
text-align:right;
padding-right:10%;
">
{{ SecTLEmail }}
{{ SecTLReq || "No Secondary Tech Lead"}}
</p>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/controllers/getIdirEmails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { callMsGraph, getAccessToken } from '../msal/index.js';

async function getIdirEmails(req, res) {
const email = req.query.email;
const url = `https://graph.microsoft.com/v1.0/users?$filter=startswith(mail,'${email}')&$orderby=userPrincipalName&$count=true&$top=25`;

const url = `https://graph.microsoft.com/v1.0/users?$filter=startswith(mail,'${email}')and userType eq 'Member'&$orderby=userPrincipalName&$count=true&$top=25`;
try {
const accessToken = await getAccessToken();

Expand Down

0 comments on commit e57f624

Please sign in to comment.