LT-117: Remove the user from reviewers of user is logout

This commit is contained in:
Aysel Afsar 2016-04-04 10:35:52 -04:00
parent 2da841bab0
commit 8ee2eaf644
4 changed files with 15 additions and 12 deletions

View File

@ -238,6 +238,11 @@ Template.viewer.onCreated(function() {
// Clear the toolData for this timepoint
var imageId = data.timepoints[timepointId].imageId;
removeToolDataWithMeasurementId(imageId, toolType, measurementId);
// Set reviewer for this timepoint
if (data.timepoints[timepointId].studyInstanceUid) {
Meteor.call('setReviewer',data.timepoints[timepointId].studyInstanceUid);
}
});
// Sync database data with toolData for all the measurements

View File

@ -84,15 +84,16 @@ function getReviewerTipText(reviewers) {
}
// Observe changes on WorklistTabs
// remove the current user from Reviewers if tab is removed
WorklistTabs.find().observe({
removed: function(tab) {
var timepointId = tab.timepointId;
if (!timepointId) {
return;
var contentId = tab.contentid;
var timepointIds = ViewerData[contentId].timepointIds;
if (timepointIds.length > 0) {
timepointIds.forEach(function(timepointId) {
// Remove the current user from Reviewers
Meteor.call('removeReviewer', timepointId);
});
}
// Remove the current user from Reviewers
Meteor.call('removeReviewer', timepointId);
}
});

View File

@ -45,6 +45,8 @@ Template.userAccountMenu.events({
$('#serverInformationModal').modal('show');
},
'click #logoutButton': function() {
// Remove reviewers info for the user
Meteor.call('removeUserFromReviewers', Meteor.userId());
Meteor.logout(function() {
Router.go('/entrySignIn');
});

View File

@ -12,11 +12,6 @@ syncMeasurementAndToolData = function(measurement) {
// Sync the Cornerstone ToolData with this Measurement's timepoint-specific data
syncTimepointDataWithToolData(measurement, timepointData, imageId, toolType);
// Set reviewer for this timepoint
if (measurement.timepoints[key].studyInstanceUid) {
Meteor.call('setReviewer',measurement.timepoints[key].studyInstanceUid);
}
});
};