@openmrs/esm-form-engine-lib 3.1.2-pre.1721 → 3.1.2-pre.1725

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-form-engine-lib",
3
- "version": "3.1.2-pre.1721",
3
+ "version": "3.1.2-pre.1725",
4
4
  "description": "React Form Engine for O3",
5
5
  "browser": "dist/openmrs-esm-form-engine-lib.js",
6
6
  "main": "src/index.ts",
@@ -4,7 +4,7 @@ import { isTrue } from '../utils/boolean-utils';
4
4
  import { applyFormIntent } from '../utils/forms-loader';
5
5
  import { fetchOpenMRSForm, fetchClobData } from '../api';
6
6
  import { getRegisteredFormSchemaTransformers } from '../registry/registry';
7
- import { moduleName } from '../globals';
7
+ import { formEngineAppName } from '../globals';
8
8
 
9
9
  export function useFormJson(formUuid: string, rawFormJson: any, encounterUuid: string, formSessionIntent: string) {
10
10
  const [formJson, setFormJson] = useState<FormSchema>(null);
@@ -16,7 +16,7 @@ export function useFormJson(formUuid: string, rawFormJson: any, encounterUuid: s
16
16
  const setFormJsonWithTranslations = (formJson: FormSchema) => {
17
17
  if (formJson?.translations) {
18
18
  const language = window.i18next.language;
19
- window.i18next.addResourceBundle(language, moduleName, formJson.translations, true, true);
19
+ window.i18next.addResourceBundle(language, formEngineAppName, formJson.translations, true, true);
20
20
  }
21
21
  setFormJson(formJson);
22
22
  };
@@ -2,14 +2,14 @@ import dayjs from 'dayjs';
2
2
  import { showSnackbar, translateFrom } from '@openmrs/esm-framework';
3
3
  import { getPatientEnrolledPrograms, saveProgramEnrollment } from '../api';
4
4
  import { type PostSubmissionAction, type PatientProgramPayload } from '../types';
5
- import { moduleName } from '../globals';
5
+ import { formEngineAppName } from '../globals';
6
6
  import { extractErrorMessagesFromResponse } from '../utils/error-utils';
7
7
 
8
8
  export const ProgramEnrollmentSubmissionAction: PostSubmissionAction = {
9
9
  applyAction: async function ({ patient, encounters, sessionMode }, config) {
10
10
  const encounter = encounters[0];
11
11
  const encounterLocation = encounter.location['uuid'];
12
- const translateFn = (key, defaultValue?) => translateFrom(moduleName, key, defaultValue);
12
+ const translateFn = (key, defaultValue?) => translateFrom(formEngineAppName, key, defaultValue);
13
13
  const programUuid = config.programUuid;
14
14
 
15
15
  if (sessionMode === 'view') {
@@ -26,7 +26,7 @@ import { FormProcessor } from '../form-processor';
26
26
  import { getPreviousEncounter, saveEncounter } from '../../api';
27
27
  import { hasRendering } from '../../utils/common-utils';
28
28
  import { isEmpty } from '../../validators/form-validator';
29
- import { moduleName } from '../../globals';
29
+ import { formEngineAppName } from '../../globals';
30
30
  import { type FormContextProps } from '../../provider/form-provider';
31
31
  import { useEncounter } from '../../hooks/useEncounter';
32
32
  import { useEncounterRole } from '../../hooks/useEncounterRole';
@@ -110,7 +110,7 @@ export class EncounterFormProcessor extends FormProcessor {
110
110
 
111
111
  async processSubmission(context: FormContextProps, abortController: AbortController) {
112
112
  const { encounterRole, encounterProvider, encounterDate, encounterLocation } = getMutableSessionProps(context);
113
- const translateFn = (key, defaultValue?) => translateFrom(moduleName, key, defaultValue);
113
+ const translateFn = (key, defaultValue?) => translateFrom(formEngineAppName, key, defaultValue);
114
114
  const patientIdentifiers = preparePatientIdentifiers(context.formFields, encounterLocation);
115
115
  const encounter = prepareEncounter(context, encounterDate, encounterRole, encounterProvider, encounterLocation);
116
116