mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
user admin UX
This commit is contained in:
parent
79531e01b3
commit
95bb440a65
9 changed files with 194 additions and 315 deletions
|
@ -10,12 +10,10 @@
|
|||
// https://documize.com
|
||||
|
||||
import { set } from '@ember/object';
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import Controller from '@ember/controller';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
|
||||
export default Controller.extend(NotifierMixin, {
|
||||
export default Controller.extend({
|
||||
userService: service('user'),
|
||||
newUser: { firstname: "", lastname: "", email: "", active: true },
|
||||
|
||||
|
@ -26,7 +24,6 @@ export default Controller.extend(NotifierMixin, {
|
|||
return this.get('userService')
|
||||
.add(this.get('newUser'))
|
||||
.then((user) => {
|
||||
this.showNotification('Added');
|
||||
this.get('model').pushObject(user);
|
||||
})
|
||||
.catch(function (error) {
|
||||
|
@ -38,8 +35,6 @@ export default Controller.extend(NotifierMixin, {
|
|||
onDelete(userId) {
|
||||
let self = this;
|
||||
this.get('userService').remove(userId).then(function () {
|
||||
self.showNotification('Deleted');
|
||||
|
||||
self.get('userService').getComplete().then(function (users) {
|
||||
self.set('model', users);
|
||||
});
|
||||
|
@ -49,7 +44,6 @@ export default Controller.extend(NotifierMixin, {
|
|||
onSave(user) {
|
||||
let self = this;
|
||||
this.get('userService').save(user).then(function () {
|
||||
self.showNotification('Saved');
|
||||
|
||||
self.get('userService').getComplete().then(function (users) {
|
||||
self.set('model', users);
|
||||
|
@ -59,7 +53,6 @@ export default Controller.extend(NotifierMixin, {
|
|||
|
||||
onPassword(user, password) {
|
||||
this.get('userService').updatePassword(user.id, password);
|
||||
this.showNotification('Password changed');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="view-customize">
|
||||
<h1 class="admin-heading">Users</h1>
|
||||
<h2 class="sub-heading">Set basic information, passwords and permissions for {{model.length}} users</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{customize/user-settings add=(action 'add')}}
|
||||
|
||||
{{customize/user-admin users=model onDelete=(action "onDelete") onSave=(action "onSave") onPassword=(action "onPassword")}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue