diff --git a/app/components/Form/ProjectAnnualReportFormSummary.tsx b/app/components/Form/ProjectAnnualReportFormSummary.tsx index 1ec3967e30..438c9e96fb 100644 --- a/app/components/Form/ProjectAnnualReportFormSummary.tsx +++ b/app/components/Form/ProjectAnnualReportFormSummary.tsx @@ -46,9 +46,6 @@ const ProjectAnnualReportFormSummary: React.FC = ({ isPristine newFormData operation - formChangeByPreviousFormChangeId { - newFormData - } formByJsonSchemaName { jsonSchema } @@ -162,8 +159,6 @@ const ProjectAnnualReportFormSummary: React.FC = ({ uiSchema={reportingRequirementUiSchema} formContext={{ operation: annualReport.operation, - oldData: - annualReport.formChangeByPreviousFormChangeId?.newFormData, latestCommittedData, isAmendmentsAndOtherRevisionsSpecific: isOnAmendmentsAndOtherRevisionsPage, diff --git a/app/components/Form/ProjectContactFormSummary.tsx b/app/components/Form/ProjectContactFormSummary.tsx index c71c4fc399..eb57d53d05 100644 --- a/app/components/Form/ProjectContactFormSummary.tsx +++ b/app/components/Form/ProjectContactFormSummary.tsx @@ -181,11 +181,6 @@ const ProjectContactFormSummary: React.FC = ({ formData={node.newFormData} formContext={{ operation: node.operation, - oldData: node.formChangeByPreviousFormChangeId?.newFormData, - oldUiSchema: createProjectContactUiSchema( - node?.formChangeByPreviousFormChangeId?.asProjectContact - ?.contactByContactId?.fullName - ), latestCommittedData: latestCommittedContactNode?.node?.newFormData, latestCommittedUiSchema, @@ -260,13 +255,6 @@ const ProjectContactFormSummary: React.FC = ({ formData={primaryContact ? primaryContact.node.newFormData : null} formContext={{ operation: primaryContact?.node.operation, - oldData: - primaryContact?.node.formChangeByPreviousFormChangeId - ?.newFormData, - oldUiSchema: createProjectContactUiSchema( - primaryContact?.node?.formChangeByPreviousFormChangeId - ?.asProjectContact?.contactByContactId?.fullName - ), latestCommittedData: lastCommittedPrimaryContact?.node?.newFormData, latestCommittedUiSchema: createProjectContactUiSchema( diff --git a/app/components/Form/ProjectEmissionIntensityReportFormSummary.tsx b/app/components/Form/ProjectEmissionIntensityReportFormSummary.tsx index 86ea14749e..b5819e2799 100644 --- a/app/components/Form/ProjectEmissionIntensityReportFormSummary.tsx +++ b/app/components/Form/ProjectEmissionIntensityReportFormSummary.tsx @@ -51,13 +51,6 @@ const ProjectEmissionsIntensityReportFormSummary: React.FC = ({ formByJsonSchemaName { jsonSchema } - formChangeByPreviousFormChangeId { - newFormData - calculatedEiPerformance - paymentPercentage - maximumPerformanceMilestoneAmount - actualPerformanceMilestoneAmount - } } } } @@ -97,24 +90,6 @@ const ProjectEmissionsIntensityReportFormSummary: React.FC = ({ summaryReportingRequirement?.actualPerformanceMilestoneAmount, }; - const oldData = { - ...summaryReportingRequirement?.formChangeByPreviousFormChangeId - ?.newFormData, - //calculated values - calculatedEiPerformance: - summaryReportingRequirement?.formChangeByPreviousFormChangeId - ?.calculatedEiPerformance, - paymentPercentage: - summaryReportingRequirement?.formChangeByPreviousFormChangeId - ?.paymentPercentage, - maximumPerformanceMilestoneAmount: - summaryReportingRequirement?.formChangeByPreviousFormChangeId - ?.maximumPerformanceMilestoneAmount, - actualPerformanceMilestoneAmount: - summaryReportingRequirement?.formChangeByPreviousFormChangeId - ?.actualPerformanceMilestoneAmount, - }; - const latestCommittedData = { ...latestCommittedEmissionIntensityReportFormChange?.edges[0]?.node ?.newFormData, @@ -147,7 +122,6 @@ const ProjectEmissionsIntensityReportFormSummary: React.FC = ({ const filteredSchema = getSchemaAndDataIncludingCalculatedValues( emissionIntensityFormBySlug.jsonSchema.schema as JSONSchema7, newData, - oldData, { // This is only to add the (Adjusted) to the title of the field to differentiate it from the calculated field adjustedEmissionsIntensityPerformance: { @@ -265,7 +239,6 @@ const ProjectEmissionsIntensityReportFormSummary: React.FC = ({ actualPerformanceMilestoneAmount: summaryReportingRequirement?.actualPerformanceMilestoneAmount, operation: summaryReportingRequirement?.operation, - oldData, latestCommittedData, isAmendmentsAndOtherRevisionsSpecific: isOnAmendmentsAndOtherRevisionsPage, diff --git a/app/components/Form/ProjectFormSummary.tsx b/app/components/Form/ProjectFormSummary.tsx index 5a0868bf57..1706076b60 100644 --- a/app/components/Form/ProjectFormSummary.tsx +++ b/app/components/Form/ProjectFormSummary.tsx @@ -52,25 +52,6 @@ const ProjectFormSummary: React.FC = ({ name } } - formChangeByPreviousFormChangeId { - rank - newFormData - asProject { - operatorByOperatorId { - legalName - bcRegistryId - } - fundingStreamRfpByFundingStreamRfpId { - year - fundingStreamByFundingStreamId { - description - } - } - projectStatusByProjectStatusId { - name - } - } - } } latestCommittedProjectFormChanges: latestCommittedFormChangesFor( formDataTableName: "project" @@ -110,23 +91,7 @@ const ProjectFormSummary: React.FC = ({ // Show diff if it is not the first revision and not view only (rendered from the overview page) const renderDiff = !isFirstRevision && !viewOnly; - const oldData = { - ...projectFormChange.formChangeByPreviousFormChangeId?.newFormData, - rank: projectFormChange.formChangeByPreviousFormChangeId?.rank, - }; - const newDataAsProject = projectFormChange.asProject; - const previousDataAsProject = - projectFormChange.formChangeByPreviousFormChangeId?.asProject; - - const oldUiSchema = previousDataAsProject - ? createProjectUiSchema( - previousDataAsProject.operatorByOperatorId.legalName, - `${previousDataAsProject?.fundingStreamRfpByFundingStreamRfpId?.fundingStreamByFundingStreamId.description} - ${previousDataAsProject?.fundingStreamRfpByFundingStreamRfpId?.year}`, - previousDataAsProject.operatorByOperatorId.bcRegistryId, - previousDataAsProject.projectStatusByProjectStatusId.name - ) - : null; const latestCommittedUiSchema = latestCommittedData?.asProject ? createProjectUiSchema( @@ -148,7 +113,6 @@ const ProjectFormSummary: React.FC = ({ projectSchema as JSONSchema7, { ...projectFormChange?.newFormData, rank: projectFormChange.rank }, - oldData, { rank: { type: "number", @@ -199,8 +163,6 @@ const ProjectFormSummary: React.FC = ({ formData={formData} formContext={{ calculatedRank: projectFormChange.rank, - oldData, - oldUiSchema, latestCommittedData, latestCommittedUiSchema, operation: projectFormChange.operation, diff --git a/app/components/Form/ProjectFundingAgreementFormSummary.tsx b/app/components/Form/ProjectFundingAgreementFormSummary.tsx index a0adaec4f6..12e3ea405b 100644 --- a/app/components/Form/ProjectFundingAgreementFormSummary.tsx +++ b/app/components/Form/ProjectFundingAgreementFormSummary.tsx @@ -71,25 +71,6 @@ const ProjectFundingAgreementFormSummary: React.FC = ({ } } operation - formChangeByPreviousFormChangeId { - newFormData - eligibleExpensesToDate - holdbackAmountToDate - netPaymentsToDate - grossPaymentsToDate - calculatedTotalPaymentAmountToDate - proponentsSharePercentage - totalProjectValue - anticipatedFundingAmountPerFiscalYear { - edges { - # eslint-disable-next-line relay/unused-fields - node { - anticipatedFundingAmount - fiscalYear - } - } - } - } } } } @@ -169,25 +150,6 @@ const ProjectFundingAgreementFormSummary: React.FC = ({ ), }; - const oldFundingFormChanges = - revision.summaryProjectFundingAgreementFormChanges.edges[0]?.node - .formChangeByPreviousFormChangeId; - - const oldData = { - ...oldFundingFormChanges?.newFormData, - eligibleExpensesToDate: oldFundingFormChanges?.eligibleExpensesToDate, - holdbackAmountToDate: oldFundingFormChanges?.holdbackAmountToDate, - netPaymentsToDate: oldFundingFormChanges?.netPaymentsToDate, - grossPaymentsToDate: oldFundingFormChanges?.grossPaymentsToDate, - totalPaymentAmountToDate: - oldFundingFormChanges?.calculatedTotalPaymentAmountToDate, - proponentsSharePercentage: oldFundingFormChanges?.proponentsSharePercentage, - totalProjectValue: oldFundingFormChanges?.totalProjectValue, - anticipatedFundingAmountPerFiscalYear: cleanupNestedNodes( - oldFundingFormChanges?.anticipatedFundingAmountPerFiscalYear.edges - ), - }; - const fundingStream = revision.projectFormChange.asProject.fundingStreamRfpByFundingStreamRfpId .fundingStreamByFundingStreamId.name; @@ -223,7 +185,7 @@ const ProjectFundingAgreementFormSummary: React.FC = ({ const filteredSchema = getSchemaAndDataIncludingCalculatedValues( schema as JSONSchema7, newData, - oldData + latestCommittedData ); // Set the formSchema and formData based on showing the diff or not @@ -342,7 +304,6 @@ const ProjectFundingAgreementFormSummary: React.FC = ({ fundingAgreementSummary?.totalProjectValue, calculatedProponentsSharePercentage: fundingAgreementSummary?.proponentsSharePercentage, - oldData, latestCommittedData, isAmendmentsAndOtherRevisionsSpecific: isOnAmendmentsAndOtherRevisionsPage, diff --git a/app/components/Form/ProjectManagerFormSummary.tsx b/app/components/Form/ProjectManagerFormSummary.tsx index 9ba457a8a1..0ce9c978de 100644 --- a/app/components/Form/ProjectManagerFormSummary.tsx +++ b/app/components/Form/ProjectManagerFormSummary.tsx @@ -42,14 +42,6 @@ const ProjectManagerFormSummary: React.FC = ({ fullName } } - formChangeByPreviousFormChangeId { - newFormData - asProjectManager { - cifUserByCifUserId { - fullName - } - } - } formByJsonSchemaName { jsonSchema } @@ -146,12 +138,6 @@ const ProjectManagerFormSummary: React.FC = ({ formData={node.formChange.newFormData} formContext={{ operation: node.formChange?.operation, - oldData: - node.formChange?.formChangeByPreviousFormChangeId?.newFormData, - oldUiSchema: createProjectManagerUiSchema( - node.formChange?.formChangeByPreviousFormChangeId - ?.asProjectManager?.cifUserByCifUserId?.fullName - ), latestCommittedData: latestCommittedManagerNode?.node?.newFormData, latestCommittedUiSchema, isAmendmentsAndOtherRevisionsSpecific: diff --git a/app/components/Form/ProjectMilestoneReportFormSummary.tsx b/app/components/Form/ProjectMilestoneReportFormSummary.tsx index 327e81d397..8f8e37c3e2 100644 --- a/app/components/Form/ProjectMilestoneReportFormSummary.tsx +++ b/app/components/Form/ProjectMilestoneReportFormSummary.tsx @@ -50,9 +50,6 @@ const ProjectMilestoneReportFormSummary: React.FC = ({ isPristine newFormData operation - formChangeByPreviousFormChangeId { - newFormData - } formByJsonSchemaName { jsonSchema } @@ -243,8 +240,6 @@ const ProjectMilestoneReportFormSummary: React.FC = ({ calculatedNetAmount: milestoneReport?.newFormData?.calculatedNetAmount, operation: milestoneReport.operation, - oldData: - milestoneReport.formChangeByPreviousFormChangeId?.newFormData, latestCommittedData, isAmendmentsAndOtherRevisionsSpecific: isOnAmendmentsAndOtherRevisionsPage, diff --git a/app/components/Form/ProjectQuarterlyReportFormSummary.tsx b/app/components/Form/ProjectQuarterlyReportFormSummary.tsx index fe2e9d27ae..c446beb80e 100644 --- a/app/components/Form/ProjectQuarterlyReportFormSummary.tsx +++ b/app/components/Form/ProjectQuarterlyReportFormSummary.tsx @@ -47,9 +47,6 @@ const ProjectQuarterlyReportFormSummary: React.FC = ({ isPristine newFormData operation - formChangeByPreviousFormChangeId { - newFormData - } formByJsonSchemaName { jsonSchema } @@ -169,8 +166,6 @@ const ProjectQuarterlyReportFormSummary: React.FC = ({ formData={formData} formContext={{ operation: quarterlyReport.operation, - oldData: - quarterlyReport.formChangeByPreviousFormChangeId?.newFormData, latestCommittedData, isAmendmentsAndOtherRevisionsSpecific: isOnAmendmentsAndOtherRevisionsPage, diff --git a/app/components/Form/ProjectSummaryReportFormSummary.tsx b/app/components/Form/ProjectSummaryReportFormSummary.tsx index 31cbc5139a..56f7c2778d 100644 --- a/app/components/Form/ProjectSummaryReportFormSummary.tsx +++ b/app/components/Form/ProjectSummaryReportFormSummary.tsx @@ -56,9 +56,6 @@ const ProjectSummaryReportFormSummary: React.FC = ({ node { newFormData operation - formChangeByPreviousFormChangeId { - newFormData - } } } } @@ -153,8 +150,6 @@ const ProjectSummaryReportFormSummary: React.FC = ({ uiSchema={projectSummaryReportUiSchema} formContext={{ operation: projectSummaryReport.operation, - oldData: - projectSummaryReport.formChangeByPreviousFormChangeId?.newFormData, latestCommittedData: latestCommittedProjectSummaryFormChanges?.edges[0]?.node ?.newFormData,