Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/follow-redirects-1.15.6
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki authored Jul 19, 2024
2 parents 7a43011 + 618e7d0 commit e9df2d8
Show file tree
Hide file tree
Showing 406 changed files with 20,140 additions and 32,245 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/automation-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [22.x]

steps:
# setup code, directories and system wide dependency
- name: Checkout web
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
path: web
fetch-depth: 1

- name: Checkout express server
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: onaio/express-server
path: express

- name: Checkout fhir automation
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: onaio/fhir-web-automation
token: ${{ secrets.ACCESS_TOKEN }} # currently using a PAT -> not the best option.
Expand All @@ -47,7 +47,7 @@ jobs:
java-version: 11

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
REACT_APP_ENABLE_FHIR_ORGANIZATION=true
REACT_APP_ENABLE_FHIR_TEAMS=true
REACT_APP_FHIR_ROOT_LOCATION_ID=eff94f33-c356-4634-8795-d52340706ba9
REACT_APP_FHIR_INVENTORY_LIST_ID=81b674df-e958-4684-8931-8feefa74d6fb
REACT_APP_FHIR_PATIENT_SORT_FIELDS=-_lastUpdated
REACT_APP_FHIR_PATIENT_BUNDLE_SIZE=5000
REACT_APP_ENABLE_FHIR_HEALTHCARE_SERVICES=false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
test:
strategy:
matrix:
node-version: [16.17.0]
node-version: [22.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Run all tests
run: yarn test --verbose --collectCoverage=true --forceExit --detectOpenHandles
env:
NODE_OPTIONS: --max_old_space_size=4096
NODE_OPTIONS: --max_old_space_size=5120

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM alpine/git AS sources

RUN git clone --depth=1 --branch=v2.0.1 https://github.com/onaio/express-server.git /usr/src/express-server
# TODO - update the tag here
RUN git clone --branch=v2.1.0 https://github.com/onaio/express-server.git /usr/src/express-server

FROM node:16.18-alpine as build

Expand Down Expand Up @@ -32,7 +33,9 @@ RUN yarn && yarn tsc && npm prune -production --legacy-peer-deps
# Remove unused dependencies
RUN rm -rf ./node_modules/typescript

FROM node:16.18-alpine as final


FROM nikolaik/python-nodejs:python3.12-nodejs22-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 All @@ -52,21 +55,17 @@ WORKDIR /usr/src/web
COPY --from=build /project/node_modules /usr/src/web/node_modules
COPY --from=build /project/app/build /usr/src/web

RUN chown -R node /usr/src/web

WORKDIR /usr/src/app

COPY --from=nodejsbuild /usr/src/express-server/dist /usr/src/app
COPY --from=nodejsbuild /usr/src/express-server/build /usr/src/app
COPY --from=nodejsbuild /usr/src/express-server/node_modules /usr/src/app/node_modules

RUN chown -R node /usr/src/app

USER node
RUN pip install -r /usr/src/app/fhir-tooling/requirements.txt

ENV EXPRESS_REACT_BUILD_PATH /usr/src/web/

EXPOSE 3000

CMD [ "/bin/sh", "-c", "/usr/local/bin/app.sh && node ." ]
CMD [ "/bin/sh", "-c", "/usr/local/bin/app.sh && node /usr/src/app/dist" ]

ENTRYPOINT ["/sbin/tini", "--"]
1 change: 1 addition & 0 deletions app/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ REACT_APP_COMMODITIES_LIST_RESOURCE_ID="uuid"
REACT_APP_PRACTITIONER_TO_ORG_ASSIGNMENT_STRATEGY=ONE_TO_MANY
REACT_APP_AUTHZ_STRATEGY=keycloak
REACT_APP_FHIR_ROOT_LOCATION_ID=uuid
REACT_APP_FHIR_INVENTORY_LIST_ID=uuid
Binary file added app/public/logob.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 107 additions & 3 deletions app/src/App/fhir-apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ import {
AffiliationList as FhirTeamAssignment,
} from '@opensrp/fhir-team-management';
import {
EusmAddEditLocationUnit,
LocationUnitList as FHIRLocationUnitList,
NewEditLocationUnit as FHIRNewEditLocationUnit,
URL_SERVICE_POINT_ADD_EDIT,
URL_SERVICE_POINT_LIST,
URL_LOCATION_VIEW_DETAILS,
ViewDetails,
AllLocationListFlat as ListAllLocationsFlat,
URL_ALL_LOCATIONS,
URL_SERVICE_POINT_LOCATIONS,
EusmLocationListFlat,
} from '@opensrp/fhir-location-management';
import {
Expand All @@ -96,6 +100,7 @@ import {
patientProps,
fhirCreateEditUserProps,
commmodityProps,
fhirCreateEditLocationProps,
} from './utils';
import './App.css';
import {
Expand All @@ -114,10 +119,14 @@ import {
GroupList,
LIST_COMMODITY_URL,
LIST_GROUP_URL,
ADD_LOCATION_INVENTORY,
AddLocationInventory,
} from '@opensrp/fhir-group-management';
import { CloseFlag, URL_CLOSE_FLAGS } from '@opensrp/fhir-flag';
import { useTranslation } from '../mls';
import '@opensrp/user-management/dist/index.css';
import { APP_LOGIN_URL } from '../configs/dispatchConfig';
import { DATA_IMPORT_CREATE_URL, ImportDetailViewDetails, DATA_IMPORT_DETAIL_URL, DATA_IMPORT_LIST_URL, DataImportList, StartDataImport } from '@opensrp/fhir-import';

/** Util function that renders Oauth2 callback components
*
Expand Down Expand Up @@ -195,6 +204,40 @@ const FHIRApps = () => {
permissions={['iam_group.read']}
component={UserGroupsList}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={DATA_IMPORT_LIST_URL}
permissions={['WebDataImport.read']}
component={DataImportList}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${DATA_IMPORT_CREATE_URL}`}
permissions={['WebDataImport.create']}
component={StartDataImport}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${DATA_IMPORT_DETAIL_URL}/:${'workflowId'}`}
{...patientProps}
permissions={['WebDataImport.read']}
component={ImportDetailViewDetails}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${DATA_IMPORT_LIST_URL}/:${'workflowId'}`}
{...patientProps}
permissions={['WebDataImport.read']}
component={DataImportList}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand All @@ -213,6 +256,15 @@ const FHIRApps = () => {
permissions={['Patient.read']}
component={PatientDetails}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${LIST_PATIENTS_URL}/:${'id'}/:resourceType/:resourceId`}
{...patientProps}
permissions={['Patient.read']}
component={PatientDetails}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand Down Expand Up @@ -327,7 +379,7 @@ const FHIRApps = () => {
exact
path={URL_TEAM_ASSIGNMENT}
{...teamAffiliationProps}
permissions={['OrganizationAffiliation.read']}
permissions={['OrganizationAffiliation.read', 'Location.read']}
component={FhirTeamAssignment}
/>
<PrivateComponent
Expand Down Expand Up @@ -378,7 +430,7 @@ const FHIRApps = () => {
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_SERVICE_POINT_LOCATIONS}
path={URL_SERVICE_POINT_LIST}
permissions={['Location.read']}
component={EusmLocationListFlat}
/>
Expand All @@ -391,6 +443,24 @@ const FHIRApps = () => {
permissions={['Location.create']}
component={FHIRNewEditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_SERVICE_POINT_ADD_EDIT}
{...newLocationUnitProps}
permissions={['Location.create']}
component={EusmAddEditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_SERVICE_POINT_ADD_EDIT}/:id`}
{...newLocationUnitProps}
permissions={['Location.create']}
component={EusmAddEditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand All @@ -400,6 +470,14 @@ const FHIRApps = () => {
permissions={['Location.update']}
component={FHIRNewEditLocationUnit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_LOCATION_VIEW_DETAILS}/:id`}
permissions={['Location.read']}
component={ViewDetails}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand Down Expand Up @@ -446,6 +524,24 @@ const FHIRApps = () => {
permissions={['Group.create']}
component={CommodityAddEdit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
path={`${ADD_LOCATION_INVENTORY}/:servicePointId`}
{...fhirCreateEditLocationProps}
exact
permissions={['Group.create']}
component={AddLocationInventory}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
path={`${ADD_LOCATION_INVENTORY}/:servicePointId/:inventoryId`}
{...fhirCreateEditLocationProps}
exact
permissions={['Group.create']}
component={AddLocationInventory}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
Expand Down Expand Up @@ -484,6 +580,14 @@ const FHIRApps = () => {
component={UserGroupsList}
permissions={['iam_group.read']}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_CLOSE_FLAGS}/:id`}
// permissions={['Flag.update']}
component={CloseFlag}
/>
<Route
exact
path={APP_LOGIN_URL}
Expand Down
11 changes: 7 additions & 4 deletions app/src/App/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
URL_DRAFT_FILE_LIST,
URL_UPLOAD_DRAFT_FILE,
URL_MANIFEST_RELEASE_LIST,
URL_LOCATION_UNIT,
} from '../constants';
import {
OPENSRP_API_BASE_URL,
Expand All @@ -17,6 +16,7 @@ import {
DISABLE_TEAM_MEMBER_REASSIGNMENT,
FHIR_API_BASE_URL,
KEYCLOAK_USERS_PAGE_SIZE,
FHIR_INVENTORY_LIST_ID,
} from '../configs/env';

export const BaseProps = {
Expand All @@ -39,9 +39,6 @@ export const locationUnitProps = {
};

export const newLocationUnitProps = {
successURLGenerator: () => URL_LOCATION_UNIT,
cancelURLGenerator: () => URL_LOCATION_UNIT,
hidden: ['serviceType', 'latitude', 'longitude'],
...locationUnitProps,
};

Expand Down Expand Up @@ -114,3 +111,9 @@ export const patientProps = {
export const commmodityProps = {
listId: COMMODITIES_LIST_RESOURCE_ID,
};

export const fhirCreateEditLocationProps = {
...BaseProps,
listId: FHIR_INVENTORY_LIST_ID,
commodityListId: COMMODITIES_LIST_RESOURCE_ID,
};
Binary file added app/src/assets/images/opensrp2-logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/images/opensrp2-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e9df2d8

Please sign in to comment.