summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/users
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/users')
-rw-r--r--ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html10
-rw-r--r--ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js20
2 files changed, 24 insertions, 6 deletions
diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html
index 2fadad37..a224cd58 100644
--- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html
+++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html
@@ -53,8 +53,14 @@
<br>
<span class="ecomp-spinner"></span>
</div>
+
+ <!-- progress indicator -->
+ <div class="upload-instructions"
+ ng-show="isProcessedRecords">
+ {{conformMsg}}
+ </div>
- <div ng-hide="isProcessing">
+ <div ng-hide="isProcessing || isProcessedRecords">
<div class="upload-instructions">
Click OK to upload the valid requests.
Invalid requests will be ignored.</div>
@@ -101,7 +107,7 @@
</div>
<div class="b2b-modal-footer">
<div class="cta-button-group in">
- <button id="bulk-user-ok-button" class="btn btn-alt btn-small" ng-class="{disabled: isValidating}"
+ <button id="bulk-user-ok-button" class="btn btn-alt btn-small" ng-disabled="isProcessedRecords" ng-class="{disabled: isValidating}"
ng-click="updateDB()">Ok</button>
<button id="bulk-user-cancel-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button>
</div>
diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js
index 3fcc85f9..2e8018ec 100644
--- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js
+++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js
@@ -65,6 +65,8 @@
// Flag that indicates background work is proceeding
$scope.isProcessing = true;
+
+ $scope.isProcessedRecords = false;
// Load user's admin applications
applicationsService.getAdminApps().promise().then(apps => {
@@ -91,9 +93,11 @@
$scope.selectedApplication = $scope.adminApps[0];
}
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
}).catch(err => {
$log.error('BulkUserModalCtrl::init: getAdminApps threw', err);
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
});
}; // init
@@ -149,6 +153,8 @@
*/
$scope.readValidateFile = () => {
$scope.isProcessing = true;
+ $scope.conformMsg = '';
+ $scope.isProcessedRecords = true;
$scope.progressMsg = 'Reading upload file..';
var reader = new FileReader();
reader.onload = function(event) {
@@ -192,22 +198,26 @@
$log.debug('BulkUserModalCtrl::readValidateFile inner-then ends');
$scope.progressMsg = 'Done.';
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
},
function(error) {
$log.error('BulkUserModalCtrl::readValidateFile: failed retrieving user-app roles');
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
}
); // then of app promises
},
function(error) {
$log.error('BulkUserModalCtrl::readValidateFile: failed retrieving user info');
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
}
); // then of user promises
},
function(error) {
$log.error('BulkUserModalCtrl::readValidateFile: failed retrieving app role info');
$scope.isProcessing = false;
+ $scope.isProcessedRecords = false;
}
); // then of role promise
@@ -443,6 +453,8 @@
*/
$scope.updateDB = () => {
$scope.isProcessing = true;
+ $scope.conformMsg = '';
+ $scope.isProcessedRecords = true;
$scope.progressMsg = 'Sending requests to application..';
if (debug)
$log.debug('BulkUserModalCtrl::updateDB: request length is ' + appUserRolesRequest.length);
@@ -476,11 +488,11 @@
// Run all the promises
$q.all(promises).then(function(){
+ $scope.conformMsg = 'Processed ' + numberUsersSucceeded + ' users.';
$scope.isProcessing = false;
- confirmBoxService.showInformation('Processed ' + numberUsersSucceeded + ' users.').then(isConfirmed => {
- // Close the upload-confirm dialog
- ngDialog.close();
- });
+ $scope.isProcessedRecords = true;
+ $scope.uploadFile = [];
+
});
}; // updateDb