diff --git a/src/index.js b/src/index.js index f746fa4..fe40ee5 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,7 @@ import { reducer } from "./reducer"; import { RIGHT_POLICY } from "./constants"; import { policyMutation } from "./utils/utils"; import PolicyRenewalsReport from "./reports/PolicyRenewalsReport"; +import PolicyPrimaryOperationalIndicatorsReport from "./reports/PolicyPrimaryOperationalIndicatorsReport"; const ROUTE_POLICY_POLICIES = "policy/policies"; const ROUTE_POLICY_POLICY = "policy/policy"; @@ -49,6 +50,18 @@ const DEFAULT_CONFIG = { return params; }, }, + { + key: "policy_primary_operational_indicators", + component: PolicyPrimaryOperationalIndicatorsReport, + isValid: (values) => (values) => values.yearMonth, + getParams: (values) => { + const params = {yearMonth: values.yearMonth} + if (values.location) { + params.locationId = decodeId(values.location.id); + } + return params; + }, + }, ], "refs": [ { key: "policy.PolicyOfficerPicker", ref: PolicyOfficerPicker }, diff --git a/src/reports/PolicyPrimaryOperationalIndicatorsReport.js b/src/reports/PolicyPrimaryOperationalIndicatorsReport.js new file mode 100644 index 0000000..6670d63 --- /dev/null +++ b/src/reports/PolicyPrimaryOperationalIndicatorsReport.js @@ -0,0 +1,39 @@ +import { Grid } from "@material-ui/core"; +import { PublishedComponent, useModulesManager, useTranslations } from "@openimis/fe-core"; +import React from "react"; + +const InsureeMissingPhotoReport = (props) => { + const { values, setValues } = props; + const modulesManager = useModulesManager(); + const { formatMessage } = useTranslations("policy", modulesManager); + + return ( + + + setValues({ ...values, yearMonth })} + /> + + + + setValues({ + ...values, + location, + }) + } + value={values.location} + locationLevel={1} + /> + + + ); +}; + +export default InsureeMissingPhotoReport;