openmrs-module-bahmniapps
openmrs-module-bahmniapps copied to clipboard
Fix BAH-423: Date is not retained after patient search
--- 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
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
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.