diff options
Diffstat (limited to 'ecomp-portal-FE-common/client/app/views/users')
10 files changed, 252 insertions, 175 deletions
diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.ack.html b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.ack.html index e3bcf0a4..17b8b595 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.ack.html +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.ack.html @@ -19,7 +19,7 @@ --> <div class="new-user-modal"> <div class="search-users-directive"> - <div class="title">Bulk User Upload Acknowledgement</div> + <div id="title" class="title">Bulk User Upload Acknowledgement</div> <div class="main"> <h1>The valid entries have been uploaded.</h1> 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 6df7d240..f7c7adff 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 @@ -17,9 +17,15 @@ limitations under the License. ================================================================================ --> -<div class="bulk-user-modal"> - <div class="title">Bulk User Upload Confirmation</div> - <div class="main"> +<div> + <div class="b2b-modal-header"> + <h2 class="heading-medium" id="newAdmin">Bulk User Upload Confirmation</h2> + <div class="corner-button in"> + <button type="button" class="close" aria-label="Close" id="bulk-user-button-close" + ng-click="$dismiss('cancel')"></button> + </div> + </div> + <div class="b2b-modal-body"> <!-- progress indicator --> <div class="upload-instructions" @@ -73,11 +79,13 @@ </div> </div> - <div class="dialog-control"> - <button id="bulk-user-ok-button" class="btn btn-alt btn-small" ng-class="{disabled: isValidating}" + + </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}" ng-click="updateDB()">Ok</button> - <button id="bulk-user-cancel-button" class="btn btn-alt btn-small" ng-click="cancelUpload()">Cancel</button> - + <button id="bulk-user-cancel-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button> </div> </div> </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 8c9420d4..1e169953 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 @@ -23,7 +23,7 @@ 'use strict'; (function () { class BulkUserModalCtrl { - constructor($scope, $log, $filter, $q, usersService, applicationsService, confirmBoxService, functionalMenuService, ngDialog) { + constructor($scope, $log, $filter, $q, usersService, applicationsService, confirmBoxService, functionalMenuService, ngDialog,$modal) { // Set to true for copious console output var debug = false; @@ -486,10 +486,13 @@ // Start the process $scope.readValidateFile(); // Dialog shows progress - ngDialog.open({ - templateUrl: 'app/views/users/new-user-dialogs/bulk-user.confirm.html', - scope: $scope - }); + $modal.open({ + templateUrl: 'app/views/users/new-user-dialogs/bulk-user.confirm.html', + controller: '', + sizeClass: 'modal-medium', + resolve:'', + scope: $scope + }) }; // Invoked by the Cancel button on the confirmation dialog. @@ -500,7 +503,7 @@ init(); } // constructor } // class - BulkUserModalCtrl.$inject = ['$scope', '$log', '$filter', '$q', 'usersService', 'applicationsService', 'confirmBoxService', 'functionalMenuService', 'ngDialog']; + BulkUserModalCtrl.$inject = ['$scope', '$log', '$filter', '$q', 'usersService', 'applicationsService', 'confirmBoxService', 'functionalMenuService', 'ngDialog','$modal']; angular.module('ecompApp').controller('BulkUserModalCtrl', BulkUserModalCtrl); angular.module('ecompApp').directive('fileChange', ['$parse', function($parse){ 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 7945e54a..69f2de08 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 @@ -17,44 +17,53 @@ limitations under the License. ================================================================================ --> -<div class="bulk-user-modal"> - <div class="title">Bulk User Upload</div> - <div class="main"> - <div ng-show="bulkUser.step1"> - <div class="upload-instructions">Select Application:</div> - <div class="c-ecomp-portal-abs-select default"> - - <select id="bulk-user-dropdown-apps" name="dropdown1" b2b-dropdown ng-model="selectedApplication.value" ng-disabled="isProcessing" ng-class="{disabled: isProcessing}"> - <option b2b-dropdown-list option-repeat="d in adminApps" value="{{d.value}}">{{d.title}}</option> - </select> - - </div> +<div> + <div class="b2b-modal-header"> + <h2 class="heading-medium" id="newAdmin">Bulk User Upload</h2> + <div class="corner-button in"> + <button type="button" class="close" aria-label="Close" id="bulkuser-button-close" + ng-click="$dismiss('cancel')"></button> </div> - - <div ng-hide="bulkUser.step1"> - <div class="upload-instructions">Select Upload File:</div> - - <!-- input type=file is difficult to style. - Instead use a label styled as a button. --> - <label class="file-label"> - <input type="file" - file-change="fileChangeHandler($event,files)" - ng-model="fileModel" /> - <span>Browse...</span> - </label>{{selectedFile}} - <div class="upload-instructions">File must have one entry per line with this format: - <pre>orgUserId, role name</pre> + </div> + <div class="b2b-modal-body"> + <div class="b2b-modal-body-div"> + <div ng-show="bulkUser.step1"> + <div class="upload-instructions">Select Application:</div> + <div class="c-ecomp-portal-abs-select default"> + + <select id="bulk-user-dropdown-apps" name="dropdown1" b2b-dropdown ng-model="selectedApplication.value" ng-disabled="isProcessing" ng-class="{disabled: isProcessing}"> + <option b2b-dropdown-list option-repeat="d in adminApps" value="{{d.value}}">{{d.title}}</option> + </select> + + </div> </div> + + <div ng-hide="bulkUser.step1"> + <div class="upload-instructions">Select Upload File:</div> + + <!-- input type=file is difficult to style. + Instead use a label styled as a button. --> + <label class="file-label"> + <input type="file" + file-change="fileChangeHandler($event,files)" + ng-model="fileModel" /> + <span>Browse...</span> + </label>{{selectedFile}} + <div class="upload-instructions">File must have one entry per line with this format: + <pre>orgUserId, role name</pre> + </div> + </div> + + <!-- progress indicator in middle --> + <div ng-show="isProcessing"> + <span class="ecomp-spinner"></span> + </div> + <br> </div> - - <!-- progress indicator in middle --> - <div ng-show="isProcessing"> - <span class="ecomp-spinner"></span> - </div> - - <div class="dialog-control"> - - <button id="bulk-user-back-button" class="btn btn-alt btn-small" + </div> + <div class="b2b-modal-footer"> + <div class="cta-button-group in"> + <button id="bulk-user-back-button" class="btn btn-alt btn-small" ng-hide="bulkUser.step1" ng-click="navigateBack()">Back</button> <button id="bulk-user-next-button" class="btn btn-alt btn-small" ng-hide="!bulkUser.step1" ng-click="!isProcessing && step2()" @@ -64,7 +73,7 @@ ng-click="bulkUser.fileSelected && confirmUpload()" ng-class="{disabled: !bulkUser.fileSelected}">Upload</button> <button id="bulk-user-cancel-button" class="btn btn-alt btn-small" - ng-click="closeThisDialog()">Cancel</button> + ng-click="$dismiss('cancel')">Cancel</button> </div> </div> </div> diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.less b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.less index b6ee63f8..07afd90b 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.less +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.less @@ -2,7 +2,7 @@ height: 430px; .title { - .dGray18r; //AT&T Dark Gray + .dGray18r; border-bottom: @blue-active 3px solid; } @@ -58,3 +58,6 @@ } } +.b2b-modal-body-div{ + height:250px; +} 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 6550a1ee..5367ecf8 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 @@ -23,7 +23,7 @@ 'use strict'; (function () { class NewUserModalCtrl { - constructor($scope, $log, usersService, applicationsService, confirmBoxService) { + constructor($scope, $log, usersService, applicationsService, confirmBoxService, items) { var extRequestValue = false; let init = () => { //$log.info('NewUserModalCtrl::init'); @@ -31,9 +31,9 @@ this.anyChanges = false; this.adminApps = []; this.isGettingAdminApps = false; - if($scope.ngDialogData && $scope.ngDialogData.selectedUser && $scope.ngDialogData.dialogState){ - this.selectedUser = $scope.ngDialogData.selectedUser; - this.dialogState = $scope.ngDialogData.dialogState; + if(items && items.selectedUser && items.dialogState){ + this.selectedUser = items.selectedUser; + this.dialogState = items.dialogState; this.isShowBack = false; if(this.dialogState === 3){ this.getUserAppsRoles(); @@ -109,6 +109,13 @@ //$log.debug('NewUserModalCtrl::getUserAppsRoles: got a result for app: ',app.id,': ',app.name,': ',userAppRolesResult); app.appRoles = userAppRolesResult; app.isLoading = false; + for(var i=0;i<app.appRoles.length;i++){ + + if(app.appRoles[i].roleName.indexOf('global_')!=-1){ + app.appRoles[i].roleName='*'+app.appRoles[i].roleName; + + } + } }).catch(err => { $log.error(err); @@ -148,6 +155,12 @@ if (app.isChanged) { //$log.debug('NewUserModalCtrl::updateUserAppsRoles: app roles have changed; going to update: id: ', app.id, '; name: ', app.name); app.isUpdating = true; + for(var i=0;i<app.appRoles.length;i++){ + if(app.appRoles[i].roleName.indexOf('*global_')!=-1){ + app.appRoles[i].roleName=app.appRoles[i].roleName.replace('*',''); + + } + } var newUserAppRoles = { orgUserId: this.selectedUser.orgUserId, appId: app.id, @@ -172,7 +185,7 @@ this.isSaving = false; // hide the spinner } if (this.numberAppsSucceeded === this.adminApps.length) { - $scope.closeThisDialog(true);//close and resolve dialog promise with true (to update the table) + $scope.$dismiss('cancel');//close and resolve dialog promise with true (to update the table) } }) } else { @@ -185,7 +198,7 @@ this.isSaving = false; // hide the spinner } if (this.numberAppsSucceeded === this.adminApps.length) { - $scope.closeThisDialog(true);//close and resolve dialog promise with true (to update the table) + $scope.$dismiss('cancel');//close and resolve dialog promise with true (to update the table) } } }); @@ -212,6 +225,6 @@ }); } } - NewUserModalCtrl.$inject = ['$scope', '$log', 'usersService', 'applicationsService', 'confirmBoxService']; + NewUserModalCtrl.$inject = ['$scope', '$log', 'usersService', 'applicationsService', 'confirmBoxService', 'items']; angular.module('ecompApp').controller('NewUserModalCtrl', NewUserModalCtrl); })(); diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.html b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.html index 5fec021a..b36e8594 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.html +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.html @@ -17,69 +17,100 @@ limitations under the License. ================================================================================ --> -<div class="new-user-modal"> +<style> + .title { + border-bottom: none !important; + } + + .b2b-modal-footer .cta-button-group { + border-top: 0px solid #d2d2d2; + } + + .multiple-select { + width: 250px; + } +</style> - <div class="search-users" ng-show="newUser.dialogState===1"> + <div > + +<div ng-if="newUser.dialogState===1"> - <search-users search-title="New User" - selected-user="newUser.selectedUser"></search-users> + <div class="b2b-modal-header"> + <h2 class="heading-medium" id="newAdmin">New User</h2> - <div class="dialog-control"> - <button class="btn btn-alt btn-small" id="next-button" ng-click="newUser.selectedUser && newUser.getUserAppsRoles()" - ng-class="{disabled: !newUser.selectedUser}">Next - </button> - <button class="btn btn-alt btn-small" id="cancel-button" ng-click="closeThisDialog()">Cancel</button> - - </div> - </div> + <div class="corner-button in"> + <button type="button" class="close" aria-label="Close" id="user-button-close" + ng-click="$dismiss('cancel')"></button> + </div> + </div> - <div class="user-apps-roles" ng-show="newUser.dialogState===3"> - <div class="title" - ng-bind="newUser.selectedUser.firstName + ' ' + newUser.selectedUser.lastName + ' (' + newUser.selectedUser.orgUserId + ')'"></div> - - - <div class="app-roles-main"> - <div class="app-roles-main-title"> - <span class="left">Access and roles:</span> - </div> + <div class="b2b-modal-body" tabindex="0" + aria-label="Modal header text content" role="region"> + <search-users search-title="" selected-user="newUser.selectedUser"></search-users> + </div> - <div class="app-roles-list"> - <div class="app-item" ng-repeat="app in (newUser.adminApps) track by app.id" id="app-name-{{app.name.split(' ').join('-')}}" ng-show="!app.isDeleted"> - <div class="app-item-left" id="div-app-name-{{app.name.split(' ').join('-')}}">{{app.name | elipsis: 27}}</div> - <div class="app-item-right" id="div-app-name-dropdown-{{app.name.split(' ').join('-')}}" ng-show="!app.isError && !app.isLoading && !app.noChanges && !app.isUpdating && !app.isDoneUpdating && !app.isErrorUpdating"> - <multiple-select id="app-roles" - unique-data="{{$index}}" - placeholder="Select roles" - ng-model="app.appRoles" - on-change="newUser.appChanged($index)" - name-attr="roleName" - value-attr="isApplied"></multiple-select> - </div> - <div id="app-item-no-contact" class="app-item-right-error" ng-show="app.isError">{{app.errorMessage}}</div> - <div id="app-item-contacting" class="app-item-right-contacting" ng-show="app.isLoading">Contacting application...</div> - <div id="app-item-no-changes" class="app-item-right-contacting" ng-show="app.noChanges">No changes</div> - <div id="app-item-no-updating" class="app-item-right-contacting" ng-show="app.isUpdating">Updating application...</div> - <div id="app-item-done-updating" class="app-item-right-contacting" ng-show="app.isDoneUpdating">Finished updating application</div> - <div id="app-item-cannot-update" class="app-item-right-error" ng-show="app.isErrorUpdating">Could not update application...</div> - <div id="app-item-delete" class="app-item-delete" ng-click="newUser.deleteApp(app)" ng-show="!app.isLoading && !app.isError"></div> - <div id='ecomp-small-spinner' class="ecomp-small-spinner" ng-show="app.isLoading"></div> - </div> - </div> - - <div class="dialog-control"> - <span id="ecomp-save-spinner" class="ecomp-save-spinner" ng-show="newUser.isSaving || newUser.isGettingAdminApps"></span> - <button id="new-user-back-button" class="btn btn-alt btn-small" ng-show="newUser.isShowBack" ng-click="newUser.navigateBack()">Back</button> - <button id="new-user-save-button" class="btn btn-alt btn-small" ng-click="newUser.updateUserAppsRoles()" - ng-disabled="(newUser.anyChanges == false)">Save - </button> - <button id="new-user-cancel-button" class="btn btn-alt btn-small" ng-click="closeThisDialog()">Cancel</button> - </div> - - </div> - - </div> + <div class="b2b-modal-footer"> + <div class="cta-button-group in"> + <button class="btn btn-alt btn-small" id="next-button" ng-click="newUser.selectedUser && newUser.getUserAppsRoles()" + ng-class="{disabled: !newUser.selectedUser}">Next + </button> + <button id="search-users-button-cancel" + class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button> + </div> + </div> + </div> + <div ng-if="newUser.dialogState===3"> + + <div class="b2b-modal-header"> + <div class="title" + ng-bind="newUser.selectedUser.firstName + ' ' + newUser.selectedUser.lastName + ' (' + newUser.selectedUser.orgUserId + ')'"></div> + + <div class="corner-button in"> + <button type="button" class="close" aria-label="Close" id="div-cancel-button" + ng-click="$dismiss('cancel')"></button> + </div> + </div> + + <div class="b2b-modal-body"> + <div class="app-roles-main-title"> + <span class="left">Access and roles:</span> + </div> + <br/> + <table class="app-roles-list"> + <tr class="app-item" ng-repeat="app in (newUser.adminApps) track by app.id" id="app-name-{{app.name.split(' ').join('-')}}" ng-show="!app.isDeleted"> + <td class="app-item-left" id="div-app-name-{{app.name.split(' ').join('-')}}">{{app.name | elipsis: 27}}</td> + <td class="app-item-right" id="div-app-name-dropdown-{{app.name.split(' ').join('-')}}" ng-show="!app.isError && !app.isLoading && !app.noChanges && !app.isUpdating && !app.isDoneUpdating && !app.isErrorUpdating"> + <multiple-select id="app-roles-{{app.name}}" unique-data="{{$index}}" placeholder="Select roles" + ng-model="app.appRoles" on-change="newUser.appChanged($index)" name-attr="roleName" + value-attr="isApplied"></multiple-select> + </td> + <td id="app-item-no-contact" class="app-item-right-error" ng-show="app.isError">{{app.errorMessage}}</td> + <td id="app-item-contacting" class="app-item-right-contacting" ng-show="app.isLoading">Contacting application...</td> + <td id="app-item-no-changes" class="app-item-right-contacting" ng-show="app.noChanges">No changes</td> + <td id="app-item-no-updating" class="app-item-right-contacting" ng-show="app.isUpdating">Updating application...</td> + <td id="app-item-done-updating" class="app-item-right-contacting" ng-show="app.isDoneUpdating">Finished updating application</td> + <td id="app-item-cannot-update" class="app-item-right-error" ng-show="app.isErrorUpdating">Could not update application...</td> + <td id="app-item-delete" ng-click="newUser.deleteApp(app)" ng-show="!app.isLoading && !app.isError" > + <i class="icon-misc-trash"></i> + </td> + <td id='ecomp-small-spinner' class="ecomp-small-spinner" ng-show="app.isLoading"></td> + </tr> + </table > + </div> + + <div class="b2b-modal-footer"> + <div class="cta-button-group in"> + <span id="ecomp-save-spinner" class="ecomp-save-spinner" ng-show="newUser.isSaving || newUser.isGettingAdminApps"></span> + <button id="new-user-back-button" class="btn btn-alt btn-small" ng-show="newUser.isShowBack" ng-click="newUser.navigateBack()">Back</button> + <button id="new-user-save-button" class="btn btn-alt btn-small" ng-click="newUser.updateUserAppsRoles()" + ng-disabled="(newUser.anyChanges == false)">Save + </button> + <button id="new-user-cancel-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</button> + </div> + </div> + </div> </div> diff --git a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.less b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.less index 68c23e52..8a44b110 100644 --- a/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.less +++ b/ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.less @@ -4,7 +4,7 @@ .user-apps-roles{ .title{ //.n18r; - .dGray18r; //AT&T Dark Gray + .dGray18r; border-bottom: @portalDBlue 3px solid; } @@ -50,28 +50,6 @@ vertical-align: middle; } - .app-item-right-error{ - .portalRed; - padding: 7px 7px 7px 7px; - display:inline-block; - width: 45%; - border-radius: 2px; - border: 1px solid @portalLGray; - background: @portalWhite; - vertical-align: middle; - } - - .app-item-right-contacting{ - .portalGreen; - padding: 7px 7px 7px 7px; - display:inline-block; - width: 45%; - border-radius: 2px; - border: 1px solid @portalLGray; - background: @portalWhite; - vertical-align: middle; - } - .app-select-left{ width: 45%; margin-right: 10px; @@ -94,15 +72,9 @@ .app-item-delete{ - .ico_trash_default; - display: inline-block; - vertical-align: 2px; - cursor: pointer; - position: relative; - top: 6px; - color: transparent; - margin-left: 8px; - + margin-right: -20px; + float: right; + margin-top: -22px; } } @@ -110,3 +82,29 @@ } } + + .icon-misc-trash { + font-size: 20px; + } + + .app-item-right-error{ + .portalRed; + padding: 7px 7px 7px 7px; + display:inline-block; + width: 45%; + border-radius: 2px; + border: 1px solid @portalLGray; + background: @portalWhite; + vertical-align: middle; + } + + .app-item-right-contacting{ + .portalGreen; + padding: 7px 7px 7px 7px; + display:inline-block; + width: 45%; + border-radius: 2px; + border: 1px solid @portalLGray; + background: @portalWhite; + vertical-align: middle; + } diff --git a/ecomp-portal-FE-common/client/app/views/users/users.controller.js b/ecomp-portal-FE-common/client/app/views/users/users.controller.js index ac223ed6..f74b167e 100644 --- a/ecomp-portal-FE-common/client/app/views/users/users.controller.js +++ b/ecomp-portal-FE-common/client/app/views/users/users.controller.js @@ -20,7 +20,7 @@ 'use strict'; (function () { class UsersCtrl { - constructor($log, applicationsService, usersService, confirmBoxService, $scope, ngDialog) { + constructor($log, applicationsService, usersService, confirmBoxService, $scope, ngDialog,$modal) { this.$log = $log; $scope.adminAppsIsNull = false; $scope.appsIsDown = false; @@ -114,7 +114,7 @@ } } - this.updateUsersList = () => { + let updateUsersList = () => { $scope.appsIsDown = false; $scope.noUsersInApp = false; // $log.debug('UsersCtrl::updateUsersList: Starting updateUsersList'); @@ -185,19 +185,24 @@ } } } - ngDialog.open({ + + var modalInstance = $modal.open({ templateUrl: 'app/views/users/new-user-dialogs/new-user.modal.html', - controller: 'NewUserModalCtrl', - controllerAs: 'newUser', - data: data - }).closePromise.then(needUpdate => { - if (needUpdate.value === true) { - $log.debug('UsersCtrl::openAddNewUserModal updating table data...'); - this.updateUsersList(); - } - }); + controller: 'NewUserModalCtrl as newUser', + sizeClass: 'modal-medium', + resolve: { + items: function () { + return data; + } + } + }) + + modalInstance.result.finally(function () { + $log.debug('UsersCtrl::openAddNewUserModal updating table data...'); + updateUsersList(); + }); }; - + this.openBulkUserUploadModal = (adminApps) => { let data = null; if (adminApps) { @@ -209,14 +214,21 @@ } } } - ngDialog.open({ - templateUrl: 'app/views/users/new-user-dialogs/bulk-user.modal.html', - controller: 'BulkUserModalCtrl', - controllerAs: 'bulkUser', - data: data - }).closePromise.then(needUpdate => { - this.updateUsersList(); + var modalInstance = $modal.open({ + templateUrl: 'app/views/users/new-user-dialogs/bulk-user.modal.html', + controller: 'BulkUserModalCtrl as bulkUser', + sizeClass: 'modal-medium', + resolve: { + items: function () { + return data; + } + } }); + + modalInstance.result.finally(function () { + $log.debug('UsersCtrl::openAddNewUserModal updating table data...'); + updateUsersList(); + }); }; @@ -226,7 +238,7 @@ } $log.debug('UsersCtrl::openAddNewUserModal:$watch selectedApp -> Fire with: ', newVal); this.accountUsers = []; //reset table and show swirl here - this.updateUsersList(); + updateUsersList(); }); $scope.$on('$destroy', () => { @@ -239,6 +251,6 @@ init(); } } - UsersCtrl.$inject = ['$log', 'applicationsService', 'usersService', 'confirmBoxService', '$scope', 'ngDialog']; + UsersCtrl.$inject = ['$log', 'applicationsService', 'usersService', 'confirmBoxService', '$scope', 'ngDialog','$modal']; angular.module('ecompApp').controller('UsersCtrl', UsersCtrl); })(); diff --git a/ecomp-portal-FE-common/client/app/views/users/users.tpl.html b/ecomp-portal-FE-common/client/app/views/users/users.tpl.html index 606ced6e..b1a02102 100644 --- a/ecomp-portal-FE-common/client/app/views/users/users.tpl.html +++ b/ecomp-portal-FE-common/client/app/views/users/users.tpl.html @@ -34,8 +34,8 @@ <div> <input id="input-table-search" placeholder="Search" class="table-search-field" type="text" data-ng-model="users.searchString"> </div> - <button class="btn btn-alt btn-small" ng-click="users.openAddNewUserModal()"><i class="icon-people-userbookmark" aria-hidden="true"></i> Add User</button> - <button class="btn btn-alt btn-small" ng-click="users.openBulkUserUploadModal()"><i class="icon-arrows-upload" aria-hidden="true"></i> Bulk Upload</button> + <button class="btn btn-alt btn-small" id="users-button-add" ng-click="users.openAddNewUserModal()"><i class="icon-people-userbookmark" aria-hidden="true"></i> Add User</button> + <button class="btn btn-alt btn-small" id="users-bulk-upload-button-add" ng-click="users.openBulkUserUploadModal()"><i class="icon-arrows-upload" aria-hidden="true"></i> Bulk Upload</button> </div> </div> <div ng-hide="users.isLoadingTable"> @@ -73,11 +73,11 @@ </thead> <tbody b2b-table-row type="body" row-repeat="rowData in users.accountUsers" class="table-users-div"> <tr ng-click="users.openAddNewUserModal(rowData)"> - <td b2b-table-body id="rowheader_t1_{{$index}}" headers="col1" ng-bind="rowData.firstName"></td> - <td b2b-table-body headers="rowheader_t1_{{$index}} col2" ng-bind="rowData.lastName"></td> - <td b2b-table-body headers="rowheader_t1_{{$index}} col3" ng-bind="rowData.orgUserId"></td> - <td b2b-table-body headers="rowheader_t1_{{$index}} col4"> - <div class="ecomp-table-repeat" ng-repeat="role in rowData.roles" ng-bind="role.name"></div> + <td b2b-table-body id="rowheader_t1_{{$index}}-firstName" headers="col1" ng-bind="rowData.firstName"></td> + <td b2b-table-body id="rowheader_t1_{{$index}}-lastName" headers="col2" ng-bind="rowData.lastName"></td> + <td b2b-table-body id="rowheader_t1_{{$index}}-orgUserId" headers="col3" ng-bind="rowData.orgUserId"></td> + <td b2b-table-body id="rowheader_t1_{{$index}}" headers="col4"> + <div class="ecomp-table-repeat" id="rowheader_t1_{{$index}}" ng-repeat="role in rowData.roles" ng-bind="role.name"></div> </td> </tr> </tbody> |