diff --git a/i18n/appointments/locale_en.json b/i18n/appointments/locale_en.json index 4e3085f42..54dd4ea49 100644 --- a/i18n/appointments/locale_en.json +++ b/i18n/appointments/locale_en.json @@ -109,6 +109,7 @@ "APPOINTMENT_COMMENTS": "Comments", "APPOINTMENT_CATEGORY": "Category", "APPOINTMENT_CREATION_DATE": "Date Created", + "APPOINTMENT_WAITLIST": "Waitlist", "CHECK_IN_APPOINTMENT": "Check-in", "COMPLETE_APPOINTMENT": "Complete", "MISSED_APPOINTMENT": "Missed", diff --git a/src/controllers/manage/list/appointmentsListViewController.js b/src/controllers/manage/list/appointmentsListViewController.js index c110ddf0b..a88547344 100644 --- a/src/controllers/manage/list/appointmentsListViewController.js +++ b/src/controllers/manage/list/appointmentsListViewController.js @@ -50,8 +50,8 @@ angular.module('bahmni.appointments') {heading: 'APPOINTMENT_START_TIME_KEY', sortInfo: 'startDateTime', enable: $scope.enableColumnsForAppointments}, {heading: 'APPOINTMENT_END_TIME_KEY', sortInfo: 'endDateTime', enable: $scope.enableColumnsForAppointments}, {heading: 'APPOINTMENT_PROVIDER', sortInfo: 'provider.name', class: true, enable: true}, - {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'comments', class: true, enable: !$scope.enableColumnsForAppointments}, - {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', enable: $scope.enableSpecialities}, + {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'priority', class: true, enable: !$scope.enableColumnsForAppointments}, + {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', class: true, enable: $scope.enableSpecialities}, {heading: 'APPOINTMENT_SERVICE', sortInfo: 'service.name', class: true, enable: true}, {heading: 'APPOINTMENT_SERVICE_TYPE_FULL', sortInfo: 'serviceType.name', class: true, enable: $scope.enableServiceTypes}, {heading: 'APPOINTMENT_STATUS', sortInfo: 'status', enable: true}, @@ -84,7 +84,7 @@ angular.module('bahmni.appointments') $scope.filteredAppointments = appointmentsFilter($scope.appointments, $stateParams.filterParams); if($scope.getCurrentTabName() === AWAITING_APPOINTMENTS_TAB_NAME){ modifyAppointmentPriorities(); - $scope.filteredAppointments = _.sortBy($scope.filteredAppointments, "dateCreated").reverse(); + $scope.filteredAppointments = _.sortBy($scope.filteredAppointments, "dateCreated"); } $rootScope.appointmentsData = $scope.filteredAppointments; updateSelectedAppointment(); @@ -137,6 +137,12 @@ angular.module('bahmni.appointments') } }; + $scope.translateAppointmentStatus = function (appointmentStatus) { + if(appointmentStatus === APPOINTMENT_STATUS_WAITLIST.status) + return $translate.instant("APPOINTMENT_WAITLIST"); + return appointmentStatus; + } + $scope.getCurrentTabName = function(){ return $state.current.tabName; } diff --git a/src/views/manage/list/listView.html b/src/views/manage/list/listView.html index 58d09f74e..fe246809f 100644 --- a/src/views/manage/list/listView.html +++ b/src/views/manage/list/listView.html @@ -44,10 +44,10 @@ {{::appointment.priority}} - {{::appointment.service.speciality.name}} + {{::appointment.service.speciality.name}} {{::appointment.service.name}} {{::appointment.serviceType && (appointment.serviceType.name + ' [' + appointment.serviceType.duration + ' min]')}} - {{appointment.status}} + {{::translateAppointmentStatus(appointment.status)}} {{:: isWalkIn(appointment.appointmentKind)}} {{::appointment.location.name}} {{display(appointment.additionalInfo)}} diff --git a/test/controllers/manage/list/appointmentsListViewController.spec.js b/test/controllers/manage/list/appointmentsListViewController.spec.js index 0a00f5414..9e40f7935 100644 --- a/test/controllers/manage/list/appointmentsListViewController.spec.js +++ b/test/controllers/manage/list/appointmentsListViewController.spec.js @@ -716,8 +716,8 @@ describe('AppointmentsListViewController', function () { {heading: 'APPOINTMENT_START_TIME_KEY', sortInfo: 'startDateTime', enable: true}, {heading: 'APPOINTMENT_END_TIME_KEY', sortInfo: 'endDateTime', enable: true}, {heading: 'APPOINTMENT_PROVIDER', sortInfo: 'provider.name', class: true, enable: true}, - {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'comments', class: true, enable: false}, - {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', enable: true}, + {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'priority', class: true, enable: false}, + {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', class: true, enable: true}, {heading: 'APPOINTMENT_SERVICE', sortInfo: 'service.name', class: true, enable: true}, {heading: 'APPOINTMENT_SERVICE_TYPE_FULL', sortInfo: 'serviceType.name', class: true, enable: true}, {heading: 'APPOINTMENT_STATUS', sortInfo: 'status', enable: true}, @@ -1576,8 +1576,8 @@ describe('AppointmentsListViewController', function () { {heading: 'APPOINTMENT_START_TIME_KEY', sortInfo: 'startDateTime', enable: false}, {heading: 'APPOINTMENT_END_TIME_KEY', sortInfo: 'endDateTime', enable: false}, {heading: 'APPOINTMENT_PROVIDER', sortInfo: 'provider.name', class: true, enable: true}, - {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'comments', class: true, enable: true}, - {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', enable: true}, + {heading: 'APPOINTMENT_CATEGORY', sortInfo: 'priority', class: true, enable: true}, + {heading: 'APPOINTMENT_SERVICE_SPECIALITY_KEY', sortInfo: 'service.speciality.name', class: true, enable: true}, {heading: 'APPOINTMENT_SERVICE', sortInfo: 'service.name', class: true, enable: true}, {heading: 'APPOINTMENT_SERVICE_TYPE_FULL', sortInfo: 'serviceType.name', class: true, enable: true}, {heading: 'APPOINTMENT_STATUS', sortInfo: 'status', enable: true},