Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fhir location management #778

Merged
merged 45 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ac6f2be
Init FHIR location management package
KipSigei Jul 5, 2021
e47f5c3
Add REACT_APP_ENABLE_FHIR_LOCATIONS var
KipSigei Jul 5, 2021
1aadee7
Build out FHIR location list view
KipSigei Jul 12, 2021
fc47deb
Update translations
KipSigei Jul 12, 2021
350deaa
Location Detail view cleanup
KipSigei Jul 13, 2021
4de8781
Fix location editing
KipSigei Jul 19, 2021
a9ca8bd
Minor cleanup
KipSigei Jul 21, 2021
8c70fc6
Merge branch 'master' into fhir-location-management
KipSigei Sep 30, 2021
072bc37
Merge branch 'master' into fhir-location-management
KipSigei Sep 30, 2021
23ba24a
use fhir service class
KipSigei Sep 30, 2021
d8d608c
Merge branch 'master' into fhir-location-management
KipSigei Oct 7, 2021
dec9789
Load and display FHIR location hierarchy
KipSigei Oct 13, 2021
c4aa883
Fix location hierarchy editing bug
KipSigei Oct 15, 2021
df785ba
Add REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER env
KipSigei Oct 15, 2021
58997c5
Update translations
KipSigei Oct 19, 2021
2d6894c
Update location list view/hierarchy view tests
KipSigei Oct 19, 2021
35d6fce
Add view details dropdown
KipSigei Oct 25, 2021
a82a7df
Code cleanup
KipSigei Oct 26, 2021
2aeddb6
Merge branch 'master' into fhir-location-management
KipSigei Nov 19, 2021
c17ece7
git Merge branch 'master' into fhir-location-management
peterMuriuki Jan 26, 2022
355722e
Merge branch 'master' into fhir-location-management
peterMuriuki Feb 1, 2022
9ec489e
Pending
peterMuriuki Feb 4, 2022
2b8cca8
Merge branch 'master' into fhir-location-management
peterMuriuki Feb 7, 2022
20deb70
Bug fix in location Tree
peterMuriuki Feb 7, 2022
e91dc55
Test regression fixes
peterMuriuki Feb 7, 2022
adf9683
Fixing test regression
peterMuriuki Feb 10, 2022
823230f
Fix regressed tests in app
peterMuriuki Feb 10, 2022
6ca4184
Update node version to v14 LTS
peterMuriuki Feb 21, 2022
22b2a54
Use flush-promises to flush pending promises
peterMuriuki Feb 21, 2022
0c355bb
Trying something else
peterMuriuki Feb 21, 2022
c5217ab
Remove unndecessary nock mocks
peterMuriuki Feb 21, 2022
ffc5d53
Try with v16 lts
peterMuriuki Feb 21, 2022
5552a65
This might be it move wrapper.update in act
peterMuriuki Feb 21, 2022
357044c
This ought to work
peterMuriuki Feb 22, 2022
ce90b0c
Revert circle ci config
peterMuriuki Feb 22, 2022
51a184c
Update tests
peterMuriuki Feb 22, 2022
3aff5da
Merge master
peterMuriuki Feb 24, 2022
5091a59
Replace yarn.lock
peterMuriuki Feb 24, 2022
b0668e0
Lint and test regressions
peterMuriuki Feb 24, 2022
8d42c4f
Update node version v16.14 LTS
peterMuriuki Feb 25, 2022
c9be54e
Add enable fhir locations env to confd
peterMuriuki Feb 25, 2022
e0fb5e3
Fix regresion in filter by parent Id
peterMuriuki Feb 25, 2022
1f9298a
Minor fix in locationform
peterMuriuki Feb 25, 2022
7fc88af
Add fhir root identifier to docker confd
peterMuriuki Feb 25, 2022
e43d5a3
Remove fhir root location identifier default
peterMuriuki Feb 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:16.13.0
machariamuguku marked this conversation as resolved.
Show resolved Hide resolved
- image: cimg/node:16.14.0

environment:
SKIP_PREFLIGHT_CHECK: 'true'
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM alpine/git AS sources

RUN git clone --depth=1 --branch=v1.3.1 https://github.com/onaio/express-server.git /usr/src/express-server

