minor fixes to reset dialog

This commit is contained in:
Girish Ramakrishnan
2021-04-15 11:17:44 -07:00
parent d5201a29da
commit e4076d7a75
4 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -364,7 +364,7 @@
<tr>
<td class="text-right" colspan="2" style="vertical-align: top;">
<br/>
<button class="btn btn-primary" ng-click="twoFactorAuthentication.show()">{{ user.twoFactorAuthenticationEnabled ? 'profile.disable2FAAction' : 'profile.enable2FAAction' | tr }}</button>
<button class="btn" ng-class="user.twoFactorAuthenticationEnabled ? 'btn-danger' : 'btn-success'" ng-click="twoFactorAuthentication.show()">{{ user.twoFactorAuthenticationEnabled ? 'profile.disable2FAAction' : 'profile.enable2FAAction' | tr }}</button>
<button class="btn btn-primary" ng-click="passwordchange.show()" ng-hide="user.source">{{ 'profile.changePasswordAction' | tr }}</button>
</td>
</tr>
+1 -1
View File
@@ -344,7 +344,7 @@
<div>
<p ng-hide="invitation.user.twoFactorAuthenticationEnabled">{{ 'users.passwordResetDialog.no2FASetup' | tr }}</p>
<p ng-show="invitation.user.twoFactorAuthenticationEnabled">{{ 'users.passwordResetDialog.2FAIsSetup' | tr }}</p>
<button type="button" class="btn btn-danger" ng-click="invitation.reset2FA()" ng-show="invitation.user.twoFactorAuthenticationEnabled" ng-disabled="invitation.reset2FABusy"><i class="fa fa-circle-notch fa-spin" ng-show="invitation.reset2FABusy"></i> {{ 'users.passwordResetDialog.disable2FAAction' | tr }}</button>
<button type="button" class="btn btn-danger" ng-click="invitation.reset2FA()" ng-disabled="!invitation.user.twoFactorAuthenticationEnabled || invitation.reset2FABusy"><i class="fa fa-circle-notch fa-spin" ng-show="invitation.reset2FABusy"></i> {{ 'users.passwordResetDialog.disable2FAAction' | tr }}</button>
</div>
</div>
<div class="modal-footer">
+5 -3
View File
@@ -567,11 +567,13 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
$scope.invitation.reset2FABusy = true;
Client.disableTwoFactorAuthenticationByUserId($scope.invitation.user.id, function (error) {
$scope.invitation.reset2FABusy = false;
if (error) return console.error(error);
// ensure to update changed user state
$scope.invitation.user.twoFactorAuthenticationEnabled = false;
$timeout(function () {
$scope.invitation.reset2FABusy = false;
$scope.invitation.user.twoFactorAuthenticationEnabled = false;
}, 3000);
refreshUsers();
});
}