Skip to content

openmrs/openmrs-esm-clinical-views-builder

Repository files navigation

Node.js CI

OpenMRS ESM Clinical Views Builder

The Clinical Views Builder is a widget used to create OpenMRS clinical views schemas. It enables users to both create new schemas and edit existing ones. It provides an embedded code editor that accepts JSON code. It also provides an interactive editor where users can construct a schema interactively without writing code.

For more information, please see the OpenMRS Frontend Developer Documentation.

Local development

Check out the developer documentation here.

This monorepo uses yarn.

To install the dependencies, run:

yarn

To start a dev server, run:

yarn start

Once the dev server launches, log in and select a location. You will get redirected to the home page. Once there, you can either:

  • Click the App Switcher icon in the top right corner and then click the System Administration link to go the Admin page. Click on the Clinical Views Builder tile to launch the app.
  • Manually navigate to the /openmrs/spa/clinical-views-builder URL.

Running tests

To run tests for all packages, run:

yarn turbo run test

To run tests in watch mode, run:

yarn turbo run test:watch

To run a specific test file, run:

yarn turbo run test -- visit-notes-form

The above command will only run tests in the file or files that match the provided string.

You can also run the matching tests from above in watch mode by running:

yarn turbo run test:watch -- visit-notes-form

To generate a coverage report, run:

yarn turbo run coverage

By default, turbo will cache test runs. This means that re-running tests wihout changing any of the related files will return the cached logs from the last run. To bypass the cache, run tests with the force flag, as follows:

yarn turbo run test --force

To run end-to-end tests, run:

yarn test-e2e

Read the e2e testing guide to learn more about End-to-End tests in this project.

Updating Playwright

The Playwright version in the Bamboo e2e Dockerfile and the package.json file must match. If you update the Playwright version in one place, you must update it in the other.

Troubleshooting

If you notice that your local version of the application is not working or that there's a mismatch between what you see locally versus what's in dev3, you likely have outdated versions of core libraries. To update core libraries, run the following commands:

# Upgrade core libraries
yarn up openmrs@next @openmrs/esm-framework@next

Reset version specifiers to next. Don't commit actual version numbers.

git checkout package.json

Run yarn to recreate the lockfile

yarn

Design Patterns

For documentation about our design patterns, please visit our design system documentation website.

Configuration

Please see the Implementer Documentation for information about configuring modules.

Deployment

See Creating a Distribution for information about adding microfrontends to a distribution.