Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #146 from broadinstitute/develop
Browse files Browse the repository at this point in the history
Patch Release 10/18
  • Loading branch information
rushtong authored Oct 18, 2016
2 parents 6781b6c + af8bab7 commit 491e60f
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<li><a href="#/summary_votes" class="f-left">Votes Statistics</a></li>
<hr>
<li ng-show="$root.currentUser.memberStatus !== 'RESEARCHER'">
<a href="#/reviewed_cases" class="f-left">Reviewed Cases Record</a>
<a ui-sref="reviewed_cases({menu: true})" class="f-left">Reviewed Cases Record</a>
</li>
</ul>
</li>
Expand Down
12 changes: 11 additions & 1 deletion src/app/home-register/home-register.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

function onSignIn(googleUser) {
$rootScope.accessToken = googleUser.getAuthResponse().access_token;
var email = googleUser.getBasicProfile().getEmail();
var user = getUser();
if(isDisplayNameNotNull(user)) {
cmUserService.registerUser(user).$promise.then(
Expand All @@ -31,7 +32,7 @@
}, function (error) {
if (error.status === 409 && isDisplayNameNotNull(user)) {
alert("User already exists.");
$state.go('login');
cmLoginUserService.loginUser(email, $rootScope.accessToken);
}
});
}
Expand All @@ -51,7 +52,16 @@
return user;
}

function signOut() {
cmLoginUserService.logoutUser();
}

window.onSignIn = onSignIn;
window.signOut = signOut;





}

