web: implement bulk-delete form

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-08-12 22:03:13 +02:00
parent 9430a2eea2
commit d1403f6f7d
32 changed files with 365 additions and 367 deletions

View File

@ -75,14 +75,20 @@ export class UserListPage extends TablePage<User> {
return html` <ak-forms-delete-bulk
objectLabel=${t`User(s)`}
.objects=${this.selectedElements}
.usedBy=${(itemPk: number) => {
.metadata=${(item: User) => {
return [
{ key: t`Username`, value: item.username },
{ key: t`ID`, value: item.pk.toString() },
];
}}
.usedBy=${(item: User) => {
return new CoreApi(DEFAULT_CONFIG).coreUsersUsedByList({
id: itemPk,
id: item.pk,
});
}}
.delete=${(itemPk: number) => {
.delete=${(item: User) => {
return new CoreApi(DEFAULT_CONFIG).coreUsersDestroy({
id: itemPk,
id: item.pk,
});
}}
>