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

(BREAKING) O3-3037 : Refactor components and rename files #211

Merged
merged 7 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.d.ts
**/node_modules/**/*
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,38 +104,3 @@ jobs:
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

bump-form-engine_ohri:
runs-on: ubuntu-latest

needs: pre_release

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: UCSF-IGHS/openmrs-esm-ohri
ref: dev

- name: Install dependencies
run: yarn

- name: Bump form engine
run: yarn ci:bump-form-engine-lib

- name: Commit changes
run: |
git config user.email "github-actions@github.com"
git config user.name "GitHub Actions"
git add yarn.lock
git commit -m "(chore) bump-form-engine"

- name: Create PR
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.ACTIONS_OHRI_PAT }}
commit-message: "(chore) Bump `@openmrs/openmrs-form-engine-lib`"
title: "(chore) Bump `@openmrs/openmrs-form-engine-lib`"
body: "This is an automated PR that bumps the [form engine library](https://github.com/openmrs/openmrs-form-engine-lib) to the newest available version tagged `next`."
branch: chore/bump-form-engine
base: dev
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<div id="top"></div>

:wave: *New to O3? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://openmrs.github.io/openmrs-esm-core/#/). You may find the [Map of the Project](https://openmrs.github.io/openmrs-esm-core/#/main/map) especially helpful.* :teacher:
:wave: *New to O3? Be sure to review the [OpenMRS 3 Frontend Developer Documentation](https://openmrs.github.io/openmrs-esm-core/#/). You may find the [Map of the Project](https://openmrs.github.io/openmrs-esm-core/#/main/map) especially helpful.* :teacher:

[![Form-engine-CI](https://github.com/UCSF-IGHS/openmrs-ohri-form-engine-lib/actions/workflows/node.js.yml/badge.svg)](https://github.com/UCSF-IGHS/openmrs-ohri-form-engine-lib/actions/workflows/node.js.yml)

# OpenMRS Form Engine

Expand Down Expand Up @@ -48,10 +47,10 @@ yarn add @openmrs/openmrs-form-engine-lib@latest

### Local Development

#### Install Dependencies
#### Install Dependencies

```bash
yarn
yarn
```

#### Build the library
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/forms/omrs-forms/component_art.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand Down
2 changes: 1 addition & 1 deletion __mocks__/forms/omrs-forms/component_preclinic-review.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand Down
12 changes: 6 additions & 6 deletions __mocks__/forms/omrs-forms/demo_hts-form.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand All @@ -34,17 +34,17 @@
"links": [
{
"rel": "value",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0/value",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0/value",
"resourceAlias": "resource"
},
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0",
"resourceAlias": "resource"
},
{
"rel": "full",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0?v=full",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55/resource/f12989b8-b8cb-47a2-b115-24a7ebe6d7f0?v=full",
"resourceAlias": "resource"
}
],
Expand All @@ -54,9 +54,9 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/form/955ab92f-f93e-4dc0-9c68-b7b2346def55",
"resourceAlias": "form"
}
],
"resourceVersion": "1.9"
}
}
2 changes: 1 addition & 1 deletion __mocks__/forms/omrs-forms/form-component.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/forms/omrs-forms/nested-form1.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand All @@ -35,4 +35,4 @@
}
],
"resourceVersion": "1.9"
}
}
4 changes: 2 additions & 2 deletions __mocks__/forms/omrs-forms/nested-form2.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"links": [
{
"rel": "self",
"uri": "http://ohri-demo.globalhealthapp.net/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"uri": "https://dev3.openmrs.org/openmrs/ws/rest/v1/user/82f18b44-6814-11e8-923f-e9a88dcb533f",
"resourceAlias": "user"
}
]
Expand All @@ -35,4 +35,4 @@
}
],
"resourceVersion": "1.9"
}
}
26 changes: 13 additions & 13 deletions __mocks__/use-initial-values/encounter.mock.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@
"voided": false,
"value": "Mother is in perfect condition",
"valueModifier": null,
"formFieldPath": "ohri-forms-notes",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-notes",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -329,8 +329,8 @@
"voided": false,
"value": "2023-07-24T00:00:00.000+0000",
"valueModifier": null,
"formFieldPath": "ohri-forms-date_of_birth",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-date_of_birth",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -414,8 +414,8 @@
"voided": false,
"value": "TBD",
"valueModifier": null,
"formFieldPath": "ohri-forms-infant_name",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-infant_name",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -575,8 +575,8 @@
"voided": false,
"value": " TDB II",
"valueModifier": null,
"formFieldPath": "ohri-forms-infant_name_2",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-infant_name_2",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -660,8 +660,8 @@
"voided": false,
"value": "2023-07-24T00:00:00.000+0000",
"valueModifier": null,
"formFieldPath": "ohri-forms-date_of_birth_2",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-date_of_birth_2",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -781,8 +781,8 @@
"voided": false,
"value": 2,
"valueModifier": null,
"formFieldPath": "ohri-forms-number_of_babies",
"formFieldNamespace": "ohri-forms",
"formFieldPath": "rfe-forms-number_of_babies",
"formFieldNamespace": "rfe-forms",
"status": "FINAL",
"interpretation": null,
"links": [
Expand Down Expand Up @@ -864,4 +864,4 @@
}
],
"resourceVersion": "2.2"
}
}
6 changes: 3 additions & 3 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { openmrsFetch, openmrsObservableFetch } from '@openmrs/esm-framework';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { openmrsFetch, openmrsObservableFetch } from '@openmrs/esm-framework';
import { encounterRepresentation } from '../constants';
import { OpenmrsForm, ProgramEnrollmentPayload } from './types';
import { OpenmrsForm, ProgramEnrollmentPayload } from '../types';
import { isUuid } from '../utils/boolean-utils';

const BASE_WS_API_URL = '/ws/rest/v1/';
Expand Down Expand Up @@ -121,7 +121,7 @@ export async function fetchOpenMRSForm(nameOrUUID: string): Promise<OpenmrsForm
* @param {OpenmrsForm} form - The OpenMRS form object.
* @returns {Promise<any | null>} - A Promise that resolves to the fetched ClobData or null if not found.
*/
export async function fetchClobData(form: OpenmrsForm): Promise<any | null> {
export async function fetchClobdata(form: OpenmrsForm): Promise<any | null> {
if (!form) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a better type here or to mark the return type as Promise<unknown | null>. It's more annoying, but hey. Even Record<string, unknown> is substantially better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the o3 module in place, we can as well consider getting rid of this function.

return null;
}
Expand Down
Loading
Loading