mike-jumper commented on a change in pull request #419: GUACAMOLE-302: 
Incorrect password field focus
URL: https://github.com/apache/guacamole-client/pull/419#discussion_r296870679
 
 

 ##########
 File path: guacamole/src/main/webapp/app/login/directives/login.js
 ##########
 @@ -188,17 +197,38 @@ angular.module('login').directive('guacLogin', [function 
guacLogin() {
 
                     // Clear all remaining fields that are not username fields
                     angular.forEach($scope.remainingFields, function 
clearEnteredValueIfPassword(field) {
-
+                        
                         // If field is not username field, delete it.
                         if (field.type !== Field.Type.USERNAME && field.name 
in $scope.enteredValues)
                             delete $scope.enteredValues[field.name];
-
+                        
                     });
+
                 }
 
             }));
 
         };
+        
+        /**
+         * Returns the field most relevant to the user given the current state
+         * of the login process. This will normally be the first empty field.
+         *
+         * @return {Field}
+         *     A field object if an incorrect ligin is attempted, null if no
 
 Review comment:
   "ligin"
   
   Typo aside, what does this function have to do with incorrect login? This 
function looks only at the current state of the login process - what values 
have been entered, what values remain, etc. It isn't aware of whether login was 
incorrect.
   
   I'd also like to point out that "a field object" doesn't provide much more 
information beyond what is already given by `@return {Field}`. The 
documentation for the function itself covers this, but the documentation for 
the return value should also.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to