Skip to content

Commit

Permalink
Merge pull request #448 from USEPA/feature/apply-code-formatting
Browse files Browse the repository at this point in the history
Feature/apply code formatting
  • Loading branch information
courtneymyers authored Jun 10, 2024
2 parents f417bfe + e8ce1a0 commit 31f9bb9
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 76 deletions.
6 changes: 3 additions & 3 deletions app/client/src/routes/crf2022.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ServerResponse =
submission: FormioCRF2022Submission;
};

/** Custom hook to fetch Formio submission data */
/** Custom hook to fetch and update Formio submission data */
function useFormioSubmissionQueryAndMutation(rebateId: string | undefined) {
const queryClient = useQueryClient();

Expand Down Expand Up @@ -227,8 +227,8 @@ function CloseOutRequestForm(props: { email: string }) {
submission.state === "draft"
? content.draftCRFIntro
: submission.state === "submitted"
? content.submittedCRFIntro
: ""
? content.submittedCRFIntro
: ""
}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions app/client/src/routes/frf2022.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type ServerResponse =
submission: FormioFRF2022Submission;
};

/** Custom hook to fetch Formio submission data */
/** Custom hook to fetch and update Formio submission data */
function useFormioSubmissionQueryAndMutation(mongoId: string | undefined) {
const queryClient = useQueryClient();

Expand Down Expand Up @@ -362,8 +362,8 @@ function FundingRequestForm(props: { email: string }) {
submission.state === "draft"
? content.draftFRFIntro
: submission.state === "submitted"
? content.submittedFRFIntro
: ""
? content.submittedFRFIntro
: ""
}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions app/client/src/routes/frf2023.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type ServerResponse =
submission: FormioFRF2023Submission;
};

/** Custom hook to fetch Formio submission data */
/** Custom hook to fetch and update Formio submission data */
function useFormioSubmissionQueryAndMutation(mongoId: string | undefined) {
const queryClient = useQueryClient();

Expand Down Expand Up @@ -348,8 +348,8 @@ function FundingRequestForm(props: { email: string }) {
submission.state === "draft"
? content.draftFRFIntro
: submission.state === "submitted"
? content.submittedFRFIntro
: ""
? content.submittedFRFIntro
: ""
}
/>
)}
Expand Down
44 changes: 22 additions & 22 deletions app/client/src/routes/frfNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,28 @@ function createInitialSubmissionData(options: {
sam_hidden_applicant_zip_code: PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c,
}
: rebateYear === "2023"
? {
_user_email: email,
_user_title: title,
_user_name: name,
_bap_entity_combo_key: ENTITY_COMBO_KEY__c,
_bap_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c,
_bap_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c,
_bap_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c,
_bap_alt_govt_bus_poc_email: ALT_GOVT_BUS_POC_EMAIL__c,
_bap_applicant_email: email,
_bap_applicant_title: title,
_bap_applicant_name: name,
_bap_applicant_efti: ENTITY_EFT_INDICATOR__c,
_bap_applicant_uei: UNIQUE_ENTITY_ID__c,
_bap_applicant_organization_name: LEGAL_BUSINESS_NAME__c,
_bap_applicant_street_address_1: PHYSICAL_ADDRESS_LINE_1__c,
_bap_applicant_street_address_2: PHYSICAL_ADDRESS_LINE_2__c,
_bap_applicant_city: PHYSICAL_ADDRESS_CITY__c,
_bap_applicant_state: PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c,
_bap_applicant_zip: PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c,
}
: null;
? {
_user_email: email,
_user_title: title,
_user_name: name,
_bap_entity_combo_key: ENTITY_COMBO_KEY__c,
_bap_elec_bus_poc_email: ELEC_BUS_POC_EMAIL__c,
_bap_alt_elec_bus_poc_email: ALT_ELEC_BUS_POC_EMAIL__c,
_bap_govt_bus_poc_email: GOVT_BUS_POC_EMAIL__c,
_bap_alt_govt_bus_poc_email: ALT_GOVT_BUS_POC_EMAIL__c,
_bap_applicant_email: email,
_bap_applicant_title: title,
_bap_applicant_name: name,
_bap_applicant_efti: ENTITY_EFT_INDICATOR__c,
_bap_applicant_uei: UNIQUE_ENTITY_ID__c,
_bap_applicant_organization_name: LEGAL_BUSINESS_NAME__c,
_bap_applicant_street_address_1: PHYSICAL_ADDRESS_LINE_1__c,
_bap_applicant_street_address_2: PHYSICAL_ADDRESS_LINE_2__c,
_bap_applicant_city: PHYSICAL_ADDRESS_CITY__c,
_bap_applicant_state: PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c,
_bap_applicant_zip: PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c,
}
: null;
}

