-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VO members can re-sign the AUP at any time (#757)
* Add suspended label next to client name * Add API and service methods to change client status * Make client suspension details available to client owner * Add AUP re-sign button * Make re-sign visible only to respective user
- Loading branch information
1 parent
a71b803
commit eac5eb3
Showing
7 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...src/main/webapp/resources/iam/apps/dashboard-app/components/aup/aup.resign.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!-- | ||
Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2016-2021 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<button ng-if="$ctrl.user.aupSignature" | ||
class="btn btn-success btn-block" | ||
style="margin-top: 5px" | ||
ng-click="$ctrl.openSignAUPModal()" | ||
name="sign-aup-btn" ng-if="$ctrl.isMe()"> | ||
<i class="fa fa-file-text-o"></i> | ||
<strong>Re-sign AUP</strong> | ||
</button> |
78 changes: 78 additions & 0 deletions
78
...e/src/main/webapp/resources/iam/apps/dashboard-app/components/aup/aup.resign.component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2016-2021 | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
function ResignModalController($scope, $uibModalInstance, toaster, AupService, user) { | ||
var self = this; | ||
self.enabled = true; | ||
self.user = user; | ||
|
||
self.cancel = function() { | ||
$uibModalInstance.close('Cancelled'); | ||
}; | ||
|
||
self.submit = function() { | ||
self.error = undefined; | ||
self.enabled = false; | ||
AupService.resignAup() | ||
.then(function(res) { | ||
$uibModalInstance.close('AUP signature re-signed succesfully'); | ||
self.enabled = true; | ||
}, function(res) { | ||
self.error = res.data.error; | ||
self.enabled = true; | ||
toaster.pop({ type: 'error', body: self.error}); | ||
}); | ||
}; | ||
} | ||
|
||
function AupResignController($scope, $uibModal, toaster) { | ||
var self = this; | ||
self.enabled = true; | ||
|
||
self.isMe = function () { | ||
return self.userCtrl.isMe(); | ||
}; | ||
|
||
self.openSignAUPModal = function() { | ||
var modalInstance = $uibModal.open({ | ||
templateUrl: '/resources/iam/apps/dashboard-app/templates/home/resignAup.html', | ||
controller: ResignModalController, | ||
controllerAs: 'resignModalCtrl', | ||
resolve: {user: function() { return self.user; }} | ||
}); | ||
|
||
modalInstance.result.then(function(msg) { | ||
toaster.pop({type: 'success', body: msg}); | ||
}, function () { | ||
console.log('Re-sign AUP modal dismissed at: ' + new Date()); | ||
}); | ||
}; | ||
} | ||
|
||
|
||
angular.module('dashboardApp').component('aupResign', { | ||
templateUrl: '/resources/iam/apps/dashboard-app/components/aup/aup.resign.component.html', | ||
bindings: { | ||
user: '<' | ||
}, | ||
controller: [ | ||
'$rootScope', '$uibModal', 'toaster', 'AupService', AupResignController | ||
] | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...in-service/src/main/webapp/resources/iam/apps/dashboard-app/templates/home/resignAup.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2016-2021 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<div class="modal-header"> | ||
<h3 class="modal-title"> | ||
Re-sign Acceptable Usage Policy | ||
</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div ng-if="resignModalCtrl.user.aupSignature.aup.text != null"> | ||
<p id="sign-aup-subtitle">In order to proceed, you need to sign the Acceptable Usage Policy (AUP) for this | ||
organization:</p> | ||
<div class="form-group"> | ||
<div class="aup-text">{{ resignModalCtrl.user.aupSignature.aup.text }}</div> | ||
</div> | ||
</div> | ||
<div ng-if="resignModalCtrl.user.aupSignature.aup.url != null"> | ||
<p id="sign-aup-subtitle"> | ||
In order to proceed, you need to declare that you have read and that you accept the terms of this organization | ||
<a href="{{ resignModalCtrl.user.aupSignature.aup.url }}" target="_blank" rel="noopener noreferrer">Acceptable Usage Policy (AUP).</a> | ||
</p> | ||
</div> | ||
<div class="form-group sign-aup-btns"> | ||
<button id="sign-aup-btn" class="btn btn-success" type="button" ng-click="resignModalCtrl.submit()">I agree with the AUP terms</button> | ||
<button id="sign-aup-btn-cancel" class="btn btn-danger" type="button" ng-click="resignModalCtrl.cancel()">Cancel</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters