Skip to content

Commit 1580435

Browse files
committed
reverts form workspace changes
1 parent 5cc337a commit 1580435

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

packages/esm-nutrition-app/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const datePickerPlaceHolder = 'dd/mm/yyyy';
88
export const dateFormat = 'YYYY-MM-DD';
99
export const datePickerFormat = 'd/m/Y';
1010

11-
export const nutritionFormName = 'Nutrition - Feeding Form';
11+
export const nutritionFormName = 'MSF Nutrition - Feeding Form';
1212
export const nutritionFormUuid = '9ed6d34e-1415-47a6-82e8-30070f859f38';
1313
export const nutritionEncounterName = 'Nutrition';
1414
export const nutritionEncounterUuid = 'efb1ee49-ed60-40f4-aa2e-c45143dc4d49';

packages/esm-nutrition-app/src/utils/helpers.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { launchWorkspace, openmrsFetch } from '@openmrs/esm-framework';
1+
import { openmrsFetch } from '@openmrs/esm-framework';
2+
import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib';
23
import dayjs from 'dayjs';
34
import { launchClinicalViewForm, mealSymbol, getPatientEncounterDates } from './helpers';
45
import { dateFormat } from '../constants';
56

67
jest.mock('@openmrs/esm-patient-common-lib', () => ({
7-
launchWorkspace: jest.fn(),
8+
launchPatientWorkspace: jest.fn(),
89
}));
910

1011
jest.mock('@openmrs/esm-framework', () => ({
@@ -13,15 +14,15 @@ jest.mock('@openmrs/esm-framework', () => ({
1314
}));
1415

1516
describe('launchClinicalViewForm', () => {
16-
it('should call launchWorkspace with correct parameters', () => {
17+
it('should call launchPatientWorkspace with correct parameters', () => {
1718
const form = { name: 'Test Form' } as any;
1819
const patientUuid = 'patient-uuid';
1920
const onFormSave = jest.fn();
2021
const action = 'add';
2122

2223
launchClinicalViewForm(form, patientUuid, onFormSave, action);
2324

24-
expect(launchWorkspace).toHaveBeenCalledWith('patient-form-entry-workspace', {
25+
expect(launchPatientWorkspace).toHaveBeenCalledWith('patient-form-entry-workspace', {
2526
workspaceTitle: form.name,
2627
mutateForm: onFormSave,
2728
formInfo: {

packages/esm-nutrition-app/src/utils/helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { type FormSchema } from '@openmrs/esm-form-engine-lib';
2-
import { launchWorkspace, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
2+
import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
3+
import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib';
34
import dayjs from 'dayjs';
45
import { dateFormat } from '../constants';
56

@@ -13,7 +14,7 @@ export function launchClinicalViewForm(
1314
encounterUuid?: string,
1415
workspaceWindowSize?: 'minimized' | 'maximized',
1516
) {
16-
launchWorkspace('patient-form-entry-workspace', {
17+
launchPatientWorkspace('patient-form-entry-workspace', {
1718
workspaceTitle: form.name,
1819
mutateForm: onFormSave,
1920
formInfo: {

0 commit comments

Comments
 (0)