~allenap/maas/regiond-leader

« back to all changes in this revision

Viewing changes to src/maasserver/static/js/angular/controllers/node_details.js

[r=allenap][bug=1449043][author=ubuntudotcom1] Address bug 1449043 by adding a client-side notification when the user attempts to deploy a node but does not have at least one SSH key installed. We are doing this because previously the node action 'Deploy' was hidden when keys were not installed, but without explanation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
            return false;
546
546
        };
547
547
 
 
548
        // Return True if unable to deploy because of missing ssh keys.
 
549
        $scope.isSSHKeyError = function() {
 
550
            // Never a deploy error when there is an action error.
 
551
            if($scope.isActionError()) {
 
552
                return false;
 
553
            }
 
554
            if(angular.isObject($scope.actionOption) &&
 
555
                $scope.actionOption.name === "deploy" &&
 
556
                UsersManager.getSSHKeyCount() === 0) {
 
557
                return true;
 
558
            }
 
559
            return false;
 
560
        };
 
561
 
548
562
        // Called when the actionOption has changed.
549
563
        $scope.actionOptionChanged = function() {
550
564
            // Clear the action error.