Skip to content

Commit

Permalink
(chore) Fix ModalDefinition typo (openmrs#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandones authored Apr 18, 2024
1 parent fec3cbc commit f4b1cc3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,9 @@ ___

___

### ModalDefintion
### ModalDefinition

Ƭ **ModalDefintion**: { `name`: `string` } & { `component`: `string` } \| { `component?`: `never` }
Ƭ **ModalDefinition**: { `name`: `string` } & { `component`: `string` } \| { `component?`: `never` }

A definition of an modal as extracted from an app's routes.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ___

### modals

`Optional` **modals**: [`ModalDefintion`](../API.md#modaldefintion)[]
`Optional` **modals**: [`ModalDefinition`](../API.md#modaldefinition)[]

An array of all modals supported by this frontend module. Modals can be launched by name.

Expand Down
4 changes: 2 additions & 2 deletions packages/framework/esm-globals/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export type ExtensionDefinition = {
/**
* A definition of an modal as extracted from an app's routes.json
*/
export type ModalDefintion = {
export type ModalDefinition = {
/**
* The name of this modal. This is used to launch the modal.
*/
Expand Down Expand Up @@ -285,7 +285,7 @@ export interface OpenmrsAppRoutes {
/**
* An array of all modals supported by this frontend module. Modals can be launched by name.
*/
modals?: Array<ModalDefintion>;
modals?: Array<ModalDefinition>;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/shell/esm-app-shell/src/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
OpenmrsAppRoutes,
RouteDefinition,
ExtensionRegistration,
ModalDefintion,
ModalDefinition,
} from '@openmrs/esm-framework';
import { attach, registerExtension, importDynamic } from '@openmrs/esm-framework';
import { type ActivityFn, type LifeCycles, pathToActiveWhen, registerApplication } from 'single-spa';
Expand Down Expand Up @@ -132,7 +132,7 @@ export function registerApp(appName: string, routes: OpenmrsAppRoutes) {
registerModuleWithConfigSystem(appName);

const availableExtensions: Array<ExtensionDefinition> = routes.extensions ?? [];
const availableModals: Array<ModalDefintion> = routes.modals ?? [];
const availableModals: Array<ModalDefinition> = routes.modals ?? [];

routes.pages?.forEach((p) => {
if (
Expand Down Expand Up @@ -329,7 +329,7 @@ supported, so the extension will not be loaded.`,
* @param appName The name of the app defining this modal
* @param modal An object that describes the modal, derived from `routes.json`
*/
export function tryRegisterModal(appName: string, modal: ModalDefintion) {
export function tryRegisterModal(appName: string, modal: ModalDefinition) {
const name = modal.name;
if (!name) {
console.error(
Expand Down

0 comments on commit f4b1cc3

Please sign in to comment.