openmrs-module-bahmniapps icon indicating copy to clipboard operation
openmrs-module-bahmniapps copied to clipboard

Fix BAH-423: Date is not retained after patient search

Open dwivedikriti opened this issue 6 years ago • 2 comments

--- In appointmentsSummaryController --- Total count is clicked: - state change to 'home.manage.appointments.list' is triggered, and the date is passed in $stateParams.viewDate

--- In appointmentsListViewController --- Controller is initialized: - $scope.startDate is set to $stateParams.viewDate - datePicker.viewDate is initialized to $scope.startDate (1 way binding) - datePicker change triggers $scope.getAppointmentsForDate, appointments are populated

Date is changed using < or >: - datePicker.viewDate is updated from ngClick directive - datePicker change triggers $scope.getAppointmentsForDate, appointments are populated - $scope.getAppointmentsForDate UPDATES $stateParams.viewDate but LEAVES $scope.startDate UNTOUCHED !!!

User is clicked on from search results: - $scope.displaySearchedPatient shows search results, removes datePicker from DOM

Reset is clicked: - $scope.goBackToPreviousView hides search results, adds datePicker to DOM - datePicker.viewDate is initialized to $scope.startDate which retains old value, WAS NOT UPDATED ON datePicker click

dwivedikriti avatar Mar 24 '18 10:03 dwivedikriti

Hi @dwivedikriti, Thanks for your PR. Your changes look fine but can you please add test cases for the changes. Test case should go to appointmentsListViewController.spec.js file

sumanmaity112 avatar May 11 '18 13:05 sumanmaity112

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 23 '19 12:07 CLAassistant