Skip to content

Commit 8bad6cb

Browse files
authored
A-1208406174218905 | Duplicate notification entries displayed in tab (#1010)
* A-1208424039194249 | Translate Program attributes in active tab * A-1208406174218905 | Fix tx issues in notifications page
1 parent c590085 commit 8bad6cb

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

micro-frontends/src/next-ui/Components/ProviderNotificationPatients/PatientListContent.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {
88
} from "../../utils/providerNotifications/ProviderNotificationUtils";
99
import { verifierFunction} from "../../constants";
1010
import PropTypes from "prop-types";
11-
import { FormattedMessage } from "react-intl";
11+
import { FormattedMessage, useIntl } from "react-intl";
1212

1313
const PatientListContent = ({ patientMedicationDetails, providerUuid , refreshPatients}) => {
1414
const [notes, setNotes] = useState("");
15+
const intl = useIntl();
1516
const { administered_date_time, administered_drug_name, medication_administration_performer_uuid, medication_administration_uuid } =
1617
patientMedicationDetails;
1718

@@ -37,8 +38,10 @@ const PatientListContent = ({ patientMedicationDetails, providerUuid , refreshPa
3738
<div className="notes">
3839
<TextArea
3940
className="patient-list-text-area"
40-
labelText={<Title text={<FormattedMessage id="NOTE" defaultMessage="Note" />} isRequired={true} />}
41-
placeholder={<FormattedMessage id="ENTER_NOTES" defaultMessage="Enter Notes" />}
41+
labelText={
42+
<Title text={intl.formatMessage({id: "NOTE",defaultMessage: "Note"})} isRequired={true}/>
43+
}
44+
placeholder={intl.formatMessage({id: "ENTER_NOTES",defaultMessage: "Enter Notes"})}
4245
rows={1}
4346
required={true}
4447
value={notes}

ui/test/unit/common/uicontrols/programmanagement/controllers/manageProgramController.spec.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
describe("ManageProgramController", function () {
4-
54
var scope, messageService, i = 0, programService, _provide, deferred, q, _spinner,
65
retrospectiveEntryService, listOfPatientPrograms, programAttributeTypes, allPrograms,
76
controller, rootScope, confirmBox, state, translate;
@@ -289,7 +288,6 @@ describe("ManageProgramController", function () {
289288
]
290289
}
291290
];
292-
293291
});
294292

295293
it("should update active programs list", function () {
@@ -316,7 +314,7 @@ describe("ManageProgramController", function () {
316314
it("Should return minimum start date of states", function () {
317315
scope.$apply(setUp);
318316
var maxDate = scope.getMaxAllowedDate(listOfPatientPrograms.activePrograms[0].states);
319-
expect(maxDate).toEqual('2015-07-01')
317+
expect(maxDate).toEqual('2015-07-01');
320318
});
321319

322320
it("Should return current date when there are no states", function () {
@@ -327,7 +325,6 @@ describe("ManageProgramController", function () {
327325
});
328326

329327
describe("Remove program states", function () {
330-
331328
it("should remove latest program state", function () {
332329
scope.$apply(setUp);
333330
scope.removePatientState(listOfPatientPrograms.activePrograms[0]);
@@ -350,14 +347,13 @@ describe("ManageProgramController", function () {
350347

351348
expect(programService.updatePatientProgram).toHaveBeenCalledWith(programToBeUpdated, scope.programAttributeTypes, null);
352349
});
353-
354350
});
355351

356352
describe("updatePatientProgram", function () {
357353
it("should assign the initial state successfully", function () {
358354
scope.$apply(setUp);
359355
var patientProgramToBeUpdated = listOfPatientPrograms.activePrograms[0];
360-
patientProgramToBeUpdated.states = []; //making sure there are no states assigned
356+
patientProgramToBeUpdated.states = []; // making sure there are no states assigned
361357

362358
var newStateUuid = '8917ab09-52b4-4573-aefa-7f6e7bdf6d61';
363359
patientProgramToBeUpdated.selectedState = { uuid: newStateUuid };
@@ -372,13 +368,12 @@ describe("ManageProgramController", function () {
372368
expect(patientProgramToBeUpdated.states[0].startDate).toBe(Bahmni.Common.Util.DateUtil.parseLongDateToServerFormat("2015-07-19"));
373369
expect(patientProgramToBeUpdated.states[0].state.uuid).toBe(newStateUuid);
374370
expect(messageService.showMessage).toHaveBeenCalledWith("info", "CLINICAL_SAVE_SUCCESS_MESSAGE_KEY");
375-
376371
});
377372

378373
it("should update patient program without any state if not provided", function () {
379374
scope.$apply(setUp);
380375
var patientProgramToBeUpdated = listOfPatientPrograms.activePrograms[0];
381-
patientProgramToBeUpdated.states = []; //making sure there are no states assigned
376+
patientProgramToBeUpdated.states = []; // making sure there are no states assigned
382377

383378
patientProgramToBeUpdated.selectedState = undefined;
384379
retrospectiveEntryService.getRetrospectiveDate.and.callFake(function () {
@@ -390,7 +385,6 @@ describe("ManageProgramController", function () {
390385
scope.$digest();
391386
expect(patientProgramToBeUpdated.states.length).toBe(0);
392387
expect(messageService.showMessage).toHaveBeenCalledWith("info", "CLINICAL_SAVE_SUCCESS_MESSAGE_KEY");
393-
394388
});
395389

396390
it("should validate if state to be transited is starting after the current running state", function () {
@@ -413,7 +407,6 @@ describe("ManageProgramController", function () {
413407
var patientProgramToBeUpdated = listOfPatientPrograms.activePrograms[0];
414408
retrospectiveEntryService.getRetrospectiveDate.and.callFake(function () {
415409
return '2015-07-19';
416-
417410
});
418411
var newStateUuid = '8417ab09-52b4-4573-aefa-7f6e7bdf6d61';
419412
expect(patientProgramToBeUpdated.states.length).toBe(2);
@@ -435,7 +428,6 @@ describe("ManageProgramController", function () {
435428
var patientProgramToBeUpdated = listOfPatientPrograms.activePrograms[0];
436429
retrospectiveEntryService.getRetrospectiveDate.and.callFake(function () {
437430
return '2015-07-19';
438-
439431
});
440432
var currentActiveStateUuid = '1317ab09-52b4-4573-aefa-7f6e7bdf6d61';
441433
expect(patientProgramToBeUpdated.states.length).toBe(2);
@@ -458,7 +450,6 @@ describe("ManageProgramController", function () {
458450
var patientProgramToBeUpdated = listOfPatientPrograms.activePrograms[0];
459451
retrospectiveEntryService.getRetrospectiveDate.and.callFake(function () {
460452
return '2015-07-19';
461-
462453
});
463454
programService.updatePatientProgram.and.callFake(function () {
464455
deferred = q.defer();
@@ -471,12 +462,9 @@ describe("ManageProgramController", function () {
471462
scope.$digest();
472463
expect(messageService.showMessage).toHaveBeenCalledWith("error", "Failed to Save");
473464
});
474-
475-
476465
});
477466

478467
describe("end program", function () {
479-
480468
it("should validate if program is ending before the current running state", function () {
481469
scope.$apply(setUp);
482470
var programToBeUpdated = listOfPatientPrograms.activePrograms[0];
@@ -513,7 +501,7 @@ describe("ManageProgramController", function () {
513501

514502
expect(scope.programWorkflowStates.length).toBe(2);
515503
expect(scope.patientProgramAttributes).toEqual({});
516-
})
504+
});
517505
});
518506

519507
describe('get workflows', function () {
@@ -566,7 +554,7 @@ describe("ManageProgramController", function () {
566554
name: 'TB Program',
567555
uuid: 'someUuid'
568556
};
569-
expect(scope.isIncluded(attribute)).toBeFalsy()
557+
expect(scope.isIncluded(attribute)).toBeFalsy();
570558
});
571559

572560
it('should show attributeType for selected program if it is not excluded in the config', function () {
@@ -581,7 +569,7 @@ describe("ManageProgramController", function () {
581569
name: 'TB Program',
582570
uuid: 'someUuid'
583571
};
584-
expect(scope.isIncluded(attribute)).toBeTruthy()
572+
expect(scope.isIncluded(attribute)).toBeTruthy();
585573
});
586574
});
587575
});

0 commit comments

Comments
 (0)