Skip to content

Commit

Permalink
(chore) O3-3114: Bump react form engine (#1809)
Browse files Browse the repository at this point in the history
(chore) Bump react form engine
  • Loading branch information
CynthiaKamau authored Apr 24, 2024
1 parent c97f48a commit 9c2ded0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { InlineLoading } from '@carbon/react';
import { OHRIForm } from '@openmrs/openmrs-form-engine-lib';
import { FormEngine } from '@openmrs/openmrs-form-engine-lib';
import { type Visit } from '@openmrs/esm-framework';
import useFormSchema from '../hooks/useFormSchema';
import FormError from './form-error.component';
Expand Down Expand Up @@ -51,7 +51,7 @@ const FormRenderer: React.FC<FormRendererProps> = ({
return (
<>
{schema && (
<OHRIForm
<FormEngine
encounterUUID={encounterUuid}
patientUUID={patientUuid}
visit={visit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useFormSchema from '../hooks/useFormSchema';
const mockUseFormSchema = useFormSchema as jest.Mock;

jest.mock('@openmrs/openmrs-form-engine-lib', () => ({
OHRIForm: jest
FormEngine: jest
.fn()
.mockImplementation(() => React.createElement('div', { 'data-testid': 'openmrs form' }, 'FORM ENGINE LIB')),
}));
Expand Down
4 changes: 2 additions & 2 deletions packages/esm-form-engine-app/src/hooks/useFormSchema.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useSWR from 'swr';

import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
import { type OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib';
import { type FormSchema } from '@openmrs/openmrs-form-engine-lib';

/**
* Custom hook to fetch form schema based on its form UUID.
Expand All @@ -12,7 +12,7 @@ import { type OHRIFormSchema } from '@openmrs/openmrs-form-engine-lib';
const useFormSchema = (formUuid: string) => {
const url = formUuid ? `${restBaseUrl}/o3/forms/${formUuid}` : null;

const { data, error, isLoading } = useSWR<{ data: OHRIFormSchema }>(url, openmrsFetch);
const { data, error, isLoading } = useSWR<{ data: FormSchema }>(url, openmrsFetch);

return { schema: data?.data, error, isLoading };
};
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4901,8 +4901,8 @@ __metadata:
linkType: hard

"@openmrs/openmrs-form-engine-lib@npm:next":
version: 1.1.0-pre.698
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.1.0-pre.698"
version: 1.1.0-pre.713
resolution: "@openmrs/openmrs-form-engine-lib@npm:1.1.0-pre.713"
dependencies:
ace-builds: "npm:^1.4.12"
classnames: "npm:^2.5.1"
Expand All @@ -4923,7 +4923,7 @@ __metadata:
react-i18next: 11.x
rxjs: 6.x
swr: 2.x
checksum: 10/c3bcfbf98b00e7a698989537547ce5fe688a96e581a422e842a59cf1194ed8bd94f117b39fe1e2c156e4bd1ade77bca498150db6f332a5d3cc325f133db6017e
checksum: 10/33c32e134b871629ea2e683b7842cfe49d07a90e68c39a8a1f9665a47ad0562f8020c630a645e80d920623116e05f053fd689dc73d1f106b92d84e8049a1f76e
languageName: node
linkType: hard

Expand Down

0 comments on commit 9c2ded0

Please sign in to comment.