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

Add steps to switch to rfe in developer section #29

Merged
merged 1 commit into from
Mar 28, 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
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>
Loading