File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
src/gui/app/directives/modals/roles Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 6464 </div>
6565 </div>
6666 <div class="modal-footer">
67- <button ng-if="!$ctrl.isNewRole" type="button" class="btn btn-danger pull-left" ng-click="$ctrl.delete ()" uib-tooltip="Delete Role"><i class="fal fa-trash-alt"></i></button>
67+ <button ng-if="!$ctrl.isNewRole" type="button" class="btn btn-danger pull-left" ng-click="$ctrl.showRoleDeleteModal ()" uib-tooltip="Delete Role"><i class="fal fa-trash-alt"></i></button>
6868 <button type="button" class="btn btn-link" ng-click="$ctrl.dismiss()">Cancel</button>
6969 <button type="button" class="btn btn-primary" ng-click="$ctrl.save()">Save</button>
7070 </div>
138138 }
139139 } ;
140140
141- $ctrl . delete = function ( ) {
141+ $ctrl . showRoleDeleteModal = function ( role ) {
142142 if ( $ctrl . isNewRole ) {
143143 return ;
144144 }
145145
146- $ctrl . close ( {
147- $value : {
148- role : $ctrl . role ,
149- action : "delete"
150- }
151- } ) ;
146+ utilityService
147+ . showConfirmationModal ( {
148+ title : "Delete Role" ,
149+ question : "Are you sure you want to delete this role?" ,
150+ confirmLabel : "Delete"
151+ } )
152+ . then ( ( confirmed ) => {
153+ if ( confirmed ) {
154+ $ctrl . close ( {
155+ $value : {
156+ role : $ctrl . role ,
157+ action : "delete"
158+ }
159+ } ) ;
160+ }
161+ } ) ;
152162 } ;
153163
154164 $ctrl . save = function ( ) {
You can’t perform that action at this time.
0 commit comments