projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
User Management: Change password initial support for user admin
[osm/UI.git]
/
skyquake
/
plugins
/
user-management
/
src
/
dashboard
/
userMgmtStore.js
diff --git
a/skyquake/plugins/user-management/src/dashboard/userMgmtStore.js
b/skyquake/plugins/user-management/src/dashboard/userMgmtStore.js
index
407d9d2
..
19952fb
100644
(file)
--- a/
skyquake/plugins/user-management/src/dashboard/userMgmtStore.js
+++ b/
skyquake/plugins/user-management/src/dashboard/userMgmtStore.js
@@
-11,7
+11,7
@@
export default class UserManagementStore {
this.registerAsync(UserManagementSource);
this.users = [];
this['user-name'] = '';
this.registerAsync(UserManagementSource);
this.users = [];
this['user-name'] = '';
- this['user-domain'] = '';
+ this['user-domain'] = '
system
';
this.disabled = false;
this.platformRoles = {
super_admin: false,
this.disabled = false;
this.platformRoles = {
super_admin: false,
@@
-26,6
+26,7
@@
export default class UserManagementStore {
this['confirm-password'] = '';
this.activeIndex = null;
this['confirm-password'] = '';
this.activeIndex = null;
+ this.isReadOnly = true;
this.userOpen = false;
this.hideColumns = false;
this.isEdit = false;
this.userOpen = false;
this.hideColumns = false;
this.isEdit = false;
@@
-75,14
+76,21
@@
export default class UserManagementStore {
let state = _.merge({
activeIndex: userIndex,
userOpen: true,
let state = _.merge({
activeIndex: userIndex,
userOpen: true,
- isEdit: true
+ isEdit: true,
+ isReadOnly: true
}, ActiveUser);
this.setState(state)
}
}, ActiveUser);
this.setState(state)
}
+ editUser(isEdit) {
+ this.setState({
+ isReadOnly: isEdit
+ })
+ }
handleCloseUserPanel() {
this.setState({
userOpen: false,
handleCloseUserPanel() {
this.setState({
userOpen: false,
- isEdit: false
+ isEdit: false,
+ isReadOnly: true
})
}
handleHideColumns(e) {
})
}
handleHideColumns(e) {
@@
-112,7
+120,7
@@
export default class UserManagementStore {
}
resetUser() {
let username = '';
}
resetUser() {
let username = '';
- let domain = '';
+ let domain = '
system
';
let disabled = false;
let platformRoles = {
super_admin: false,
let disabled = false;
let platformRoles = {
super_admin: false,
@@
-149,7
+157,14
@@
export default class UserManagementStore {
}
}
handleAddUser() {
}
}
handleAddUser() {
- this.setState(_.merge( this.resetUser() ,{ isEdit: false, userOpen: true }))
+ this.setState(_.merge( this.resetUser() ,
+ {
+ isEdit: false,
+ userOpen: true,
+ activeIndex: null,
+ isReadOnly: false
+ }
+ ))
}
handleCreateUser() {
}
handleCreateUser() {
@@
-172,7
+187,11
@@
export default class UserManagementStore {
disabled: this.disabled,
projectRoles: this.projectRoles
}
disabled: this.disabled,
projectRoles: this.projectRoles
}
- this.setState({users})
+ this.setState({
+ users,
+ isEdit: true,
+ isReadOnly: true
+ })
}
deleteUserSuccess() {
this.alt.actions.global.hideScreenLoader.defer();
}
deleteUserSuccess() {
this.alt.actions.global.hideScreenLoader.defer();
@@
-188,9
+207,14
@@
export default class UserManagementStore {
'user-domain': this['user-domain'],
platformRoles: this.platformRoles,
disabled: this.disabled,
'user-domain': this['user-domain'],
platformRoles: this.platformRoles,
disabled: this.disabled,
- projectRoles: this.projectRoles
+ projectRoles: this.projectRoles
,
});
});
- let newState = {users, isEdit: true};
+ let newState = {
+ users,
+ isEdit: true,
+ isReadOnly: true,
+ activeIndex: users.length - 1
+ };
_.merge(newState, this.resetPassword())
this.setState(newState);
}
_.merge(newState, this.resetPassword())
this.setState(newState);
}