Skip to content

Commit

Permalink
Display how much time is left to AUP expiry
Browse files Browse the repository at this point in the history
  • Loading branch information
garaimanoj authored Jun 10, 2024
1 parent 56bec4a commit 730a87e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@ <h3 class="profile-username text-center">{{$ctrl.user.name.formatted}}</h3>
</td>
</tr>
<tr ng-if="$ctrl.aupIsEnabled()">
<td class="text-bold text-left">
<td class="text-bold text-left" ng-if="!$ctrl.user.aupSignatureExpiryDate">
Signed AUP
</td>
<td class="text-right" ng-if="$ctrl.hasAupSignatureTime()">
<td class="text-bold text-left" ng-if="$ctrl.user.aupSignatureExpiryDate">
AUP expiration
</td>
<td class="text-right" ng-if="$ctrl.hasAupSignatureTime() && !$ctrl.user.aupSignatureExpiryDate">
{{$ctrl.user.aupSignature.signatureTime | relativeDate }}
</td>
<td class="text-right" ng-if="$ctrl.hasAupSignatureTime() && $ctrl.user.aupSignatureExpiryDate">
{{$ctrl.user.aupSignatureExpiryDate | relativeDate }}
</td>
<td class="text-right" ng-if="!$ctrl.hasAupSignatureTime()">
No AUP signature found
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function UserService($q, $rootScope, scimFactory, Authorities, Utils, AupService
var user = result[0];
if (result[1] !== null) {
user.aupSignature = result[1].data;
if (user.aupSignature.aup.signatureValidityInDays != 0){
user.aupSignatureExpiryDate = new Date(new Date(user.aupSignature.signatureTime).getTime() +
user.aupSignature.aup.signatureValidityInDays * 24 * 60 * 60 * 1000);
}
} else {
user.aupSignature = null;
}
Expand All @@ -63,6 +67,10 @@ function UserService($q, $rootScope, scimFactory, Authorities, Utils, AupService
user.authorities = result[1].data.authorities;
if (result[2] !== null) {
user.aupSignature = result[2].data;
if (user.aupSignature.aup.signatureValidityInDays != 0){
user.aupSignatureExpiryDate = new Date(new Date(user.aupSignature.signatureTime).getTime() +
user.aupSignature.aup.signatureValidityInDays * 24 * 60 * 60 * 1000);
}
} else {
user.aupSignature = null;
}
Expand Down

0 comments on commit 730a87e

Please sign in to comment.