export function FRFNew() {
Expand Down
6 changes: 3 additions & 3 deletions app/client/src/routes/prf2022.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ServerResponse =
submission: FormioPRF2022Submission;
};

/** Custom hook to fetch Formio submission data */
/** Custom hook to fetch and update Formio submission data */
function useFormioSubmissionQueryAndMutation(rebateId: string | undefined) {
const queryClient = useQueryClient();

Expand Down Expand Up @@ -244,8 +244,8 @@ function PaymentRequestForm(props: { email: string }) {
submission.state === "draft"
? content.draftPRFIntro
: submission.state === "submitted"
? content.submittedPRFIntro
: ""
? content.submittedPRFIntro
: ""
}
/>
)}
Expand Down
6 changes: 3 additions & 3 deletions app/client/src/routes/prf2023.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ServerResponse =
submission: FormioPRF2023Submission;
};

/** Custom hook to fetch Formio submission data */
/** Custom hook to fetch and update Formio submission data */
function useFormioSubmissionQueryAndMutation(rebateId: string | undefined) {
const queryClient = useQueryClient();

Expand Down Expand Up @@ -242,8 +242,8 @@ function PaymentRequestForm(props: { email: string }) {
submission.state === "draft"
? content.draftPRFIntro
: submission.state === "submitted"
? content.submittedPRFIntro
: ""
? content.submittedPRFIntro
: ""
}
/>
)}
Expand Down
44 changes: 22 additions & 22 deletions app/client/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ export function useHelpdeskAccess() {
return !user
? "pending"
: userRoles.includes("csb_admin") || userRoles.includes("csb_helpdesk")
? "success"
: "failure";
? "success"
: "failure";
}

/** Custom hook to fetch CSB config. */
Expand Down Expand Up @@ -446,8 +446,8 @@ export function useChangeRequestsQuery(rebateYear: RebateYear) {
rebateYear === "2022"
? changeRequest2022Query
: rebateYear === "2023"
? changeRequest2023Query
: changeRequestQuery;
? changeRequest2023Query
: changeRequestQuery;

return useQuery(query);
}
Expand All @@ -461,8 +461,8 @@ export function useChangeRequestsData(rebateYear: RebateYear) {
return rebateYear === "2022"
? queryClient.getQueryData<[]>(["formio/2022/changes"])
: rebateYear === "2023"
? queryClient.getQueryData<FormioChange2023Submission[]>(["formio/2023/changes"]) // prettier-ignore
: undefined;
? queryClient.getQueryData<FormioChange2023Submission[]>(["formio/2023/changes"]) // prettier-ignore
: undefined;
}

