Skip to content

Commit

Permalink
Merge pull request #19 from Bahmni-Covid19/teleconsulation_bug
Browse files Browse the repository at this point in the history
Teleconsulation bug
  • Loading branch information
swatigogia2020 authored Jan 25, 2021
2 parents d144a7f + 6042d14 commit 5d23fd3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions openmrs/apps/customDisplayControl/js/customControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ angular.module('bahmni.common.displaycontrol.custom')
$q.all([getUpcomingAppointments(), getPastAppointments()]).then(function (response) {
$scope.upcomingAppointments = response[0].data;
$scope.upcomingAppointmentsUUIDs = [];
$scope.teleconsultationAppointments = [];
for (var i=0; i<$scope.upcomingAppointments.length; i++) {
$scope.upcomingAppointmentsUUIDs[i] = $scope.upcomingAppointments[i].uuid;
$scope.teleconsultationAppointments[i] = $scope.upcomingAppointments[i].DASHBOARD_APPOINTMENTS_TELECONSULTATION;
delete $scope.upcomingAppointments[i].uuid;
delete $scope.upcomingAppointments[i].DASHBOARD_APPOINTMENTS_TELECONSULTATION;
}
$scope.upcomingAppointmentsHeadings = _.keys($scope.upcomingAppointments[0]);
$scope.pastAppointments = response[1].data;
Expand All @@ -195,6 +198,10 @@ angular.module('bahmni.common.displaycontrol.custom')
var jitsiMeetingId = $scope.upcomingAppointmentsUUIDs[appointmentIndex];
appService.setTeleConsultationVars(jitsiMeetingId, true);
};
$scope.showJoinTeleconsultationOption = function (appointmentIndex) {
return $scope.upcomingAppointments[appointmentIndex].DASHBOARD_APPOINTMENTS_STATUS_KEY == 'Scheduled' &&
$scope.teleconsultationAppointments[appointmentIndex];
}
};
return {
restrict: 'E',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 class="section-title" ng-click="goToListView()"><span style="border-bottom:
{{detail}}
</td>
<td>
<button style="background: #669998; color: white;" ng-if="appointment.DASHBOARD_APPOINTMENTS_STATUS_KEY == 'Scheduled' && appointment.DASHBOARD_APPOINTMENTS_TELECONSULTATION == true" ng-click="openJitsiMeet($index)">
<button style="background: #669998; color: white;" ng-if="showJoinTeleconsultationOption($index)" ng-click="openJitsiMeet($index)">
Join Teleconsultation
</button>
</td>
Expand Down

0 comments on commit 5d23fd3

Please sign in to comment.