diff options
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/users/new-user-dialogs')
3 files changed, 13 insertions, 4 deletions
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 2e8018ec..718879a0 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 @@ -134,8 +134,17 @@ // Caches the file name supplied by the event handler. $scope.fileChangeHandler = (event, files) => { - this.fileSelected = true; - this.fileToRead = files[0]; + var fileName = files[0].name; + var validFormats = ['csv', 'txt']; + //Get file extension + var ext = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase(); + //Check for valid format + if(validFormats.indexOf(ext) == -1){ + this.fileSelected = false; + }else{ + this.fileSelected = true; + this.fileToRead = files[0]; + } if (debug) $log.debug("BulkUserModalCtrl::fileChangeHandler: file is ", this.fileToRead); }; // file change handler diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html index e32497bf..88524466 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html @@ -67,7 +67,7 @@ ng-model="fileModel" /> <span>Browse...</span> </label>{{selectedFile}} - <div class="upload-instructions">File must have one entry per line with this format: + <div class="upload-instructions">File must be .csv or .txt and have one entry per line with this format: <pre>orgUserId, role name</pre> </div> </div> diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js index 79cc8d36..512c3a0c 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js @@ -193,7 +193,7 @@ this.numberAppsSucceeded++; }).catch(err => { $log.error(err); - var errorMessage = 'Failed to update the user application roles: ' + err.status; + var errorMessage = 'Failed to update the user application roles: ' + err; if(err.status == 504){ this.numberAppsSucceeded++; errorMessage = 'Request is being processed, please check back later!'; |