/** Custom hook to fetch submissions from the BAP and Formio. */
Expand All @@ -487,10 +487,10 @@ export function useSubmissionsQueries(rebateYear: RebateYear) {
Record_Type_Name__c.startsWith("CSB Funding Request") // prettier-ignore
? "frfs"
: Record_Type_Name__c.startsWith("CSB Payment Request")
? "prfs"
: Record_Type_Name__c.startsWith("CSB Close Out Request")
? "crfs"
: null;
? "prfs"
: Record_Type_Name__c.startsWith("CSB Close Out Request")
? "crfs"
: null;

if (rebateYear && formType) {
object[rebateYear][formType].push(submission);
Expand Down Expand Up @@ -589,8 +589,8 @@ export function useSubmissionsQueries(rebateYear: RebateYear) {
rebateYear === "2022"
? [bapQuery, formioFRF2022Query, formioPRF2022Query, formioCRF2022Query]
: rebateYear === "2023"
? [bapQuery, formioFRF2023Query, formioPRF2023Query, formioCRF2023Query]
: [];
? [bapQuery, formioFRF2023Query, formioPRF2023Query, formioCRF2023Query]
: [];

return useQueries({ queries });
}
Expand All @@ -609,22 +609,22 @@ function useCombinedSubmissions(rebateYear: RebateYear) {
rebateYear === "2022"
? queryClient.getQueryData<FormioFRF2022Submission[]>(["formio/2022/frf-submissions"]) // prettier-ignore
: rebateYear === "2023"
? queryClient.getQueryData<FormioFRF2023Submission[]>(["formio/2023/frf-submissions"]) // prettier-ignore
: undefined;
? queryClient.getQueryData<FormioFRF2023Submission[]>(["formio/2023/frf-submissions"]) // prettier-ignore
: undefined;

const formioPRFSubmissions =
rebateYear === "2022"
? queryClient.getQueryData<FormioPRF2022Submission[]>(["formio/2022/prf-submissions"]) // prettier-ignore
: rebateYear === "2023"
? queryClient.getQueryData<FormioPRF2023Submission[]>(["formio/2023/prf-submissions"]) // prettier-ignore
: undefined;
? queryClient.getQueryData<FormioPRF2023Submission[]>(["formio/2023/prf-submissions"]) // prettier-ignore
: undefined;

const formioCRFSubmissions =
rebateYear === "2022"
? queryClient.getQueryData<FormioCRF2022Submission[]>(["formio/2022/crf-submissions"]) // prettier-ignore
: rebateYear === "2023"
? queryClient.getQueryData<FormioCRF2023Submission[]>(["formio/2023/crf-submissions"]) // prettier-ignore
: undefined;
? queryClient.getQueryData<FormioCRF2023Submission[]>(["formio/2023/crf-submissions"]) // prettier-ignore
: undefined;

const submissions: {
[rebateId: string]: Rebate;
Expand Down Expand Up @@ -686,8 +686,8 @@ function useCombinedSubmissions(rebateYear: RebateYear) {
rebateYear === "2022"
? (formioPRFSubmission as FormioPRF2022Submission).data.hidden_bap_rebate_id // prettier-ignore
: rebateYear === "2023"
? (formioPRFSubmission as FormioPRF2023Submission).data._bap_rebate_id
: null;
? (formioPRFSubmission as FormioPRF2023Submission).data._bap_rebate_id
: null;

const bapMatch = bapFormSubmissions[rebateYear].prfs.find((bapPRFSub) => {
return bapPRFSub.Parent_Rebate_ID__c === formioBapRebateId;
Expand Down Expand Up @@ -717,8 +717,8 @@ function useCombinedSubmissions(rebateYear: RebateYear) {
rebateYear === "2022"
? (formioCRFSubmission as FormioCRF2022Submission).data.hidden_bap_rebate_id // prettier-ignore
: rebateYear === "2023"
? (formioCRFSubmission as FormioCRF2023Submission).data._bap_rebate_id
: null;
? (formioCRFSubmission as FormioCRF2023Submission).data._bap_rebate_id
: null;

const bapMatch = bapFormSubmissions[rebateYear].crfs.find((bapCRFSub) => {
return bapCRFSub.Parent_Rebate_ID__c === formioBapRebateId;
Expand Down
14 changes: 7 additions & 7 deletions app/server/app/routes/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ router.get("/bap/sam", (req, res) => {

return res.json({ status: true });
})
.catch((error) => {
.catch((_error) => {
// NOTE: logged in bap verifyBapConnection
return res.json({ status: false });
});
Expand All @@ -39,7 +39,7 @@ router.get("/formio/2022/frf", (req, res) => {
.then((schema) => {
return res.json({ status: verifySchema(schema) });
})
.catch((error) => {
.catch((_error) => {
// NOTE: error is logged in axiosFormio response interceptor
return res.json({ status: false });
});
Expand All @@ -52,7 +52,7 @@ router.get("/formio/2022/prf", (req, res) => {
.then((schema) => {
return res.json({ status: verifySchema(schema) });
})
.catch((error) => {
.catch((_error) => {
// NOTE: error is logged in axiosFormio response interceptor
return res.json({ status: false });
});
Expand All @@ -65,7 +65,7 @@ router.get("/formio/2022/crf", (req, res) => {
.then((schema) => {
return res.json({ status: verifySchema(schema) });
})
.catch((error) => {
.catch((_error) => {
// NOTE: error is logged in axiosFormio response interceptor
return res.json({ status: false });
});
Expand All @@ -78,7 +78,7 @@ router.get("/formio/2023/frf", (req, res) => {
.then((schema) => {
return res.json({ status: verifySchema(schema) });
})
.catch((error) => {
.catch((_error) => {
// NOTE: error is logged in axiosFormio response interceptor
return res.json({ status: false });
});
Expand All @@ -91,7 +91,7 @@ router.get("/formio/2023/prf", (req, res) => {
.then((schema) => {
return res.json({ status: verifySchema(schema) });
})
.catch((error) => {
.catch((_error) => {
// NOTE: error is logged in axiosFormio response interceptor
return res.json({ status: false });
});
Expand All @@ -104,7 +104,7 @@ router.get("/formio/2023/prf", (req, res) => {
// .then((schema) => {
// return res.json({ status: verifySchema(schema) });
// })
// .catch((error) => {
// .catch((_error) => {
// // NOTE: error is logged in axiosFormio response interceptor
// return res.json({ status: false });
// });
Expand Down
8 changes: 4 additions & 4 deletions app/server/app/utilities/bap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1599,10 +1599,10 @@ function checkFormSubmissionPeriodAndBapStatus({
formType === "frf"
? "CSB_Funding_Request_Status__c"
: formType === "prf"
? "CSB_Payment_Request_Status__c"
: formType === "crf"
? "CSB_Closeout_Request_Status__c"
: null;
? "CSB_Payment_Request_Status__c"
: formType === "crf"
? "CSB_Closeout_Request_Status__c"
: null;

return submission?.Parent_CSB_Rebate__r?.[statusField] === "Edits Requested"
? Promise.resolve()
Expand Down
12 changes: 6 additions & 6 deletions app/server/app/utilities/formio.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
state: "draft",
};
})
.catch((error) => {
.catch((_error) => {
// NOTE: logged in bap verifyBapConnection
const errorStatus = 500;
const errorMessage = `Error getting data for a new 2022 Payment Request form submission from the BAP.`;
Expand Down Expand Up @@ -448,7 +448,7 @@ function fetchDataForPRFSubmission({ rebateYear, req, res }) {
state: "draft",
};
})
.catch((error) => {
.catch((_error) => {
// NOTE: logged in bap verifyBapConnection
const errorStatus = 500;
const errorMessage = `Error getting data for a new 2023 Payment Request form submission from the BAP.`;
Expand Down Expand Up @@ -711,7 +711,7 @@ function uploadS3FileMetadata({ rebateYear, req, res }) {
return res.status(errorStatus).json({ message: errorMessage });
});
})
.catch((error) => {
.catch((_error) => {
const formName =
formType === "frf"
? "CSB Application"
Expand Down Expand Up @@ -1007,7 +1007,7 @@ function updateFRFSubmission({ rebateYear, req, res }) {
return res.status(errorStatus).json({ message: errorMessage });
});
})
.catch((error) => {
.catch((_error) => {
const logMessage =
`User with email '${mail}' attempted to update ${rebateYear} FRF ` +
`submission '${mongoId}' when the CSB FRF enrollment period was closed.`;
Expand Down Expand Up @@ -1279,7 +1279,7 @@ function updatePRFSubmission({ rebateYear, req, res }) {
return res.status(errorStatus).json({ message: errorMessage });
});
})
.catch((error) => {
.catch((_error) => {
const logMessage =
`User with email '${mail}' attempted to update ${rebateYear} PRF ` +
`submission '${rebateId}' when the CSB PRF enrollment period was closed.`;
Expand Down Expand Up @@ -1366,7 +1366,7 @@ function deletePRFSubmission({ rebateYear, req, res }) {
return res.status(errorStatus).json({ message: errorMessage });
});
})
.catch((error) => {
.catch((_error) => {
// NOTE: logged in bap verifyBapConnection
const errorStatus = 500;
const errorMessage = `Error getting form submissions statuses from the BAP.`;
Expand Down

0 comments on commit 31f9bb9

Please sign in to comment.