FROM node:16.13.0-alpine as build
FROM node:16.14.0-alpine as build

COPY ./ /project

Expand All @@ -20,7 +20,7 @@ RUN chown -R node .
USER node
RUN yarn lerna:prepublish

FROM node:16.13.0-alpine as nodejsbuild
FROM node:16.14.0-alpine as nodejsbuild
COPY --from=sources /usr/src/express-server /usr/src/express-server

WORKDIR /usr/src/express-server
Expand All @@ -29,7 +29,7 @@ RUN yarn && yarn tsc && npm prune -production
# Remove unused dependencies
RUN rm -rf ./node_modules/typescript

FROM node:16.13.0-alpine as final
FROM node:16.14.0-alpine as final

# Use tini for NodeJS application https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals
RUN apk add --no-cache tini curl
Expand Down
1 change: 1 addition & 0 deletions app/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ REACT_APP_DISABLE_TEAM_MEMBER_REASSIGNMENT=false
REACT_APP_USER_FORM_HIDDEN_FIELDS=""
REACT_APP_USER_FORM_RENDER_FIELDS=""
REACT_APP_PAGINATION_SIZE=1000
REACT_APP_ENABLE_FHIR_LOCATIONS=false
machariamuguku marked this conversation as resolved.
Show resolved Hide resolved
REACT_APP_ENABLE_SERVER_SETTINGS=false
REACT_APP_OPENSRP_WEB_VERSION=$npm_package_version
REACT_APP_SENTRY_CONFIG_JSON={"dsn":"https://public@sentry.example.com/1","release":"1.0.0","environment":"prod","tags":{"release-name":"web","commit":"012345"}}
3 changes: 2 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@opensrp/ant-icons": "^0.0.1",
"@opensrp/card-support": "^0.0.9",
"@opensrp/error-boundary-fallback": "^0.0.7",
"@opensrp/fhir-location-management": "^0.0.1",
"@opensrp/form-config-antd": "^0.0.4",
"@opensrp/inventory": "^0.0.9",
"@opensrp/keycloak-service": "^0.0.17",
Expand All @@ -34,7 +35,7 @@
"@opensrp/server-logout": "^0.0.1",
"@opensrp/server-service": "^0.0.16",
"@opensrp/store": "^0.0.10",
"@opensrp/fhir-team-management": "file:../packages/fhir-team-management",
"@opensrp/fhir-team-management": "^0.0.5",
"@opensrp/team-assignment": "^0.0.6",
"@opensrp/team-management": "^0.0.9",
"@opensrp/user-management": "^0.1.19",
Expand Down
11 changes: 8 additions & 3 deletions app/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
DISABLE_LOGIN_PROTECTION,
OPENSRP_ROLES,
DEFAULT_HOME_MODE,
ENABLE_FHIR_LOCATIONS,
ENABLE_FHIR_TEAMS_MODULE,
} from '../configs/env';
import {
Expand Down Expand Up @@ -122,6 +123,10 @@ import {
NewLocationUnit,
EditLocationUnit,
} from '@opensrp/location-management';
import {
LocationUnitList as FHIRLocationUnitList,
NewEditLocationUnit as FHIRNewEditLocationUnit,
} from '@opensrp/fhir-location-management';
import {
BaseProps,
jsonValidatorListProps,
Expand Down Expand Up @@ -711,7 +716,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT}
{...locationUnitProps}
component={LocationUnitList}
component={ENABLE_FHIR_LOCATIONS ? FHIRLocationUnitList : LocationUnitList}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand All @@ -720,7 +725,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT_ADD}
{...newLocationUnitProps}
component={NewLocationUnit}
component={ENABLE_FHIR_LOCATIONS ? FHIRNewEditLocationUnit : NewLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand All @@ -729,7 +734,7 @@ const App: React.FC = () => {
exact
path={URL_LOCATION_UNIT_EDIT}
{...editLocationProps}
component={EditLocationUnit}
component={ENABLE_FHIR_LOCATIONS ? FHIRNewEditLocationUnit : EditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
Expand Down
2 changes: 2 additions & 0 deletions app/src/App/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
USER_FORM_HIDDEN_FIELDS,
USER_FORM_RENDER_FIELDS,
PAGINATION_SIZE,
FHIR_ROOT_LOCATION_IDENTIFIER,
FHIR_RESOURCES_PAGE_SIZE,
} from '../configs/env';

Expand All @@ -49,6 +50,7 @@ export const teamManagementProps = {

export const locationUnitProps = {
filterByParentId: FILTER_BY_PARENT_ID,
fhirRootLocationIdentifier: FHIR_ROOT_LOCATION_IDENTIFIER,
};

export const newLocationUnitProps = {
Expand Down
6 changes: 6 additions & 0 deletions app/src/configs/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export const SUPPORTED_LANGUAGES = setEnv('REACT_APP_SUPPORTED_LANGUAGES', '').s
export const ENABLE_LANGUAGE_SWITCHER =
setEnv('REACT_APP_ENABLE_LANGUAGE_SWITCHER', 'false') === 'true';

export const ENABLE_FHIR_LOCATIONS = setEnv('REACT_APP_ENABLE_FHIR_LOCATIONS', 'false') === 'true';

export const FILTER_BY_PARENT_ID = setEnv('REACT_APP_FILTER_BY_PARENT_ID', 'true') === 'true';

export const DEFAULT_HOME_MODE = setEnv('REACT_APP_DEFAULT_HOME_MODE', 'default');
Expand All @@ -192,6 +194,10 @@ export const PAGINATION_SIZE = Number(setEnv('REACT_APP_PAGINATION_SIZE', 1000))

export const DEFAULTS_TABLE_PAGE_SIZE = Number(setEnv('REACT_APP_DEFAULTS_TABLE_PAGE_SIZE', 5));

export const FHIR_ROOT_LOCATION_IDENTIFIER = setEnv(
'REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER',
machariamuguku marked this conversation as resolved.
Show resolved Hide resolved
''
);
export const FHIR_RESOURCES_PAGE_SIZE = Number(setEnv('REACT_APP_FHIR_RESOURCES_PAGE_SIZE', 500));

export const ENABLE_SERVER_SETTINGS = setEnv('REACT_APP_ENABLE_SERVER_SETTINGS', false) === 'true';
Expand Down
2 changes: 1 addition & 1 deletion app/src/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function lang(t: TFunction) {
INVENTORY: t(`Inventory`, { ns: namespace }),
SERVICE_POINT_INVENTORY: t(`Service point inventory`, { ns: namespace }),
ADD_INVENTORY_VIA_CSV: t(`Add inventory via CSV`, { ns: namespace }),
CARE_TEAM: t(`Care Team`, { ns: namespace }),
CARE_TEAM: t(`Care Teams Management`, { ns: namespace }),
};
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "Card Support",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "Download Client Data",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/sw.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "An error occurred",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "Complete",
"Download Client Data": "",
"Draft": "Draft",
Expand Down
2 changes: 1 addition & 1 deletion app/src/locales/core/th.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Administration": "",
"An error occurred": "",
"Card Support": "",
"Care Team": "",
"Care Teams Management": "",
"Complete": "",
"Download Client Data": "",
"Draft": "",
Expand Down
4 changes: 3 additions & 1 deletion docker/confd_env.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ keys = [
"/react/app/enable/server/settings",
"/react/app/opensrp/api/v2/base/url",
"/react/app/opensrp/web/version",
"/react/app/opensrp/sentry/config/json"
"/react/app/opensrp/sentry/config/json",
"/react/app/enable/fhir/locations",
"react/app/fhir/root/location/identifier"
]
2 changes: 2 additions & 0 deletions docker/config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ window._env_ = {
REACT_APP_OPENSRP_API_V2_BASE_URL: "{{ getv "/react/app/opensrp/api/v2/base/url" "https://opensrp-stage.smartregister.org/opensrp/rest/v2/" }}",
REACT_APP_OPENSRP_WEB_VERSION: "{{ getv "/react/app/opensrp/web/version" "" }}"
REACT_APP_SENTRY_CONFIG_JSON: "{{ getv "/react/app/opensrp/sentry/config/json" ""}}"
REACT_APP_ENABLE_FHIR_LOCATIONS: "{{ getv "/react/app/enable/fhir/locations" "false" }}"
REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER: "{{ getv "react/app/fhir/root/location/identifier" ""}}"
};
13 changes: 12 additions & 1 deletion docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ Below is a list of currently supported environment variables:
- **optional**
- default: `''`

- **REACT_APP_ENABLE_FHIR_LOCATIONS**

- Enables FHIR location management module
- **Optional**(`boolean`)
- default: `"false"`

- **REACT_APP_ENABLE_FHIR_CARE_TEAM**

- Enables the FHIR Care Team module
Expand All @@ -238,7 +244,12 @@ Below is a list of currently supported environment variables:

- Default number of rows per table page
- default: 5
- `Enum: 5, 10, 20 , 50, 100
- `Enum: 5, 10, 20 , 50, 100`

- **REACT_APP_FHIR_ROOT_LOCATION_IDENTIFIER**

- FHIR Hierarchy root location UUID
- **Optional**_(`string`)_

- **REACT_APP_FHIR_RESOURCES_PAGE_SIZE**

Expand Down
5 changes: 1 addition & 4 deletions packages/error-boundary-fallback/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

**Note:** Version bump only for package @opensrp/error-boundary-fallback

## [0.0.6](https://github.com/OpenSRP/web/compare/@opensrp/error-boundary-fallback@0.0.5...@opensrp/error-boundary-fallback@0.0.6) (2021-06-30)

**Note:** Version bump only for package @opensrp/error-boundary-fallback

## 0.0.4 (2021-02-24)

**Note:** Version bump only for package @opensrp/error-boundary-fallback
Expand All @@ -22,3 +18,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
## 0.0.2 (2021-02-18)

**Note:** Version bump only for package @opensrp/error-boundary-fallback
`
8 changes: 8 additions & 0 deletions packages/fhir-location-management/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.1 (2020-10-28)

**Note:** Version bump only for package @opensrp/fhir-location-management
10 changes: 10 additions & 0 deletions packages/fhir-location-management/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# FHIR Location Management

This package contains a set of components for managing (create, edit, view, delete) locations on FHIR.

## Installation

```sh

yarn add @opensrp/fhir-location-management
```
69 changes: 69 additions & 0 deletions packages/fhir-location-management/locales/core/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"</> JSON": "",
"Actions": "",
"Active": "",
"Add Location Unit": "",
"Add Location Unit Group": "",
"Alias": "",
"An error occurred": "",
"Building": "",
"Cancel": "",
"Delete": "",
"Description": "",
"E.g. -16.08306": "",
"E.g. 49.54933": "",
"Edit": "",
"Edit Location Unit": "",
"Edit Location Unit Group": "",
"Enter a location group name": "",
"Enter a location name": "",
"External ID": "",
"External ID can only contain letters, numbers and spaces": "",
"Geometry": "",
"Id": "",
"Inactive": "",
"Instance": "",
"Jurisdiction": "",
"Latitude": "",
"Level": "",
"Location category": "",
"Location category is required": "",
"Location Name": "",
"Location Unit": "",
"Location Unit created successfully": "",
"Location Unit Group": "",
"Location Unit Group can only contain letters, numbers and spaces": "",
"Location Unit Group Management": "",
"Location Unit Management": "",
"Location Unit must be an array": "",
"Location Unit updated successfully": "",
"Location was successfully created": "",
"Location was successfully updated": "",
"Longitude": "",
"Name": "",
"Name can only contain letters, numbers and spaces": "",
"Name is required": "",
"Only decimal values allowed": "",
"Parent ID can only contain letters, numbers and spaces": "",
"Part Of": "",
"Physical Type": "",
"Save": "",
"Saving": "",
"Search": "",
"Select status": "",
"Select the parent location": "",
"Select the service point type": "",
"Select type": "",
"Service types is required": "",
"Status": "",
"Status is required": "",
"Sync status": "",
"Type": "",
"Type can only contain letters, numbers and spaces": "",
"Type is required": "",
"Unit group": "",
"username": "",
"Username": "",
"Version": "",
"View Details": ""
}
Loading