Commit c9a5f056 authored by Dimitri von Rütte's avatar Dimitri von Rütte
Browse files

Added 'new password' field to user edit form. Minor Bugfix in viewUser.js [resolve #61]

parent 9ce17ecb
...@@ -49,6 +49,14 @@ export default class UserEdit extends EditView { ...@@ -49,6 +49,14 @@ export default class UserEdit extends EditView {
firstname: { type: 'text', label: 'First Name' }, firstname: { type: 'text', label: 'First Name' },
email: { type: 'text', label: 'Email' }, email: { type: 'text', label: 'Email' },
nethz: { type: 'text', label: 'NETHZ' }, nethz: { type: 'text', label: 'NETHZ' },
}),
m(textInput, this.form.bind({
type: 'password',
name: 'password',
label: 'New password',
floatingLabel: true,
})),
...this.form.renderPage({
rfid: { type: 'text', label: 'RFID Code' }, rfid: { type: 'text', label: 'RFID Code' },
}), }),
m(RadioGroup, { m(RadioGroup, {
...@@ -93,33 +101,6 @@ export default class UserEdit extends EditView { ...@@ -93,33 +101,6 @@ export default class UserEdit extends EditView {
], ],
onChange: ({ value }) => { this.form.data.department = value; }, onChange: ({ value }) => { this.form.data.department = value; },
}), }),
m(Button, {
label: 'Change Password',
border: true,
events: { onclick: () => this.resetpw() },
}),
]); ]);
} }
resetpw() {
this.pw.data._id = this.form.data._id;
this.pw.data._etag = this.form.data._etag;
Dialog.show({
body: [
'Enter the new password.',
m('div', m(passwordField, { form: this.pw })),
],
backdrop: true,
footerButtons: [
m(Button, {
label: 'Cancel',
events: {
onclick: () => {
Dialog.hide();
},
},
}),
],
});
}
} }
...@@ -30,7 +30,7 @@ export default class UserView extends ItemView { ...@@ -30,7 +30,7 @@ export default class UserView extends ItemView {
this.groupmemberships.handler.get({ where: { user: this.data._id } }) this.groupmemberships.handler.get({ where: { user: this.data._id } })
.then((data) => { .then((data) => {
const groupIds = data._items.map(item => item.group); const groupIds = data._items.map(item => item.group);
this.groupcontroller.setQuery({ this.groupController.setQuery({
where: { _id: { $nin: groupIds } }, where: { _id: { $nin: groupIds } },
}); });
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment