Skip to content

Commit

Permalink
Add steps to switch to rfe in developer section
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaKamau committed Mar 28, 2024
1 parent 0406596 commit 9bfdf93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/docs/developer-guide/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"contributing-guide": "Contributing Guide",
"run-form-engine-in-openmrs3": "Running the Form Engine against an OpenMRS 3.x frontend"
"run-form-engine-in-openmrs3": "Running the Form Engine against an OpenMRS 3.x frontend",
"switch-afe-to-rfe": "Switch from launching forms with angular form engine to react form engine"
}
26 changes: 26 additions & 0 deletions pages/docs/developer-guide/switch-afe-to-rfe.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Callout } from 'nextra-theme-docs'

# Switching to the React Form Engine for Launching Forms

[OpenMRS 3.x](https://dev3.openmrs.org/openmrs) (O3) has a wrapper for the React Form Engine , just like the angular form engine, which provides the flexibility to switch
between form engines using import maps. This is because the main form component in the angular form engine and the react form engine are exposed through the `form-widget-slot` and in an instance where the angular form engine is not present, the main form widget can be found in the react form engine through the `form-widget-slot`.

The angular form engine wrapper exists in [esm-form-entry-app](https://github.com/openmrs/openmrs-esm-patient-chart/tree/main/packages/esm-form-entry-app) on the patient chart and the react form engine wrapper exisits in [esm-form-engine-app](https://github.com/openmrs/openmrs-esm-patient-chart/tree/main/packages/esm-form-engine-app) on the patient chart as well.
To use the react form engine for launching forms, ensure you add the `esm-form-engine-app` to your import map and remove the `esm-form-entry-app` from your import map.

## Steps

Replace this line :
```
"@openmrs/esm-form-entry-app": "next",
```
With this line :
```
"@openmrs/esm-form-engine-app": "next",
```
in the `frontend/spa-build-config.json` file of your distro or equivalent file that stores import maps in your distro.

<Callout emoji="ℹ️" type="info">
In an instance where you have both `esm-form-entry-app` and `esm-form-engine-app` in your import map, the forms will be launched using the angular form engine. To utilize
the react form engine, it is recommended to retain `esm-form-engine-app` and remove `esm-form-entry-app` from your import map.
</Callout>

0 comments on commit 9bfdf93

Please sign in to comment.