Skip to content

Commit

Permalink
Merge pull request #57 from openimis/feature/OMT-333_primary_indictors
Browse files Browse the repository at this point in the history
OMT-333 Primary indicators
  • Loading branch information
delcroip authored Dec 11, 2023
2 parents 39a7ca1 + 77bc226 commit 762ab3d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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 },
Expand Down
39 changes: 39 additions & 0 deletions src/reports/PolicyPrimaryOperationalIndicatorsReport.js
Original file line number Diff line number Diff line change
@@ -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 (
<Grid container direction="column" spacing={1}>
<Grid item>
<PublishedComponent
pubRef="core.DatePicker"
value={values.yearMonth}
module="policy"
required
label="PrimaryOperationalIndicatorsReport.yearMonth"
onChange={(yearMonth) => setValues({ ...values, yearMonth })}
/>
</Grid>
<Grid item>
<PublishedComponent
pubRef="location.LocationPicker"
onChange={(location) =>
setValues({
...values,
location,
})
}
value={values.location}
locationLevel={1}
/>
</Grid>
</Grid>
);
};

export default InsureeMissingPhotoReport;

0 comments on commit 762ab3d

Please sign in to comment.