summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs
diff options
context:
space:
mode:
authorhb123f <hbindu@research.att.com>2019-03-20 12:20:44 -0400
committerhb123f <hbindu@research.att.com>2019-03-20 14:13:55 -0400
commita70761c096192e38800bf38d6c7f61f52bf72007 (patch)
treecdc5264cec030bc7e677ff1d74c939c56ee51d0d /ecomp-portal-FE-common/client/app/views/users/new-user-dialogs
parent3992004ee5f2b0b1635e2aef19c375db87079b52 (diff)
CADI AAF Integration and merging the code
Issue-ID: PORTAL-319 CADI AAF Integration and code merge Change-Id: I6e44f3b2741858d8d403b77a49ec9a0153084801 Signed-off-by: hb123f <hbindu@research.att.com>
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/users/new-user-dialogs')
-rw-r--r--ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js13
-rw-r--r--ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html2
-rw-r--r--ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js2
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!';