UI: Improved recipient table config
This commit is contained in:
parent
16d00361a2
commit
fbb8039c3d
@ -15,7 +15,6 @@
|
|||||||
///
|
///
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CellActionDescriptor,
|
|
||||||
DateEntityTableColumn,
|
DateEntityTableColumn,
|
||||||
EntityTableColumn,
|
EntityTableColumn,
|
||||||
EntityTableConfig
|
EntityTableConfig
|
||||||
@ -66,13 +65,10 @@ export class RecipientTableConfigResolver {
|
|||||||
|
|
||||||
this.config.deleteEntity = id => this.notificationService.deleteNotificationTarget(id.id);
|
this.config.deleteEntity = id => this.notificationService.deleteNotificationTarget(id.id);
|
||||||
|
|
||||||
this.config.cellActionDescriptors = this.configureCellActions();
|
|
||||||
|
|
||||||
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
this.config.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||||
|
|
||||||
this.config.handleRowClick = ($event, target) => {
|
this.config.handleRowClick = ($event, target) => {
|
||||||
$event?.stopPropagation();
|
this.editTarget($event, target);
|
||||||
this.notificationTargetDialog(target).subscribe(res => res ? this.config.updateData() : null);
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -92,8 +88,9 @@ export class RecipientTableConfigResolver {
|
|||||||
return this.config;
|
return this.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private configureCellActions(): Array<CellActionDescriptor<NotificationTarget>> {
|
private editTarget($event: Event, target: NotificationTarget): void {
|
||||||
return [];
|
$event?.stopPropagation();
|
||||||
|
this.notificationTargetDialog(target).subscribe(res => res ? this.config.updateData() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private notificationTargetDialog(target: NotificationTarget, isAdd = false): Observable<NotificationTarget> {
|
private notificationTargetDialog(target: NotificationTarget, isAdd = false): Observable<NotificationTarget> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user