Expand Down
4 changes: 2 additions & 2 deletions src/app/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
<div class="landing-box-brand"><img src="../assets/images/broad_logo.png" alt="Broad Institute Logo"></div>
<div class="landing-box-title"><h3>Broad Data Use Oversight System</h3></div>
<div class="landing-box-google-signin">
<div class="new-sign">Sign in with your broadinstitute google account</div>
<div class="new-sign">Sign in with a google account</div>
<div class="custom-g-signin2 g-signin2" data-theme="dark" data-width="220" data-height="40"
data-longtitle="true" data-onsuccess="onSignIn"
data-scope="profile email"></div>
<div class="new-sign"><span>Don't have a Google Account? Create one <a href="https://accounts.google.com/SignUp?continue=https%3A%2F%2Faccounts.google.com%2Fo%2Foauth2%2Fauth%3Fopenid.realm%26scope%3Demail%2Bprofile%2Bopenid%26response_type%3Dpermission%26redirect_uri%3Dstoragerelay%3A%2F%2Fhttp%2Flocalhost%3A8000%3Fid%253Dauth721210%26ss_domain%3Dhttp%3A%2F%2Flocalhost%3A8000%26client_id%3D832251491634-smgc3b2pogqer1mmdrd3hrqic3leof3p.apps.googleusercontent.com%26fetch_basic_profile%3Dtrue%26hl%3Des-419%26from_login%3D1%26as%3D43c5de35a7316d00&ltmpl=popup" target="_blank">here.</a></span></div>
</div>
</div>
</div>
</div>
</div>
10 changes: 10 additions & 0 deletions src/app/modals/modal-users/edit-user/modal-edit-user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/* ngInject */
function ModalUsers($modalInstance, cmUserService, $scope, user, USER_ROLES) {

$scope.emailPreference = false;

init();

function init() {
Expand Down Expand Up @@ -147,6 +149,14 @@

$scope.edit = function (user) {
var map = {};
var roles = user.roles;
for (var i = 0; i < roles.length; i++) {
if (roles[i].name === USER_ROLES.admin ) {
roles[i].emailPreference = !$scope.emailPreference;
break;
}
}

map.updatedUser = user;
if($scope.delegateDacUser.needsDelegation){
map.userToDelegate = JSON.parse($scope.alternativeDACMemberUser);
Expand Down
3 changes: 3 additions & 0 deletions src/app/results-record/access-results-record.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@
cmRPService.getDarFields(electionReview.election.referenceId, "rus").then(function (data) {
$scope.dar = data;
});
cmRPService.getDarFields(electionReview.election.referenceId, "dar_code").then(function (data) {
$scope.darCode = data.dar_code;
});
$scope.electionAccess = electionReview.election;
if (electionReview.election.finalRationale === null) {
$scope.electionAccess.finalRationale = '';
Expand Down
2 changes: 1 addition & 1 deletion src/app/results-record/access-results-record.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row fsi-row-lg-level fsi-row-md-level title-wrapper">
<img src="assets/images/icon_access.png" alt="Data Access Request icon" class="cm-icons main-icon-title">
<h2 class="main-title margin-sm access-color">
Data Access - Results Record<br>
Data Access - Results Record | {{darCode}}<br>
<div class="main-title-description">Was the researcher allowed to access this research study?</div>
</h2>
</div>
Expand Down
5 changes: 1 addition & 4 deletions src/app/results-record/dul-results-record.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@

function DulResultsRecord($sce, $scope, $state, electionReview, apiUrl, cmFilesService) {




if( typeof electionReview === 'undefined'){
$state.go('reviewed_cases');
return;
}

$scope.consentName = electionReview.consent.name;
$scope.chartData = {
'dulTotal': [
['Results', 'Votes'],
Expand Down
2 changes: 1 addition & 1 deletion src/app/results-record/dul-results-record.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="row fsi-row-lg-level fsi-row-md-level title-wrapper">
<img src="assets/images/icon_dul.png" alt="Data Use Limitations icon" class="cm-icons main-icon-title">
<h2 class="main-title margin-sm dul-color">
Data Use Limitations - Results Record<br>
Data Use Limitations - Results Record | {{consentName}}<br>
<div class="main-title-description">Were the data use limitations accurately converted to a structured format?</div>
</h2>
</div>
Expand Down
26 changes: 25 additions & 1 deletion src/app/reviewed-cases/reviewed-cases.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,34 @@
.controller('ReviewedCases', ReviewedCases);

/* ngInject */
function ReviewedCases(reviewedConsents, reviewedDRs) {
function ReviewedCases(reviewedConsents, reviewedDRs, $scope, $rootScope, $stateParams) {

var vm = this;
vm.electionsList = {'dul': [], 'access': []};

if($stateParams.menu !== true && $rootScope.currentDulPage !== undefined){
$scope.currentDulPage = $rootScope.currentDulPage;
$rootScope.currentDulPage = 1;
} else{
$rootScope.currentDulPage = 1;
$scope.currentDulPage = $rootScope.currentDulPage;
}

$scope.$watch('currentDulPage', function(num) {
$rootScope.currentDulPage = num;
});

if($stateParams.menu !== true && $rootScope.currentDarPage !== undefined){
$scope.currentDarPage = $rootScope.currentDarPage;
$rootScope.currentDarPage = 1;
} else{
$rootScope.currentDarPage = 1;
$scope.currentDarPage = $rootScope.currentDarPage;
}

$scope.$watch('currentDarPage', function(num) {
$rootScope.currentDarPage = num;
});

init();

Expand Down
4 changes: 2 additions & 2 deletions src/app/reviewed-cases/reviewed-cases.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2 class="col-lg-8 col-md-8 col-sm-8 col-xs-12 pvotes-box-title dul-color">
<hr class="pvotes-main-separator">
</div>
<div class="pvotes-box-body">
<div dir-paginate="election in ReviewedCases.electionsList.dul | filter: searchDULcases | itemsPerPage:5" pagination-id="dulCases">
<div dir-paginate="election in ReviewedCases.electionsList.dul | filter: searchDULcases | itemsPerPage:5" pagination-id="dulCases" current-page="currentDulPage">
<hr class="pvotes-separator">
<div class="row pvotes-main-list reviewed-cases-list">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pvotes-list-id">{{election.displayId}}</div>
Expand Down Expand Up @@ -82,7 +82,7 @@ <h2 class="col-lg-8 col-md-8 col-sm-8 col-xs-12 pvotes-box-title access-color">
<hr class="pvotes-main-separator">
</div>
<div class="pvotes-box-body" id="searchTextResults">
<div dir-paginate="election in ReviewedCases.electionsList.access | filter: searchAccessCases | itemsPerPage:5" pagination-id="accessCases">
<div dir-paginate="election in ReviewedCases.electionsList.access | filter: searchAccessCases | itemsPerPage:5" pagination-id="accessCases" current-page="currentDarPage">
<hr class="pvotes-separator">
<div class="row pvotes-main-list admin-users-list">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 pvotes-list-id">{{election.displayId}}</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/reviewed-cases/reviewed-cases.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
data: {
authorizedRoles: [USER_ROLES.member, USER_ROLES.chairperson, USER_ROLES.admin, USER_ROLES.alumni]
},
params: {
menu: null,
},
resolve: {
reviewedConsents: function(cmElectionService){
return cmElectionService.findReviewedConsents();
Expand Down

0 comments on commit 491e60f

Please sign in to comment.