Skip to content

Commit

Permalink
chore: compliance summary
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Jan 16, 2025
1 parent b50e25b commit 529a8f3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { withTheme } from "@rjsf/core";
import { customizeValidator } from "@rjsf/validator-ajv8";
import finalReviewTheme from "./formCustomization/finalReviewTheme";
import { additionalReportingDataUiSchema } from "@reporting/src/data/jsonSchema/additionalReportingData/additionalReportingData";
import { complianceSummaryUiSchema } from "@reporting/src/data/jsonSchema/complianceSummary";

interface Props extends HasReportVersion {
taskListElements: TaskListElement[];
Expand All @@ -27,6 +28,7 @@ const finalReviewSchemaMap: { [key: string]: any } = {
productionData: productionDataUiSchema,
emissionAllocation: emissionAllocationUiSchema,
additionalReportingData: additionalReportingDataUiSchema,
complianceSummary: complianceSummaryUiSchema,
};

const resolveUiSchema = (uiSchema: any) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { complianceSummarySchema } from "@reporting/src/data/jsonSchema/complianceSummary";
import { ReviewDataFactoryItem } from "./factory";
import { getComplianceData } from "@reporting/src/app/utils/getComplianceData";

const complianceSummaryFactoryItem: ReviewDataFactoryItem = async (
versionId,
) => {
const complianceData = await getComplianceData(versionId);

return [
{
schema: complianceSummarySchema,
data: complianceData,
uiSchema: "complianceSummary",
},
];
};

export default complianceSummaryFactoryItem;
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import operationReviewFactoryItem from "./operationReviewFactoryItem";
import personResponsibleFactoryItem from "./personResponsibleFactoryItem";
import emissionsSummaryFactoryItem from "./emissionsSummaryFactoryItem";
import productionDataFactoryItem from "./productionDataFactoryItem";
import allocationOfEmissionsFactoryItem from "./allocationOfEmissions";
import allocationOfEmissionsFactoryItem from "./allocationOfEmissionsFactoryItem";
import { RJSFSchema } from "@rjsf/utils";
import additionalReportingDataFactoryItem from "./additionalReportingData";
import additionalReportingDataFactoryItem from "./additionalReportingDataFactoryItem";
import complianceSummaryFactoryItem from "./complianceSummaryFactoryItem";

export type ReviewData = {
schema: RJSFSchema;
Expand All @@ -34,5 +35,6 @@ export default async function reviewDataFactory(
...(await productionDataFactoryItem(versionId, facilityId)),
...(await allocationOfEmissionsFactoryItem(versionId, facilityId)),
...(await additionalReportingDataFactoryItem(versionId, facilityId)),
...(await complianceSummaryFactoryItem(versionId, facilityId)),
];
}

0 comments on commit 529a8f3

Please sign in to comment.