From 144c6d614d3141ca5af91ba71ad0c5a6ce0612c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20G=C3=A9r=C3=B4me?= Date: Fri, 29 Oct 2021 15:47:21 +0200 Subject: [PATCH 1/8] chore(Search): Small visual improvements on table columns --- src/components/InsureeSearcher.js | 2 -- src/pickers/InsureeGenderPicker.js | 1 - 2 files changed, 3 deletions(-) diff --git a/src/components/InsureeSearcher.js b/src/components/InsureeSearcher.js index 05f2462..988e09f 100644 --- a/src/components/InsureeSearcher.js +++ b/src/components/InsureeSearcher.js @@ -151,7 +151,6 @@ class InsureeSearcher extends Component { @@ -160,7 +159,6 @@ class InsureeSearcher extends Component { diff --git a/src/pickers/InsureeGenderPicker.js b/src/pickers/InsureeGenderPicker.js index 00db8af..3f54731 100644 --- a/src/pickers/InsureeGenderPicker.js +++ b/src/pickers/InsureeGenderPicker.js @@ -41,7 +41,6 @@ class InsureeGenderPicker extends Component { readOnly = false, required = false, withNull = false, - nullLabel = null, } = this.props; let options = !!insureeGenders ? insureeGenders.map((v) => ({ value: v, label: this.formatSuggestion(v) })) : []; if (withNull) { From 5df89b6e27e1ef5af5f84016b0aea81b072304b4 Mon Sep 17 00:00:00 2001 From: Eric Darchis Date: Wed, 3 Nov 2021 18:06:10 +0100 Subject: [PATCH 2/8] Missing translation --- src/menus/InsureeMainMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menus/InsureeMainMenu.js b/src/menus/InsureeMainMenu.js index 729bff2..a32688e 100644 --- a/src/menus/InsureeMainMenu.js +++ b/src/menus/InsureeMainMenu.js @@ -13,7 +13,7 @@ class InsureeMainMenu extends Component { let entries = []; if (rights.includes(RIGHT_FAMILY_ADD)) { entries.push({ - text: "Add Family/Group", + text: formatMessage(this.props.intl, "insuree", "menu.addFamilyOrGroup"), icon: , route: "/" + modulesManager.getRef("insuree.route.family"), withDivider: true, From 448b4d1235c38cb21e37846713ef217c79dedac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20G=C3=A9r=C3=B4me?= Date: Thu, 4 Nov 2021 16:03:50 +0100 Subject: [PATCH 3/8] hotfix(Family): Family's location is required (at least in the legacy interface) --- src/components/FamilyMasterPanel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/FamilyMasterPanel.js b/src/components/FamilyMasterPanel.js index bb08adc..bec5181 100644 --- a/src/components/FamilyMasterPanel.js +++ b/src/components/FamilyMasterPanel.js @@ -123,6 +123,7 @@ class FamilyMasterPanel extends FormPanel { pubRef="location.DetailedLocation" withNull={true} readOnly={readOnly} + required value={!edited ? null : edited.location} onChange={(v) => this.updateAttribute("location", v)} filterLabels={false} From 0d4a1b728b429a55a45d24b35d116bdff0e06c3f Mon Sep 17 00:00:00 2001 From: rstencel Date: Mon, 6 Dec 2021 15:12:06 +0100 Subject: [PATCH 4/8] OPL-39: Provide Insuree picker and Family picker for Invoice module --- README.md | 1 + src/actions.js | 4 ++++ src/index.js | 17 +++++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00792cd..c8fb1bd 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ It is dedicated to be deployed as a module of [openimis-fe_js](https://github.co - `insuree.Insuree.panels`: `[InsureeFirstServicePointPanel]`, contributing to own contribution point and adding First Service Point contribution when creating a new Insuree - `insuree.InsureePage.panels`: `[InsureeMasterPanel, InsureeFirstServicePointPanel]`, contributing to own contribution point and register the defaults MasterPanel and First Service Point as panels of Insuree Page - `core.Router`: registering the `insuree/create`, `insuree/families`, `insuree/insurees`, `insuree/cappedItemService` and `insuree/profile` routes in openIMIS client-side router +- `invoice.SubjectAndThirdpartyPicker`, providing Insuree picker and Family picker for Invoice module ## Available Contribution Points diff --git a/src/actions.js b/src/actions.js index 4553b8e..4dd01ae 100644 --- a/src/actions.js +++ b/src/actions.js @@ -26,6 +26,8 @@ const FAMILY_FULL_PROJECTION = (mm) => [ "clientMutationId", ]; +export const FAMILY_PICKER_PROJECTION = ["id", "uuid", "headInsuree{id chfId uuid lastName otherNames}"]; + const INSUREE_FULL_PROJECTION = (mm) => [ "id", "uuid", @@ -54,6 +56,8 @@ const INSUREE_FULL_PROJECTION = (mm) => [ "healthFacility" + mm.getProjection("location.HealthFacilityPicker.projection"), ]; +export const INSUREE_PICKER_PROJECTION = ["id", "uuid", "chfId", "lastName", "otherNames"]; + export function fetchInsureeGenders() { const payload = formatQuery("insureeGenders", null, ["code"]); return graphql(payload, "INSUREE_GENDERS"); diff --git a/src/index.js b/src/index.js index 3d78616..f41ace6 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,7 @@ import FamilyDisplayPanel from "./components/FamilyDisplayPanel"; import { familyLabel } from "./utils/utils"; import messages_en from "./translations/en.json"; import reducer from "./reducer"; +import { FAMILY_PICKER_PROJECTION, INSUREE_PICKER_PROJECTION } from "./actions"; const ROUTE_INSUREE_FAMILIES = "insuree/families"; const ROUTE_INSUREE_FAMILY_OVERVIEW = "insuree/familyOverview"; @@ -48,10 +49,10 @@ const DEFAULT_CONFIG = { { key: "insuree.InsureeOfficerPicker.projection", ref: ["id", "uuid", "code", "lastName", "otherNames"] }, { key: "insuree.InsureePicker", ref: InsureePicker }, { key: "insuree.InsureeChfIdPicker", ref: InsureeChfIdPicker }, - { key: "insuree.InsureePicker.projection", ref: ["id", "uuid", "chfId", "lastName", "otherNames"] }, + { key: "insuree.InsureePicker.projection", ref: INSUREE_PICKER_PROJECTION }, { key: "insuree.InsureePicker.sort", ref: "insuree__last_name" }, { key: "insuree.FamilyPicker", ref: FamilyPicker }, - { key: "insuree.FamilyPicker.projection", ref: ["id", "uuid", "headInsuree{id chfId uuid lastName otherNames}"] }, + { key: "insuree.FamilyPicker.projection", ref: FAMILY_PICKER_PROJECTION }, { key: "insuree.FamilyPicker.sort", ref: "family__head_insuree__lastName" }, { key: "insuree.familyLabel", ref: familyLabel }, { key: "insuree.InsureeGenderPicker", ref: InsureeGenderPicker }, @@ -95,6 +96,18 @@ const DEFAULT_CONFIG = { "insuree.InsureeSummaryExt": [InsureeFirstServicePointDisplay], "insuree.Insuree.panels": [InsureeFirstServicePointPanel], "policy.Policy.headPanel": [FamilyDisplayPanel], + "invoice.SubjectAndThirdpartyPicker": [ + { + type: "insuree", + picker: InsureePicker, + pickerProjection: INSUREE_PICKER_PROJECTION, + }, + { + type: "family", + picker: FamilyPicker, + pickerProjection: FAMILY_PICKER_PROJECTION, + }, + ], }; export const InsureeModule = (cfg) => { From ea90c551d1b1f478984e25cf392c5e2ccbd3fd94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20G=C3=A9r=C3=B4me?= Date: Fri, 14 Jan 2022 11:49:52 +0100 Subject: [PATCH 5/8] remove unused package --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 08d307c..1c859cd 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "prettier": "^2.3.2", "prop-types": "^15.7.2", "react-autosuggest": "^10.0.2", - "react-router-dom": "^5.2.0", "redux": "^4.0.5", "redux-api-middleware": "^3.2.1", "rollup": "^2.10.0" From 045a828bc92dd1a9845d3447c73a4a44c232d435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20G=C3=A9r=C3=B4me?= Date: Thu, 10 Mar 2022 17:11:03 +0100 Subject: [PATCH 6/8] Reports: Add the first two reports --- src/index.js | 24 +++++++++++ src/reports/EnrolledFamiliesReport.js | 48 ++++++++++++++++++++++ src/reports/InsureeFamilyOverviewReport.js | 34 +++++++++++++++ src/translations/en.json | 6 ++- 4 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 src/reports/EnrolledFamiliesReport.js create mode 100644 src/reports/InsureeFamilyOverviewReport.js diff --git a/src/index.js b/src/index.js index f41ace6..d5c8016 100644 --- a/src/index.js +++ b/src/index.js @@ -34,6 +34,9 @@ import { familyLabel } from "./utils/utils"; import messages_en from "./translations/en.json"; import reducer from "./reducer"; import { FAMILY_PICKER_PROJECTION, INSUREE_PICKER_PROJECTION } from "./actions"; +import { decodeId } from "@openimis/fe-core"; +import EnrolledFamiliesReport from "./reports/EnrolledFamiliesReport"; +import InsureeFamilyOverviewReport from "./reports/InsureeFamilyOverviewReport"; const ROUTE_INSUREE_FAMILIES = "insuree/families"; const ROUTE_INSUREE_FAMILY_OVERVIEW = "insuree/familyOverview"; @@ -44,6 +47,27 @@ const ROUTE_INSUREE_INSUREE = "insuree/insuree"; const DEFAULT_CONFIG = { "translations": [{ key: "en", messages: messages_en }], "reducers": [{ key: "insuree", reducer }], + "reports": [ + { + key: "insuree_family_overview", + component: InsureeFamilyOverviewReport, + isValid: (values) => values.dateFrom && values.dateTo, + getParams: (values) => ({ + dateFrom: values.dateFrom, + dateTo: values.dateTo, + }), + }, + { + key: "enrolled_families", + component: EnrolledFamiliesReport, + isValid: (values) => values.location && values.dateFrom && values.dateTo, + getParams: (values) => ({ + locationId: decodeId(values.location.id), + dateFrom: values.dateFrom, + dateTo: values.dateTo, + }), + }, + ], "refs": [ { key: "insuree.InsureeOfficerPicker", ref: InsureeOfficerPicker }, { key: "insuree.InsureeOfficerPicker.projection", ref: ["id", "uuid", "code", "lastName", "otherNames"] }, diff --git a/src/reports/EnrolledFamiliesReport.js b/src/reports/EnrolledFamiliesReport.js new file mode 100644 index 0000000..64725ac --- /dev/null +++ b/src/reports/EnrolledFamiliesReport.js @@ -0,0 +1,48 @@ +import { Grid } from "@material-ui/core"; +import { PublishedComponent } from "@openimis/fe-core"; +import React from "react"; + +const EnrolledFamiliesReport = (props) => { + const { values, setValues } = props; + + return ( + + + + setValues({ + ...values, + location, + }) + } + required + value={values.location} + locationLevel={2} + /> + + + setValues({ ...values, dateFrom })} + /> + + + setValues({ ...values, dateTo })} + /> + + + ); +}; + +export default EnrolledFamiliesReport; diff --git a/src/reports/InsureeFamilyOverviewReport.js b/src/reports/InsureeFamilyOverviewReport.js new file mode 100644 index 0000000..50e2df6 --- /dev/null +++ b/src/reports/InsureeFamilyOverviewReport.js @@ -0,0 +1,34 @@ +import { Grid } from "@material-ui/core"; +import { PublishedComponent } from "@openimis/fe-core"; +import React from "react"; + +const InsureeFamilyOverviewReport = (props) => { + const { values, setValues } = props; + + return ( + + + setValues({ ...values, dateFrom })} + /> + + + setValues({ ...values, dateTo })} + /> + + + ); +}; + +export default InsureeFamilyOverviewReport; diff --git a/src/translations/en.json b/src/translations/en.json index 06607ea..3678aa5 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -222,5 +222,9 @@ "insuree.selectHeadInsuree.tooltip": "Select existing insuree as head", "insuree.addInsuree.alert.title": "Add insuree to family warning(s):", "insuree.addInsuree.alert.message": "However, insuree can still be added to the family.", - "insuree.InsureeNumberInput.error": "Invalid Insuree Number" + "insuree.InsureeNumberInput.error": "Invalid Insuree Number", + "insuree.EnrolledFamiliesReport.dateFrom": "From Date", + "insuree.EnrolledFamiliesReport.dateTo": "To Date", + "insuree.InsureeFamilyOverviewReport.dateFrom": "From Date", + "insuree.InsureeFamilyOverviewReport.dateTo": "To Date" } From 0e46c48547928e20dafac85c0b5f75c77a20756d Mon Sep 17 00:00:00 2001 From: Eric Darchis Date: Mon, 14 Mar 2022 00:40:56 +0100 Subject: [PATCH 7/8] v1.4.0-rc3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1c859cd..de3dcaf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openimis/fe-insuree", - "version": "1.3.0", + "version": "1.4.0-rc3", "license": "AGPL-3.0-only", "description": "openIMIS Frontend Insuree reference module", "repository": "openimis/openimis-fe-insuree_js", From 6909d2668b38bb2e6d481afbdfd6ff15ab81c200 Mon Sep 17 00:00:00 2001 From: Patrick Delcroix Date: Wed, 23 Mar 2022 10:28:12 +0100 Subject: [PATCH 8/8] new publish --- .github/workflows/npmpublish.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 2336d08..435edf0 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -5,29 +5,38 @@ name: Node.js Package on: release: - types: [created] + types: [published] jobs: build: runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - - run: yarn build + - run: yarn build + publish-npm: needs: build runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 registry-url: https://registry.npmjs.org/ scope: openimis + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - run: yarn build - run: npm publish --access public @@ -38,11 +47,15 @@ jobs: needs: build runs-on: ubuntu-latest steps: + - uses: olegtarasov/get-tag@v2.1 + id: tagName - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12 registry-url: https://npm.pkg.github.com/ + - name: update the version with TAG + run: echo $(jq --arg a "$GIT_TAG_NAME" '.version = ($a)' package.json) > package.json - run: yarn install - run: yarn build - run: npm publish