From 292b4a3ca2ef1cf43aa2aedcdff094e966066977 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 9 Jun 2023 11:33:38 -0700 Subject: [PATCH 01/29] chore: change default tooltip icon to faInfoCircle --- app/lib/theme/widgets/ContextualHelp.tsx | 8 ++++---- app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/lib/theme/widgets/ContextualHelp.tsx b/app/lib/theme/widgets/ContextualHelp.tsx index 513f6627c7..0ef62d30c1 100644 --- a/app/lib/theme/widgets/ContextualHelp.tsx +++ b/app/lib/theme/widgets/ContextualHelp.tsx @@ -1,5 +1,5 @@ import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; -import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; +import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Tooltip from "@mui/material/Tooltip"; import { BC_GOV_LINKS_COLOR, DARK_GREY_BG_COLOR } from "../colors"; @@ -7,7 +7,7 @@ import parse from "html-react-parser"; /** * @param {string} text - The text of the tooltip to be displayed (can be HTML) - * @param {IconDefinition} icon - The icon to display in the tooltip; defaults to faExclamationCircle + * @param {IconDefinition} icon - The icon to display in the tooltip; defaults to faInfoCircle * @param {string} placement - The placement of the tooltip; defaults to "top" * @param {string} label - The label of the tooltip to be used as the aria-labelledby attribute; this gets passed by the parent component(FieldLabel) * @returns {ReactElement} - The tooltip component @@ -15,7 +15,7 @@ import parse from "html-react-parser"; * Example: * "ui:tooltip": { * "text": "
Some content here with Links and other HTML tags
", - * "icon": faExclamationCircle, + * "icon": faInfoCircle, * "placement": "top" * } * NOTE: we are using html-react-parser package to parse the text of the tooltip to allow for HTML tags and avoid using dangerouslySetInnerHTML @@ -42,7 +42,7 @@ interface ContextualHelpProps { const ContextualHelp: React.FC = ({ text, - icon = faExclamationCircle, + icon = faInfoCircle, placement = "bottom", label, }) => { diff --git a/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx b/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx index 42efcbc9a4..3b3f7f8704 100644 --- a/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx +++ b/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, render, screen, waitFor } from "@testing-library/react"; -import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons"; +import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; import ContextualHelp from "lib/theme/widgets/ContextualHelp"; describe("ContextualHelp component", () => { @@ -8,11 +8,7 @@ describe("ContextualHelp component", () => { test("renders the tooltip with correct text and label and matches the snapshot", () => { const componentUnderTest = render( - + ); const tooltipElement = screen.getByRole("tooltip"); const tooltipIcon = screen.getByRole("img", { From ea0646cc639afe722e6e4552cf5812ab96718156 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 9 Jun 2023 12:17:37 -0700 Subject: [PATCH 02/29] chore: fix uneven spacing when tooltip contained
    --- app/lib/theme/widgets/ContextualHelp.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/lib/theme/widgets/ContextualHelp.tsx b/app/lib/theme/widgets/ContextualHelp.tsx index 0ef62d30c1..869a24caf8 100644 --- a/app/lib/theme/widgets/ContextualHelp.tsx +++ b/app/lib/theme/widgets/ContextualHelp.tsx @@ -83,6 +83,12 @@ const ContextualHelp: React.FC = ({ :global(.MuiTooltip-tooltip a) { color: ${BC_GOV_LINKS_COLOR}; } + :global(.MuiTooltip-tooltip ul) { + margin-bottom: 0; /* Remove the default bottom margin for lists */ + } + :global(.MuiTooltip-tooltip li) { + margin: 0; /* Remove the default margin between list items */ + } `} ); From 7a5ade89c3d3b41aeab6babd8ddc02731ec20531 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 9 Jun 2023 12:18:12 -0700 Subject: [PATCH 03/29] chore: add tooltips for Budgets, Expenses & Payments --- .../fundingParameterEPUiSchema.ts | 33 +++++++++++++++++++ .../fundingParameterIAUiSchema.ts | 18 ++++++++++ 2 files changed, 51 insertions(+) diff --git a/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts b/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts index 3749aeb109..a668bd0554 100644 --- a/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts +++ b/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts @@ -21,26 +21,41 @@ export const fundingParameterEPUiSchema = { ], totalProjectValue: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    Total Project Value = Maximum Funding Amount + Proponent Cost + Additional Funding Amount (Source 1) + Additional Funding Amount (Source 2) + ... + Additional Funding amount (Source N).
    ", + }, isMoney: true, hideOptional: true, calculatedValueFormContextProperty: "calculatedTotalProjectValue", }, maxFundingAmount: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    The maximum payment amount that the proponent can receive from CIF.
    ", + }, isMoney: true, }, provinceSharePercentage: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    Typically, 50% at most.
    ", + }, isPercentage: true, numberOfDecimalPlaces: 2, }, holdbackPercentage: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    • Typically, 10%.
    • 2019 projects may have percentages higher than 10%.
    ", + }, isPercentage: true, numberOfDecimalPlaces: 2, }, proponentsSharePercentage: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    • Proponent's share percentage = Proponent Cost / Total Project Value
    • The Proponent's Share Percentage should be NO LESS than 25%.
    • For 2021 projects, the Proponent's Share Percentage should be NO LESS than 25%.
    ", + }, numberOfDecimalPlaces: 2, isPercentage: true, calculatedValueFormContextProperty: "calculatedProponentsSharePercentage", @@ -68,6 +83,9 @@ export const fundingParameterEPUiSchema = { }, proponentCost: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    The amount of expenses paid by the proponent.
    ", + }, isMoney: true, }, contractStartDate: { @@ -78,24 +96,36 @@ export const fundingParameterEPUiSchema = { }, eligibleExpensesToDate: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    The accumulated Total Eligible Expenses from all completed Milestone Reports.
    ", + }, calculatedValueFormContextProperty: "calculatedEligibleExpensesToDate", hideOptional: true, isMoney: true, }, grossPaymentsToDate: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    • The accumulated Gross Payment Amounts from all completed Milestone Reports.
    • The Total Gross Payment Amoun To Date should be NO GREATER than the Maximum Funding Amount.
    ", + }, calculatedValueFormContextProperty: "calculatedGrossPaymentsToDate", hideOptional: true, isMoney: true, }, holdbackAmountToDate: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    The accumulated Holdback Payment Amounts from all completed Milestone Reports.
    ", + }, calculatedValueFormContextProperty: "calculatedHoldbackAmountToDate", hideOptional: true, isMoney: true, }, netPaymentsToDate: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    The accumulated Net Payment Amounts from all completed Milestone Reports.
    ", + }, calculatedValueFormContextProperty: "calculatedNetPaymentsToDate", hideOptional: true, isMoney: true, @@ -111,6 +141,9 @@ export const fundingParameterEPUiSchema = { amount: { "ui:title": `Additional Funding Amount`, "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder of the LAN).
    ", + }, isMoney: true, }, status: { diff --git a/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts b/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts index 026caed824..bd8be26e88 100644 --- a/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts +++ b/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts @@ -17,21 +17,33 @@ export const fundingParameterIAUiSchema = { ], totalProjectValue: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    Total Project Value = Maximum Funding Amount + Proponent Cost + Additional Funding Amount (Source 1) + Additional Funding Amount (Source 2) + ... + Additional Funding amount (Source N).
    ", + }, isMoney: true, hideOptional: true, calculatedValueFormContextProperty: "calculatedTotalProjectValue", }, maxFundingAmount: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    The maximum payment amount that the proponent can receive from CIF.
    ", + }, isMoney: true, }, provinceSharePercentage: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    Typically, 50% at most.
    ", + }, isPercentage: true, numberOfDecimalPlaces: 2, }, proponentsSharePercentage: { "ui:widget": "CalculatedValueWidget", + "ui:tooltip": { + text: "
    • Proponent's share percentage = Proponent Cost / Total Project Value
    • The Proponent's Share Percentage should be NO LESS than 25%.
    • For 2021 projects, the Proponent's Share Percentage should be NO LESS than 25%.
    ", + }, numberOfDecimalPlaces: 2, isPercentage: true, calculatedValueFormContextProperty: "calculatedProponentsSharePercentage", @@ -59,6 +71,9 @@ export const fundingParameterIAUiSchema = { }, proponentCost: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    The amount of expenses paid by the proponent.
    ", + }, isMoney: true, }, contractStartDate: { @@ -85,6 +100,9 @@ export const fundingParameterIAUiSchema = { amount: { "ui:title": `Additional Funding Amount`, "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder of the LAN).
    ", + }, isMoney: true, }, status: { From ad83989ecf0796c5ef1416c955c87072fd4f230a Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 9 Jun 2023 12:35:04 -0700 Subject: [PATCH 04/29] chore: create tooltips for Milestone Reports --- .../jsonSchemaForm/projectMilestoneUiSchema.ts | 15 +++++++++++++++ .../widgets/AdjustableCalculatedValueWidget.tsx | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts b/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts index 612de5ce5f..a8f411ec09 100644 --- a/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts +++ b/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts @@ -55,12 +55,18 @@ const projectMilestoneUiSchema = { }, maximumAmount: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    • The maximum paymen amount that the proponent can receive from CIF for this milestone.
    • Typically found in schedule D.
    ", + }, isMoney: true, "ui:col-md": 12, "bcgov:size": "small", }, totalEligibleExpenses: { "ui:widget": "NumberWidget", + "ui:tooltip": { + text: "
    The amount of total eligible expenses paid by the proponent for this milestone.
    ", + }, isMoney: true, "ui:col-md": 12, "bcgov:size": "small", @@ -76,18 +82,27 @@ const projectMilestoneUiSchema = { }, adjustedGrossAmount: { "ui:widget": "AdjustableCalculatedValueWidget", + "ui:tooltip": { + text: "
    • Gross Payment Amount This Milestone = Total Eligible Expenses This Milestone x Province's Share Percentage.
    • The Gross Payment Amount This Milestone is the smaller value between the calculated value above and the Maximum Milestone Payment Amount This Milestone.
    ", + }, isMoney: true, hideOptional: true, calculatedValueFormContextProperty: "calculatedGrossAmount", }, adjustedNetAmount: { "ui:widget": "AdjustableCalculatedValueWidget", + "ui:tooltip": { + text: "
    Net Payment Amount This Milestone = Gross Payment Amount This Milestone - Holdback Payment Amount This Milestone.
    ", + }, isMoney: true, hideOptional: true, calculatedValueFormContextProperty: "calculatedNetAmount", }, adjustedHoldbackAmount: { "ui:widget": "AdjustableCalculatedValueWidget", + "ui:tooltip": { + text: "
    Holdback Payment Amount This Milestone = Gross Payment Amount This Milestone x Performance Milestone Holdback Percentage.
    ", + }, isMoney: true, hideOptional: true, calculatedValueFormContextProperty: "calculatedHoldbackAmount", diff --git a/app/lib/theme/widgets/AdjustableCalculatedValueWidget.tsx b/app/lib/theme/widgets/AdjustableCalculatedValueWidget.tsx index caf43fbaef..ef86b3caea 100644 --- a/app/lib/theme/widgets/AdjustableCalculatedValueWidget.tsx +++ b/app/lib/theme/widgets/AdjustableCalculatedValueWidget.tsx @@ -1,6 +1,7 @@ import { WidgetProps } from "@rjsf/core"; import NumberFormat from "react-number-format"; import CalculatedValueWidget from "./CalculatedValueWidget"; +import ContextualHelp from "./ContextualHelp"; export const AdjustableCalculatedValueWidget: React.FC = ( props @@ -27,6 +28,10 @@ export const AdjustableCalculatedValueWidget: React.FC = ( }} > + Date: Fri, 9 Jun 2023 13:36:55 -0700 Subject: [PATCH 05/29] chore: create tooltip test for calculated value widget --- .../AdjustableCalculatedValueWidget.test.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/tests/unit/lib/theme/widgets/AdjustableCalculatedValueWidget.test.tsx b/app/tests/unit/lib/theme/widgets/AdjustableCalculatedValueWidget.test.tsx index f5c18343c4..f9f7d9754d 100644 --- a/app/tests/unit/lib/theme/widgets/AdjustableCalculatedValueWidget.test.tsx +++ b/app/tests/unit/lib/theme/widgets/AdjustableCalculatedValueWidget.test.tsx @@ -1,4 +1,4 @@ -import { render, screen } from "@testing-library/react"; +import { fireEvent, render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { AdjustableCalculatedValueWidget } from "lib/theme/widgets/AdjustableCalculatedValueWidget"; @@ -70,4 +70,23 @@ describe("The AdjustableCalculatedValueWidget", () => { expect(props.onChange).toHaveBeenLastCalledWith(undefined); }); + + it("renders the help tooltip", () => { + const props: any = { + uiSchema: { isMoney: true, calculatedValueFormContextProperty: "myProp" }, + schema: { type: "number", title: "Test Label", default: undefined }, + id: "test-id", + label: "Test Label", + onChange: jest.fn(), + value: "1", + formContext: { myProp: "100" }, + }; + render(); + + const helpIcon = screen.getByLabelText("test-label-(adjusted)-tooltip"); + expect(helpIcon).toBeInTheDocument(); + + fireEvent.mouseOver(helpIcon); + expect(screen.getByRole("tooltip")).toBeInTheDocument(); + }); }); From dfcc5f808e604d634d0434127235734856aecd0c Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Tue, 13 Jun 2023 16:28:39 -0700 Subject: [PATCH 06/29] chore: update tests to match new default icon --- app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx | 2 +- .../widgets/__snapshots__/ContextualHelp.test.tsx.snap | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx b/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx index 3b3f7f8704..369290bb9a 100644 --- a/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx +++ b/app/tests/unit/lib/theme/widgets/ContextualHelp.test.tsx @@ -27,7 +27,7 @@ describe("ContextualHelp component", () => { const defaultIcon = screen.getByRole("img", { hidden: true, }); - expect(defaultIcon).toHaveAttribute("data-icon", "exclamation-circle"); + expect(defaultIcon).toHaveAttribute("data-icon", "info-circle"); }); test("renders the tooltip with correct HTML text", async () => { const htmlText = diff --git a/app/tests/unit/lib/theme/widgets/__snapshots__/ContextualHelp.test.tsx.snap b/app/tests/unit/lib/theme/widgets/__snapshots__/ContextualHelp.test.tsx.snap index 6d69683287..54e326c18a 100644 --- a/app/tests/unit/lib/theme/widgets/__snapshots__/ContextualHelp.test.tsx.snap +++ b/app/tests/unit/lib/theme/widgets/__snapshots__/ContextualHelp.test.tsx.snap @@ -4,16 +4,16 @@ exports[`ContextualHelp component renders the tooltip with correct text and labe
    From ed85c12ac0979e2625922f7c4814b7ec2b94ba02 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Tue, 13 Jun 2023 16:43:15 -0700 Subject: [PATCH 07/29] chore: typo fix --- app/data/jsonSchemaForm/projectMilestoneUiSchema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts b/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts index a8f411ec09..66a1e7d640 100644 --- a/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts +++ b/app/data/jsonSchemaForm/projectMilestoneUiSchema.ts @@ -56,7 +56,7 @@ const projectMilestoneUiSchema = { maximumAmount: { "ui:widget": "NumberWidget", "ui:tooltip": { - text: "
    • The maximum paymen amount that the proponent can receive from CIF for this milestone.
    • Typically found in schedule D.
    ", + text: "
    • The maximum payment amount that the proponent can receive from CIF for this milestone.
    • Typically found in schedule D.
    ", }, isMoney: true, "ui:col-md": 12, From 4f5391248d8e8761bb62ebac1ec715e15fac76dd Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Wed, 14 Jun 2023 17:16:37 -0700 Subject: [PATCH 08/29] chore: implement basic tests --- .../Form/ProjectMilestoneReportForm.test.tsx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx b/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx index aa3574969c..26f941cd82 100644 --- a/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx @@ -586,4 +586,34 @@ describe("The ProjectMilestoneReportForm", () => { ) ).toHaveLength(3); }); + + it("renders the maximum amount this milestone tooltip button and text", async () => { + componentTestingHelper.loadQuery(); + componentTestingHelper.renderComponent(); + + const tooltipButton = screen.getAllByLabelText( + "maximum-amount-this-milestone-tooltip" + ); + + expect(tooltipButton).toBeArray(); + expect(tooltipButton).toHaveLength(2); + // expect(tooltipButton).toBeInTheDocument(); + // expect(tooltipButton).toHaveAttribute( + // "aria-label", + // "maximum-amount-this-milestone-tooltip" + // ); + + // fireEvent.mouseOver(tooltipButton); + // await waitFor(() => { + // expect( + // screen.getByTestId("maximum-amount-this-milestone-tooltip-text") + // ).toBeInTheDocument(); + // expect( + // screen.getByTestId("maximum-amount-this-milestone-tooltip-text") + // .innerHTML + // ).toBe( + // "
    • The maximum payment amount that the proponent can receive from CIF for this milestone.
    • Typically found in schedule D.
    " + // ); + // }); + }); }); From 3752441282deb37b885d8df50b522063d7f2aa0d Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Thu, 22 Jun 2023 12:44:11 -0700 Subject: [PATCH 09/29] chore: add EI report form tests --- ...rojectEmissionIntensityReportForm.test.tsx | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx index f85f0240aa..8a41529e18 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx @@ -425,4 +425,41 @@ describe("the emission intensity report form component", () => { } ); }); + + it("renders the help tooltips for the Upon Completion form", () => { + // Note the exclusion of the GHG Emission Intensity Performance (Adjusted) field here + // This is captured in AdjustableCalculatedValueWidget.test.tsx + componentTestingHelper.loadQuery(); + componentTestingHelper.renderComponent(); + + const GHGEmissionIntensityPerformanceTooltip = screen.getByRole("tooltip", { + name: "ghg-emission-intensity-performance-tooltip", + }); + + const paymentPercentageOfPerformanceMilestoneAmountTooltip = + screen.getByRole("tooltip", { + name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", + }); + + const maximumPerformanceMilestoneAmountTooltip = screen.getByRole( + "tooltip", + { + name: "maximum-performance-milestone-amount-tooltip", + } + ); + + const actualPerformanceMilestoneAmountTooltip = screen.getByRole( + "tooltip", + { + name: "actual-performance-milestone-amount-tooltip", + } + ); + + expect(GHGEmissionIntensityPerformanceTooltip).toBeInTheDocument(); + expect( + paymentPercentageOfPerformanceMilestoneAmountTooltip + ).toBeInTheDocument(); + expect(maximumPerformanceMilestoneAmountTooltip).toBeInTheDocument(); + expect(actualPerformanceMilestoneAmountTooltip).toBeInTheDocument(); + }); }); From 9c6effbd1aca7ef281405c073d15fe411a39cf4b Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Thu, 22 Jun 2023 13:12:02 -0700 Subject: [PATCH 10/29] chore: clean up EI test, add EI summary tests --- ...rojectEmissionIntensityReportForm.test.tsx | 39 ++++++-------- ...missionIntensityReportFormSummary.test.tsx | 52 +++++++++++++++++++ 2 files changed, 67 insertions(+), 24 deletions(-) diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx index 8a41529e18..8b68170550 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx @@ -432,34 +432,25 @@ describe("the emission intensity report form component", () => { componentTestingHelper.loadQuery(); componentTestingHelper.renderComponent(); - const GHGEmissionIntensityPerformanceTooltip = screen.getByRole("tooltip", { - name: "ghg-emission-intensity-performance-tooltip", - }); - - const paymentPercentageOfPerformanceMilestoneAmountTooltip = + expect( + screen.getByRole("tooltip", { + name: "ghg-emission-intensity-performance-tooltip", + }) + ).toBeInTheDocument(); + expect( screen.getByRole("tooltip", { name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", - }); - - const maximumPerformanceMilestoneAmountTooltip = screen.getByRole( - "tooltip", - { + }) + ).toBeInTheDocument(); + expect( + screen.getByRole("tooltip", { name: "maximum-performance-milestone-amount-tooltip", - } - ); - - const actualPerformanceMilestoneAmountTooltip = screen.getByRole( - "tooltip", - { - name: "actual-performance-milestone-amount-tooltip", - } - ); - - expect(GHGEmissionIntensityPerformanceTooltip).toBeInTheDocument(); + }) + ).toBeInTheDocument(); expect( - paymentPercentageOfPerformanceMilestoneAmountTooltip + screen.getByRole("tooltip", { + name: "actual-performance-milestone-amount-tooltip", + }) ).toBeInTheDocument(); - expect(maximumPerformanceMilestoneAmountTooltip).toBeInTheDocument(); - expect(actualPerformanceMilestoneAmountTooltip).toBeInTheDocument(); }); }); diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx index c857d5241b..653bccc9a3 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx @@ -314,4 +314,56 @@ describe("the emission intensity report form component", () => { expect(screen.getByText(/\$789\.00/i)).toBeInTheDocument(); //old actualPerformanceMilestoneAmount expect(screen.getByText(/\$357\.00/i)).toBeInTheDocument(); //latest committed actualPerformanceMilestoneAmount }); + + it("renders the help tooltips", () => { + const customPayload = { + ProjectRevision() { + return { + isFirstRevision: true, + summaryEmissionIntensityReportFormChange: { + edges: [ + { + node: { + id: "mock-emission-intensity-report-form-change-id", + rowId: 4, + isPristine: true, + calculatedEiPerformance: 10, + paymentPercentage: 40, + holdbackAmountToDate: 123, + actualPerformanceMilestoneAmount: null, + operation: "CREATE", + }, + }, + ], + }, + }; + }, + }; + componentTestingHelper.loadQuery(customPayload); + componentTestingHelper.renderComponent(); + + // Note the exclusion of the GHG Emission Intensity Performance (Adjusted) field here + // This is captured in AdjustableCalculatedValueWidget.test.tsx + + expect( + screen.getByRole("tooltip", { + name: "ghg-emission-intensity-performance-tooltip", + }) + ).toBeInTheDocument(); + expect( + screen.getByRole("tooltip", { + name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", + }) + ).toBeInTheDocument(); + expect( + screen.getByRole("tooltip", { + name: "maximum-performance-milestone-amount-tooltip", + }) + ).toBeInTheDocument(); + expect( + screen.getByRole("tooltip", { + name: "actual-performance-milestone-amount-tooltip", + }) + ).toBeInTheDocument(); + }); }); From 3a0c2d9753b6900492b66fad001e93f4a893e01f Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Thu, 22 Jun 2023 13:49:52 -0700 Subject: [PATCH 11/29] chore: create milestone report form tests, update EI tests --- ...rojectEmissionIntensityReportForm.test.tsx | 8 +-- ...missionIntensityReportFormSummary.test.tsx | 8 +-- .../Form/ProjectMilestoneReportForm.test.tsx | 55 +++++++++---------- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx index 8b68170550..c71045eccd 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx @@ -434,22 +434,22 @@ describe("the emission intensity report form component", () => { expect( screen.getByRole("tooltip", { - name: "ghg-emission-intensity-performance-tooltip", + name: /ghg-emission-intensity-performance-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", + name: /payment-percentage-of-performance-milestone-amount-(%)-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "maximum-performance-milestone-amount-tooltip", + name: /maximum-performance-milestone-amount-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "actual-performance-milestone-amount-tooltip", + name: /actual-performance-milestone-amount-tooltip/, }) ).toBeInTheDocument(); }); diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx index 653bccc9a3..e7f3e1c7ab 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx @@ -347,22 +347,22 @@ describe("the emission intensity report form component", () => { expect( screen.getByRole("tooltip", { - name: "ghg-emission-intensity-performance-tooltip", + name: /ghg-emission-intensity-performance-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", + name: /payment-percentage-of-performance-milestone-amount-(%)-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "maximum-performance-milestone-amount-tooltip", + name: /maximum-performance-milestone-amount-tooltip/, }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: "actual-performance-milestone-amount-tooltip", + name: /actual-performance-milestone-amount-tooltip/, }) ).toBeInTheDocument(); }); diff --git a/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx b/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx index 26f941cd82..3cc91b5b34 100644 --- a/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectMilestoneReportForm.test.tsx @@ -234,6 +234,31 @@ describe("The ProjectMilestoneReportForm", () => { expect(screen.getAllByText("Remove")).toHaveLength(4); }); + it("renders the tooltips for the mock form", () => { + componentTestingHelper.loadQuery(); + componentTestingHelper.renderComponent(); + + expect( + screen.getAllByLabelText(/maximum-amount-this-milestone-tooltip/) + ).toHaveLength(2); + + expect( + screen.getAllByLabelText(/total-eligible-expenses-tooltip/) + ).toHaveLength(1); + + expect( + screen.getAllByLabelText(/gross-payment-amount-this-milestone-tooltip/) + ).toHaveLength(2); + + expect( + screen.getAllByLabelText(/net-payment-amount-this-milestone-tooltip/) + ).toHaveLength(2); + + expect( + screen.getAllByLabelText(/holdback-amount-this-milestone-tooltip/) + ).toHaveLength(2); + }); + it("Calls the createMilestoneMutation mutation when the Add button is clicked", () => { componentTestingHelper.loadQuery(); componentTestingHelper.renderComponent(); @@ -586,34 +611,4 @@ describe("The ProjectMilestoneReportForm", () => { ) ).toHaveLength(3); }); - - it("renders the maximum amount this milestone tooltip button and text", async () => { - componentTestingHelper.loadQuery(); - componentTestingHelper.renderComponent(); - - const tooltipButton = screen.getAllByLabelText( - "maximum-amount-this-milestone-tooltip" - ); - - expect(tooltipButton).toBeArray(); - expect(tooltipButton).toHaveLength(2); - // expect(tooltipButton).toBeInTheDocument(); - // expect(tooltipButton).toHaveAttribute( - // "aria-label", - // "maximum-amount-this-milestone-tooltip" - // ); - - // fireEvent.mouseOver(tooltipButton); - // await waitFor(() => { - // expect( - // screen.getByTestId("maximum-amount-this-milestone-tooltip-text") - // ).toBeInTheDocument(); - // expect( - // screen.getByTestId("maximum-amount-this-milestone-tooltip-text") - // .innerHTML - // ).toBe( - // "
    • The maximum payment amount that the proponent can receive from CIF for this milestone.
    • Typically found in schedule D.
    " - // ); - // }); - }); }); From 9f6cc266052a5d4ea6f6cbb88ba34bae108bc373 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Thu, 22 Jun 2023 13:50:50 -0700 Subject: [PATCH 12/29] chore: revert changes to EI forms --- .../Form/ProjectEmissionIntensityReportForm.test.tsx | 8 ++++---- .../ProjectEmissionIntensityReportFormSummary.test.tsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx index c71045eccd..8b68170550 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportForm.test.tsx @@ -434,22 +434,22 @@ describe("the emission intensity report form component", () => { expect( screen.getByRole("tooltip", { - name: /ghg-emission-intensity-performance-tooltip/, + name: "ghg-emission-intensity-performance-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /payment-percentage-of-performance-milestone-amount-(%)-tooltip/, + name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /maximum-performance-milestone-amount-tooltip/, + name: "maximum-performance-milestone-amount-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /actual-performance-milestone-amount-tooltip/, + name: "actual-performance-milestone-amount-tooltip", }) ).toBeInTheDocument(); }); diff --git a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx index e7f3e1c7ab..653bccc9a3 100644 --- a/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectEmissionIntensityReportFormSummary.test.tsx @@ -347,22 +347,22 @@ describe("the emission intensity report form component", () => { expect( screen.getByRole("tooltip", { - name: /ghg-emission-intensity-performance-tooltip/, + name: "ghg-emission-intensity-performance-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /payment-percentage-of-performance-milestone-amount-(%)-tooltip/, + name: "payment-percentage-of-performance-milestone-amount-(%)-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /maximum-performance-milestone-amount-tooltip/, + name: "maximum-performance-milestone-amount-tooltip", }) ).toBeInTheDocument(); expect( screen.getByRole("tooltip", { - name: /actual-performance-milestone-amount-tooltip/, + name: "actual-performance-milestone-amount-tooltip", }) ).toBeInTheDocument(); }); From 9ec73ee0a78630831a779507c992ded9124533dc Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Tue, 27 Jun 2023 13:19:42 -0700 Subject: [PATCH 13/29] chore: create milestone summary tests for tooltips --- ...ProjectMilestoneReportFormSummary.test.tsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx index d447499a7a..331e97e370 100644 --- a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx @@ -372,4 +372,39 @@ describe("The Project Milestone Report Form Summary", () => { expect(screen.getByText(/\$21\.00/i)).toBeInTheDocument(); expect(screen.getByText(/\$11\.00/i)).toBeInTheDocument(); }); + + it("renders the tooltips for the mock summary", () => { + componentTestingHelper.loadQuery(); + componentTestingHelper.renderComponent(); + + expect( + screen.getAllByRole("tooltip", { + name: "maximum-amount-this-milestone-tooltip", + }) + ).toHaveLength(2); + + expect( + screen.getAllByRole("tooltip", { + name: "total-eligible-expenses-tooltip", + }) + ).toHaveLength(2); + + expect( + screen.getAllByRole("tooltip", { + name: "gross-payment-amount-this-milestone-tooltip", + }) + ).toHaveLength(2); + + expect( + screen.getAllByRole("tooltip", { + name: "net-payment-amount-this-milestone-tooltip", + }) + ).toHaveLength(2); + + expect( + screen.getAllByRole("tooltip", { + name: "holdback-amount-this-milestone-tooltip", + }) + ).toHaveLength(2); + }); }); From 20823ab686d7cd8278605227455d00be76f4b28a Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Wed, 28 Jun 2023 19:27:50 -0700 Subject: [PATCH 14/29] chore: create milestone summary tests for tooltips --- ...ProjectMilestoneReportFormSummary.test.tsx | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx index 331e97e370..f80e0baef0 100644 --- a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx @@ -41,6 +41,7 @@ const mockQueryPayload = { reportDueDate: "2020-01-10T23:59:59.999-07:00", reportingRequirementId: 1, hasExpenses: true, + maximumAmount: 123, calculatedNetAmount: 111, calculatedGrossAmount: 999, calculatedHoldbackAmount: 888, @@ -374,37 +375,75 @@ describe("The Project Milestone Report Form Summary", () => { }); it("renders the tooltips for the mock summary", () => { - componentTestingHelper.loadQuery(); + const mockTooltipPayload = { + Form() { + return { + jsonSchema: milestoneProdSchema, + }; + }, + ProjectRevision() { + const result = { + isFirstRevision: true, + summaryMilestoneFormChanges: { + edges: [ + { + node: { + id: "Tooltip Test 1", + isPristine: null, + formChangeByPreviousFormChangeId: null, + newFormData: { + calculatedGrossAmount: 123, + calculatedHoldbackAmount: 456, + calculatedNetAmount: 789, + certifierProfessionalDesignation: "Professional Engineer", + hasExpenses: true, + maximumAmount: 23, + reportType: "General Milestone", + totalEligibleExpenses: 1000, + adjustedGrossAmount: 1000, + reportingRequirementIndex: 1, + }, + operation: "CREATE", + }, + }, + ], + }, + }; + return result; + }, + }; + componentTestingHelper.loadQuery(mockTooltipPayload); componentTestingHelper.renderComponent(); + screen.logTestingPlaygroundURL(); expect( screen.getAllByRole("tooltip", { name: "maximum-amount-this-milestone-tooltip", }) - ).toHaveLength(2); + ).toHaveLength(1); expect( screen.getAllByRole("tooltip", { name: "total-eligible-expenses-tooltip", }) - ).toHaveLength(2); + ).toHaveLength(1); expect( screen.getAllByRole("tooltip", { name: "gross-payment-amount-this-milestone-tooltip", }) - ).toHaveLength(2); + ).toHaveLength(1); expect( screen.getAllByRole("tooltip", { name: "net-payment-amount-this-milestone-tooltip", }) - ).toHaveLength(2); + ).toHaveLength(1); expect( screen.getAllByRole("tooltip", { name: "holdback-amount-this-milestone-tooltip", }) - ).toHaveLength(2); + ).toHaveLength(1); }); }); From 23cd8bc137ec9ed3160f7c8e8a2359c3c1885b0e Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Wed, 28 Jun 2023 19:30:15 -0700 Subject: [PATCH 15/29] chore: remove unnecessary function --- .../components/Form/ProjectMilestoneReportFormSummary.test.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx index f80e0baef0..ee92424cce 100644 --- a/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx +++ b/app/tests/unit/components/Form/ProjectMilestoneReportFormSummary.test.tsx @@ -414,7 +414,6 @@ describe("The Project Milestone Report Form Summary", () => { }; componentTestingHelper.loadQuery(mockTooltipPayload); componentTestingHelper.renderComponent(); - screen.logTestingPlaygroundURL(); expect( screen.getAllByRole("tooltip", { From 8319d3158786890e35a6e8462ab268398b83e17f Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 30 Jun 2023 14:05:50 -0700 Subject: [PATCH 16/29] feat: move EI tooltips to UI schema --- .../projectEmissionIntensitySchema.ts | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 app/data/jsonSchemaForm/projectEmissionIntensitySchema.ts diff --git a/app/data/jsonSchemaForm/projectEmissionIntensitySchema.ts b/app/data/jsonSchemaForm/projectEmissionIntensitySchema.ts new file mode 100644 index 0000000000..c8e0254d34 --- /dev/null +++ b/app/data/jsonSchemaForm/projectEmissionIntensitySchema.ts @@ -0,0 +1,205 @@ +export const emissionIntensityReportSchema = { + $schema: "http://json-schema.org/draft-07/schema", + type: "object", + title: "Emissions Intensity Report", + properties: { + teimpReporting: { + type: "object", + title: "TEIMP Reporting", + required: [ + "measurementPeriodStartDate", + "measurementPeriodEndDate", + "emissionFunctionalUnit", + "baselineEmissionIntensity", + "targetEmissionIntensity", + ], + properties: { + measurementPeriodStartDate: { + title: "TEIMP Start Date", + type: "string", + }, + measurementPeriodEndDate: { + title: "TEIMP End Date", + type: "string", + }, + emissionFunctionalUnit: { + title: "Functional Unit", + type: "string", + }, + productionFunctionalUnit: { + title: "Production Functional Unit", + type: "string", + }, + baselineEmissionIntensity: { + title: "Baseline Emission Intensity (BEI)", + type: "number", + }, + targetEmissionIntensity: { + title: "Target Emission Intensity (TEI)", + type: "number", + }, + postProjectEmissionIntensity: { + title: "Post-Project Emission Intensity (PEI)", + type: "number", + }, + totalLifetimeEmissionReduction: { + title: "Total Project Lifetime Emissions Reductions", + type: "number", + }, + }, + }, + uponCompletion: { + type: "object", + title: "Upon Completion", + properties: { + adjustedEmissionsIntensityPerformance: { + title: "GHG Emission Intensity Performance", + type: "number", + "ui:tooltip": { + text: "
    GHG Emission Intensity Performance = (BEI - PEI) / (BEI - TEI) x 100
    ", + }, + }, + dateSentToCsnr: { + type: "string", + title: "Date Invoice Sent to CSNR", + default: undefined, + }, + paymentPercentage: { + type: "number", + title: "Payment Percentage of Performance Milestone Amount (%)", + default: undefined, + "ui:tooltip": { + text: "
    Payment Percentage of Performance Milestone Amount = 100 – ((-1.5) x GHG Emission Intensity Performance + 145)
    ", + }, + }, + holdbackAmountToDate: { + type: "number", + title: "Maximum Performance Milestone Amount", + default: undefined, + "ui:tooltip": { + text: "
    Maximum Performance Milestone Amount = Holdback Payment Amount (Milestone Report 1) + Holdback Payment Amount (Milestone Report 2) + ... + Holdback Payment Amount (Milestone Report N)
    ", + }, + }, + actualPerformanceMilestoneAmount: { + type: "number", + title: "Actual Performance Milestone Amount", + default: undefined, + "ui:tooltip": { + text: "
    Actual Performance Milestone Amount = Maximum Performance Milestone Amount x Payment Percentage of Performance Milestone Amount
    ", + }, + }, + }, + }, + }, +}; + +export const emissionIntensityReportingRequirementSchema = { + $schema: "http://json-schema.org/draft-07/schema", + type: "object", + title: "Reporting Requirement", + required: [], + properties: { + reportDueDate: { + type: "string", + title: "Report Due Date", + default: undefined, + }, + submittedDate: { + type: "string", + title: "Report Received Date", + default: undefined, + }, + comments: { + type: "string", + title: "General Comments", + }, + }, +}; + +export const emissionIntensityReportUiSchema = { + teimpReporting: { + emissionFunctionalUnit: { + "ui:widget": "TextWidget", + classNames: "functional-unit", + }, + productionFunctionalUnit: { + "ui:widget": "TextWidget", + classNames: "functional-unit", + }, + measurementPeriodStartDate: { + "ui:widget": "DateWidget", + }, + measurementPeriodEndDate: { + "ui:widget": "DateWidget", + }, + baselineEmissionIntensity: { + "ui:widget": "NumberWidget", + numberOfDecimalPlaces: 8, + }, + targetEmissionIntensity: { + "ui:widget": "NumberWidget", + numberOfDecimalPlaces: 8, + }, + postProjectEmissionIntensity: { + "ui:widget": "NumberWidget", + numberOfDecimalPlaces: 8, + }, + totalLifetimeEmissionReduction: { + "ui:widget": "NumberWidget", + numberOfDecimalPlaces: 8, + }, + }, + uponCompletion: { + adjustedEmissionsIntensityPerformance: { + "ui:widget": "AdjustableCalculatedValueWidget", + calculatedValueFormContextProperty: "calculatedEiPerformance", + isPercentage: true, + numberOfDecimalPlaces: 2, + hideOptional: true, + }, + calculatedPaymentPercentage: { + "ui:widget": "CalculatedValueWidget", + isPercentage: true, + numberOfDecimalPlaces: 2, + hideOptional: true, + calculatedValueFormContextProperty: "teimpPaymentPercentage", + }, + paymentPercentage: { + "ui:widget": "CalculatedValueWidget", + calculatedValueFormContextProperty: + "paymentPercentageOfPerformanceMilestoneAmount", + isPercentage: true, + hideOptional: true, + numberOfDecimalPlaces: 2, + }, + actualPerformanceMilestoneAmount: { + "ui:widget": "CalculatedValueWidget", + calculatedValueFormContextProperty: "actualPerformanceMilestoneAmount", + isMoney: true, + hideOptional: true, + }, + holdbackAmountToDate: { + "ui:widget": "CalculatedValueWidget", + calculatedValueFormContextProperty: "holdbackAmountToDate", + isMoney: true, + hideOptional: true, + }, + dateSentToCsnr: { + "ui:widget": "DateWidget", + }, + }, +}; + +export const emissionIntensityReportingRequirementUiSchema = { + reportDueDate: { + "ui:widget": "DateWidget", + isDueDate: true, + }, + submittedDate: { + "ui:widget": "DateWidget", + isReceivedDate: true, + }, + comments: { + "ui:widget": "TextAreaWidget", + }, +}; From c2d97d3525bd940c1ce61a2c1525cbf187265662 Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 30 Jun 2023 14:11:21 -0700 Subject: [PATCH 17/29] chore: tooltip typo fix --- app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts | 2 +- app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts b/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts index a668bd0554..23a3b48bc5 100644 --- a/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts +++ b/app/data/jsonSchemaForm/fundingParameterEPUiSchema.ts @@ -142,7 +142,7 @@ export const fundingParameterEPUiSchema = { "ui:title": `Additional Funding Amount`, "ui:widget": "NumberWidget", "ui:tooltip": { - text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder of the LAN).
    ", + text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder on the LAN).
    ", }, isMoney: true, }, diff --git a/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts b/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts index bd8be26e88..889c433006 100644 --- a/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts +++ b/app/data/jsonSchemaForm/fundingParameterIAUiSchema.ts @@ -101,7 +101,7 @@ export const fundingParameterIAUiSchema = { "ui:title": `Additional Funding Amount`, "ui:widget": "NumberWidget", "ui:tooltip": { - text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder of the LAN).
    ", + text: "
    • The amount of payment from Funding Source N other than CIF.
    • Typically found in the original proposal (solicitation folder on the LAN).
    ", }, isMoney: true, }, From 8bfe4bfd881604aa4fa49e22f24abc56575d29ad Mon Sep 17 00:00:00 2001 From: Sam Warren Date: Fri, 30 Jun 2023 14:21:58 -0700 Subject: [PATCH 18/29] chore: update spacing, font size, for tooltips --- app/lib/theme/widgets/ContextualHelp.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/lib/theme/widgets/ContextualHelp.tsx b/app/lib/theme/widgets/ContextualHelp.tsx index 869a24caf8..250dd39923 100644 --- a/app/lib/theme/widgets/ContextualHelp.tsx +++ b/app/lib/theme/widgets/ContextualHelp.tsx @@ -71,11 +71,13 @@ const ContextualHelp: React.FC = ({