Change password requires all fields to be input before checking equivalence.
[osm/UI.git] / skyquake / plugins / user_management / src / dashboard / dashboard.jsx
index 2494df0..cb6b9a0 100644 (file)
@@ -93,10 +93,13 @@ class UserManagementDashboard extends React.Component {
     deleteUser = (e) => {
         e.preventDefault();
         e.stopPropagation();
-        this.Store.deleteUser({
+        if (confirm('Are you sure you want to delete this user?')) {
+            this.Store.deleteUser({
                 'user-name': this.state['user-name'],
                 'user-domain': this.state['user-domain']
             });
+        }
+
     }
     createUser = (e) => {
         e.preventDefault();
@@ -129,6 +132,10 @@ class UserManagementDashboard extends React.Component {
             let newOne = state['new-password'];
             let confirmOne = state['confirm-password'];
             if(true) {
+                if(!oldOne || !newOne) {
+                     self.props.actions.showNotification('Please fill in all fields.');
+                    return false;
+                }
                 if(oldOne == newOne) {
                     self.props.actions.showNotification('Your new password must not match your old one');
                     return false;