diff options
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r-- | client/src/app/+admin/users/user-list/user-list.component.html | 5 | ||||
-rw-r--r-- | client/src/app/+admin/users/user-list/user-list.component.ts | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html index 166fafef0..ef5a6c648 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.html +++ b/client/src/app/+admin/users/user-list/user-list.component.html | |||
@@ -30,8 +30,9 @@ | |||
30 | <td>{{ user.roleLabel }}</td> | 30 | <td>{{ user.roleLabel }}</td> |
31 | <td>{{ user.createdAt }}</td> | 31 | <td>{{ user.createdAt }}</td> |
32 | <td class="action-cell"> | 32 | <td class="action-cell"> |
33 | <my-edit-button [routerLink]="getRouterUserEditLink(user)"></my-edit-button> | 33 | <my-action-dropdown i18n-label label="Actions" [actions]="userActions" [entry]="user"></my-action-dropdown> |
34 | <my-delete-button (click)="removeUser(user)"></my-delete-button> | 34 | <!--<my-edit-button [routerLink]="getRouterUserEditLink(user)"></my-edit-button>--> |
35 | <!--<my-delete-button (click)="removeUser(user)"></my-delete-button>--> | ||
35 | </td> | 36 | </td> |
36 | </tr> | 37 | </tr> |
37 | </ng-template> | 38 | </ng-template> |
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts index ab25608c1..3c83859e0 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/users/user-list/user-list.component.ts | |||
@@ -5,6 +5,7 @@ import { ConfirmService } from '../../../core' | |||
5 | import { RestPagination, RestTable, User } from '../../../shared' | 5 | import { RestPagination, RestTable, User } from '../../../shared' |
6 | import { UserService } from '../shared' | 6 | import { UserService } from '../shared' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | ||
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
10 | selector: 'my-user-list', | 11 | selector: 'my-user-list', |
@@ -17,6 +18,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
17 | rowsPerPage = 10 | 18 | rowsPerPage = 10 |
18 | sort: SortMeta = { field: 'createdAt', order: 1 } | 19 | sort: SortMeta = { field: 'createdAt', order: 1 } |
19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 20 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
21 | userActions: DropdownAction<User>[] = [] | ||
20 | 22 | ||
21 | constructor ( | 23 | constructor ( |
22 | private notificationsService: NotificationsService, | 24 | private notificationsService: NotificationsService, |
@@ -25,6 +27,17 @@ export class UserListComponent extends RestTable implements OnInit { | |||
25 | private i18n: I18n | 27 | private i18n: I18n |
26 | ) { | 28 | ) { |
27 | super() | 29 | super() |
30 | |||
31 | this.userActions = [ | ||
32 | { | ||
33 | type: 'edit', | ||
34 | linkBuilder: this.getRouterUserEditLink | ||
35 | }, | ||
36 | { | ||
37 | type: 'delete', | ||
38 | handler: user => this.removeUser(user) | ||
39 | } | ||
40 | ] | ||
28 | } | 41 | } |
29 | 42 | ||
30 | ngOnInit () { | 43 | ngOnInit () { |