Skip to content

Commit

Permalink
Merge pull request #377 from USEPA/feature/integrate-2023-prf
Browse files Browse the repository at this point in the history
Feature/integrate 2023 prf
  • Loading branch information
courtneymyers authored Jan 26, 2024
2 parents 13ea5a8 + f347dd3 commit fa4b369
Show file tree
Hide file tree
Showing 11 changed files with 2,133 additions and 695 deletions.
4 changes: 4 additions & 0 deletions app/client/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import { FRF2022 } from "@/routes/frf2022";
import { PRF2022 } from "@/routes/prf2022";
import { CRF2022 } from "@/routes/crf2022";
import { FRF2023 } from "@/routes/frf2023";
import { PRF2023 } from "@/routes/prf2023";
// import { CRF2023 } from "@/routes/crf2023";
import { useDialogState, useDialogActions } from "@/contexts/dialog";

/** Custom hook to display a site-wide alert banner */
Expand Down Expand Up @@ -249,6 +251,8 @@ export function App() {
<Route path="crf/2022/:id" element={<CRF2022 />} />

<Route path="frf/2023/:id" element={<FRF2023 />} />
<Route path="prf/2023/:id" element={<PRF2023 />} />
{/* <Route path="crf/2023/:id" element={<CRF2023 />} /> */}

<Route path="*" element={<Navigate to="/" replace />} />
</Route>
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const formioProjectName = VITE_FORMIO_PROJECT_NAME;
export const formioProjectUrl = `${formioBaseUrl}/${formioProjectName}`;

export const messages = {
genericError: "Something went wrong.",
genericError: "The application has encountered an unknown error.",
authError: "Authentication error. Please log in again or contact support.",
samlError: "Error logging in. Please try again or contact support.",
bapSamFetchError: "Error loading SAM.gov data. Please contact support.",
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/routes/frf2023.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ function FundingRequestForm(props: { email: string }) {

postData(url, {
mongoId: prf._id,
rebateId: prf.data.hidden_bap_rebate_id,
comboKey: prf.data.bap_hidden_entity_combo_key,
rebateId: prf.data._bap_rebate_id,
comboKey: prf.data._bap_entity_combo_key,
})
.then((_res) => {
window.location.reload();
Expand Down
69 changes: 38 additions & 31 deletions app/client/src/routes/frfNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,56 +34,63 @@ function createInitialSubmissionData(options: {
const { rebateYear, email, entity } = options;

const { title, name } = getUserInfo(email, entity);
const comboKey = entity.ENTITY_COMBO_KEY__c;
const uei = entity.UNIQUE_ENTITY_ID__c;
const efti = entity.ENTITY_EFT_INDICATOR__c;
const orgName = entity.LEGAL_BUSINESS_NAME__c;
const address1 = entity.PHYSICAL_ADDRESS_LINE_1__c;
const address2 = entity.PHYSICAL_ADDRESS_LINE_2__c;
const city = entity.PHYSICAL_ADDRESS_CITY__c;
const state = entity.PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c;
const zip = entity.PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c;

const {
ENTITY_COMBO_KEY__c,
UNIQUE_ENTITY_ID__c,
ENTITY_EFT_INDICATOR__c,
LEGAL_BUSINESS_NAME__c,
PHYSICAL_ADDRESS_LINE_1__c,
PHYSICAL_ADDRESS_LINE_2__c,
PHYSICAL_ADDRESS_CITY__c,
PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c,
PHYSICAL_ADDRESS_ZIPPOSTAL_CODE__c,
ELEC_BUS_POC_EMAIL__c,
ALT_ELEC_BUS_POC_EMAIL__c,
GOVT_BUS_POC_EMAIL__c,
ALT_GOVT_BUS_POC_EMAIL__c,
} = entity;

return rebateYear === "2022"
? {
last_updated_by: email,
hidden_current_user_email: email,
hidden_current_user_title: title,
hidden_current_user_name: name,
bap_hidden_entity_combo_key: comboKey,
bap_hidden_entity_combo_key: ENTITY_COMBO_KEY__c,
sam_hidden_applicant_email: email,
sam_hidden_applicant_title: title,
sam_hidden_applicant_name: name,
sam_hidden_applicant_efti: efti,
sam_hidden_applicant_uei: uei,
sam_hidden_applicant_organization_name: orgName,
sam_hidden_applicant_street_address_1: address1,
sam_hidden_applicant_street_address_2: address2,
sam_hidden_applicant_city: city,
sam_hidden_applicant_state: state,
sam_hidden_applicant_zip_code: zip,
sam_hidden_applicant_efti: ENTITY_EFT_INDICATOR__c,
sam_hidden_applicant_uei: UNIQUE_ENTITY_ID__c,
sam_hidden_applicant_organization_name: LEGAL_BUSINESS_NAME__c,
sam_hidden_applicant_street_address_1: PHYSICAL_ADDRESS_LINE_1__c,
sam_hidden_applicant_street_address_2: PHYSICAL_ADDRESS_LINE_2__c,
sam_hidden_applicant_city: PHYSICAL_ADDRESS_CITY__c,
sam_hidden_applicant_state: PHYSICAL_ADDRESS_PROVINCE_OR_STATE__c,
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: comboKey,
_bap_elec_bus_poc_email: entity.ELEC_BUS_POC_EMAIL__c,
_bap_alt_elec_bus_poc_email: entity.ALT_ELEC_BUS_POC_EMAIL__c,
_bap_govt_bus_poc_email: entity.GOVT_BUS_POC_EMAIL__c,
_bap_alt_govt_bus_poc_email: entity.ALT_GOVT_BUS_POC_EMAIL__c,
_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: efti,
_bap_applicant_uei: uei,
_bap_applicant_organization_name: orgName,
_bap_applicant_street_address_1: address1,
_bap_applicant_street_address_2: address2,
_bap_applicant_city: city,
_bap_applicant_state: state,
_bap_applicant_zip: zip,
_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;
}
Expand Down
Loading

0 comments on commit fa4b369

Please sign in to comment.