WebUI: User management full implementation.

Added webui user accounts management. This support
both redfish and rest based backend API calls
depending on redfishSupportEnabled flag.
It does following actions:
 - View all user list and there properties like
   name, privilege, enabled state, Locked etc..
 - Create new user account.
 - Delete existing user account.
 - Update the existing user properties like
   password, privilege, enabled state.

Unit Test:
 - Viewed all user information is proper or not.
 - Created new user and validated.
 - Deleted specific user and checked.
 - Modified user info and validated the change.
All tests are done by enabling and disabling
redfishSupportEnabled flag using conifg.json.

Change-Id: Ifecf63844dc42c44771509958bf75947a92997ac
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/app/users/controllers/user-accounts-controller.html b/app/users/controllers/user-accounts-controller.html
index 9d388bc..d37c5e1 100644
--- a/app/users/controllers/user-accounts-controller.html
+++ b/app/users/controllers/user-accounts-controller.html
@@ -1,46 +1,95 @@
+<loader loading="loading"></loader>
 <div id="user-accounts">
   <div class="row column">
-    <h1>Manage user account</h1>
-    <div class="column small-12 page-header">
-      <h2 class="h4">Change password</h2>
+    <h1>User account information</h1>
+  </div>
+  <div class="table row column" ng-show="users.length != 0">
+    <div class="table__head">
+      <div class="table__row">
+        <div class="table__cell"> Username </div>
+        <div class="table__cell"> Enabled </div>
+        <div class="table__cell"> Role </div>
+        <div class="table__cell"> Locked </div>
+        <div class="table__cell"> Action </div>
+      </div>
+    </div>
+    <div class="table__body">
+      <div class="table__row" ng-repeat="user in users">
+        <div class="table__cell"> {{user.UserName}} </div>
+        <div class="table__cell"> {{user.Enabled}} </div>
+        <div class="table__cell"> {{user.RoleId}} </div>
+        <div class="table__cell"> {{user.Locked}} </div>
+        <div class="table__cell">
+          <button type="button" class="btn-primary inline" ng-disabled="isUserSelected" ng-click="setSelectedUser(user)">Edit</button>
+          <button type="button" class="btn-primary inline" ng-disabled="isUserSelected" ng-click="deleteUser(user.UserName)">Delete</button>
+        </div>
+      </div>
     </div>
   </div>
-  <section class="row column" aria-label="change password form">
-    <form class="user-manage__form" role="form">
-      <fieldset>
-        <legend aria-label="user manager" class="accessible-text">Change password form</legend>
-        <div class="row column">
-          <label for="user-manage__current-password">Current password</label>
-          <input id="user-manage__current-password" type="password" ng-model="oldPassword" class="user-manage__current-password inline"  autocomplete="off"/>
+  <div class="table row column" ng-show="users.length == 0">
+    <span>No users exist in system</span>
+  </div>
+
+  <form  role="form" class="user-manage__form">
+    <section class="row column" aria-label="user manage form">
+       <div class="column small-12 page-header">
+        <h2 class="inline h4">User account settings</h2>
+       </div>
+        <div class='col-sm-12'>
+          <label class="col-md-1 control-label">UserName</label>
+          <div class="col-md-3">
+            <input type="text" class="form-control" name="UserName" ng-model="selectedUser.UserName" />
+          </div>
         </div>
-        <div class="inline">
-          <label for="user-manage__new-password">New password</label>
-          <div class="user-manage__input-wrapper inline">
-            <input id="user-manage__new-password" type="{{showpassword ? 'text' : 'password'}}" ng-model="password" class="user-manage__new-password inline"  autocomplete="off"/>
+        <div class='col-sm-12 inline'>
+          <label class="col-md-1 control-label">Password</label>
+          <div class="col-md-3 user-manage__input-wrapper inline">
+            <input type="{{showpassword ? 'text' : 'password'}}" class="form-control user-manage__new-password inline" name="Password" ng-model="selectedUser.Password" autocomplete="off"/>
             <button ng-model="showpassword" ng-click="togglePassword = !togglePassword; showpassword = !showpassword;" class="password-toggle">
               <span ng-hide="togglePassword">Show</span>
               <span ng-show="togglePassword">Hide</span>
             </button>
           </div>
         </div>
-        <div class="inline">
-          <label for="user-manage__verify-password">Retype new password</label>
-          <div class="user-manage__input-wrapper inline">
-            <input id="user-manage__verify-password" type="{{showpasswordVerify ? 'text' : 'password'}}" ng-model="passwordVerify" class="user-manage__verify-password inline"  autocomplete="off"/>
+        <div class='col-sm-12'>
+          <label class="col-md-1 control-label">Retype Password</label>
+          <div class="col-md-3 user-manage__input-wrapper inline">
+            <input type="{{showpasswordVerify ? 'text' : 'password'}}" class="form-control user-manage__verify-password inline" name="VerifyPassword" ng-model="selectedUser.VerifyPassword" autocomplete="off">
             <button ng-model="showpasswordVerify" ng-click="toggleVerify = !toggleVerify; showpasswordVerify = !showpasswordVerify;" class="password-toggle">
               <span ng-hide="toggleVerify">Show</span>
               <span ng-show="toggleVerify">Hide</span>
             </button>
           </div>
         </div>
-      </fieldset>
-      <div class="user-manage__submit-wrapper">
-      <button class="btn-primary inline" ng-click="changePassword(oldPassword, password, passwordVerify)">Save change</button>
+        <div class='col-sm-12'>
+          <label class="col-md-1 control-label">Role</label>
+          <div class="col-md-3 user-manage__input-wrapper inline">
+            <select ng-model="selectedUser.RoleId" class="form-control inline">
+              <option ng-repeat="role in roles" class="inline">{{role}}</option>
+            </select>
+          </div>
+        </div>
+        <div class='col-sm-12'>
+          <label class="col-md-1 control-label">Enabled</label>
+          <div class="col-md-3 user-manage__input-wrapper inline">
+            <label class="control-check">
+              <input type="checkbox" name="Enabled" ng-model="selectedUser.Enabled"/>
+                <span class="control__indicator"></span>
+            </label>
+          </div>
+        </div>
+        <div class="user-manage__submit-wrapper">
+            <button type="button" class="btn-primary inline" ng-if="!isUserSelected" ng-click="createNewUser()">Create User</button>
+            <button type="button" class="btn-primary inline" ng-if="isUserSelected" ng-click="updateUserInfo()">Save</button>
+            <button type="button" class="btn-primary inline" ng-if="isUserSelected" ng-click="cancel()">Cancel</button>
+        </div>
+    </section>
+    <section class="row column">
+      <div class='col-sm-12'>
+        <p ng-class="'user-manage__' + state"  role="alert">
+          {{outMsg}}
+        </p>
       </div>
-      <p ng-class="'change-password__' + state"  role="alert">
-        {{state === 'error' ? errorMsg : ''}}
-        {{state === 'success' ? 'Success! User Password has been changed!' : ''}}
-      </p>
-    </form>
-  </section>
+    </section>
+  </form>
 </div>