UI: Add new column in send notification table; improvement design send notification dialog
This commit is contained in:
parent
18f171f2c3
commit
25da40a1dc
@ -23,6 +23,7 @@ import { PageData } from '@shared/models/page/page-data';
|
|||||||
import {
|
import {
|
||||||
Notification,
|
Notification,
|
||||||
NotificationRequest,
|
NotificationRequest,
|
||||||
|
NotificationRequestInfo,
|
||||||
NotificationRequestPreview,
|
NotificationRequestPreview,
|
||||||
NotificationRule,
|
NotificationRule,
|
||||||
NotificationSettings,
|
NotificationSettings,
|
||||||
@ -69,8 +70,8 @@ export class NotificationService {
|
|||||||
notification, defaultHttpOptionsFromConfig(config));
|
notification, defaultHttpOptionsFromConfig(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNotificationRequests(pageLink: PageLink, config?: RequestConfig): Observable<PageData<NotificationRequest>> {
|
public getNotificationRequests(pageLink: PageLink, config?: RequestConfig): Observable<PageData<NotificationRequestInfo>> {
|
||||||
return this.http.get<PageData<NotificationRequest>>(`/api/notification/requests${pageLink.toQuery()}`,
|
return this.http.get<PageData<NotificationRequestInfo>>(`/api/notification/requests${pageLink.toQuery()}`,
|
||||||
defaultHttpOptionsFromConfig(config));
|
defaultHttpOptionsFromConfig(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -692,4 +692,8 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
|||||||
this.updateData();
|
this.updateData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
detectChanges() {
|
||||||
|
this.cd.markForCheck();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,4 +85,5 @@ export interface IEntitiesTableComponent {
|
|||||||
cellStyle(entity: BaseData<HasId>, column: EntityColumn<BaseData<HasId>>, row: number): any;
|
cellStyle(entity: BaseData<HasId>, column: EntityColumn<BaseData<HasId>>, row: number): any;
|
||||||
trackByColumnKey(index, column: EntityTableColumn<BaseData<HasId>>): string;
|
trackByColumnKey(index, column: EntityTableColumn<BaseData<HasId>>): string;
|
||||||
trackByEntityId(index: number, entity: BaseData<HasId>): string;
|
trackByEntityId(index: number, entity: BaseData<HasId>): string;
|
||||||
|
detectChanges(): void;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,7 +110,8 @@ export class InboxTableConfig extends EntityTableConfig<Notification> {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.updateData();
|
entity.status = NotificationStatus.READ;
|
||||||
|
this.getTable().detectChanges();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,9 @@ import {
|
|||||||
EntityTableConfig
|
EntityTableConfig
|
||||||
} from '@home/models/entity/entities-table-config.models';
|
} from '@home/models/entity/entities-table-config.models';
|
||||||
import {
|
import {
|
||||||
|
NotificationDeliveryMethodTranslateMap,
|
||||||
NotificationRequest,
|
NotificationRequest,
|
||||||
|
NotificationRequestInfo,
|
||||||
NotificationRequestStatus,
|
NotificationRequestStatus,
|
||||||
NotificationRequestStatusTranslateMap,
|
NotificationRequestStatusTranslateMap,
|
||||||
NotificationTemplate
|
NotificationTemplate
|
||||||
@ -37,8 +39,9 @@ import {
|
|||||||
RequestNotificationDialogComponent,
|
RequestNotificationDialogComponent,
|
||||||
RequestNotificationDialogData
|
RequestNotificationDialogData
|
||||||
} from '@home/pages/notification-center/request-table/request-notification-dialog.componet';
|
} from '@home/pages/notification-center/request-table/request-notification-dialog.componet';
|
||||||
|
import { PageLink } from '@shared/models/page/page-link';
|
||||||
|
|
||||||
export class RequestTableConfig extends EntityTableConfig<NotificationRequest> {
|
export class RequestTableConfig extends EntityTableConfig<NotificationRequest, PageLink, NotificationRequestInfo> {
|
||||||
|
|
||||||
constructor(private notificationService: NotificationService,
|
constructor(private notificationService: NotificationService,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
@ -66,16 +69,18 @@ export class RequestTableConfig extends EntityTableConfig<NotificationRequest> {
|
|||||||
this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC};
|
||||||
|
|
||||||
this.columns.push(
|
this.columns.push(
|
||||||
new DateEntityTableColumn<NotificationRequest>('createdTime', 'notification.created-time', this.datePipe, '150px'),
|
new DateEntityTableColumn<NotificationRequestInfo>('createdTime', 'notification.created-time', this.datePipe, '150px'),
|
||||||
new EntityTableColumn<NotificationRequest>('status', 'notification.status', '100%',
|
new EntityTableColumn<NotificationRequestInfo>('status', 'notification.status', '15%',
|
||||||
request => this.requestStatus(request.status), request => this.requestStatusStyle(request.status)),
|
request => this.requestStatus(request.status), request => this.requestStatusStyle(request.status)),
|
||||||
// new EntityTableColumn<NotificationRequest>('deliveryMethods', 'notification.delivery-method', '20%',
|
new EntityTableColumn<NotificationRequest>('deliveryMethods', 'notification.delivery-method', '35%',
|
||||||
// (request) => request.deliveryMethods.toString(),
|
(request) => request.deliveryMethods
|
||||||
// () => ({}), false)
|
.map((deliveryMethod) => this.translate.instant(NotificationDeliveryMethodTranslateMap.get(deliveryMethod))).join(', '),
|
||||||
|
() => ({}), false),
|
||||||
|
new EntityTableColumn<NotificationRequest>('templateName', 'notification.template', '50%')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private configureCellActions(): Array<CellActionDescriptor<NotificationRequest>> {
|
private configureCellActions(): Array<CellActionDescriptor<NotificationRequestInfo>> {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,6 +62,11 @@
|
|||||||
<mat-icon>supervisor_account</mat-icon>
|
<mat-icon>supervisor_account</mat-icon>
|
||||||
<div class="total-recipients">{{ 'notification.recipients-count' | translate : {count: preview.totalRecipientsCount} }}</div>
|
<div class="total-recipients">{{ 'notification.recipients-count' | translate : {count: preview.totalRecipientsCount} }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="details-recipients" *ngIf="notificationRequestForm.get('targets').value.length">
|
||||||
|
<div *ngFor="let detail of preview.recipientsCountByTarget | keyvalue" class="details-recipient">
|
||||||
|
<span class="number">{{ detail.value }}</span>{{ detail.key }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|||||||
@ -32,6 +32,25 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
letter-spacing: .25px;
|
letter-spacing: .25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&> div:not(:last-child) {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.details-recipient {
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
letter-spacing: .2px;
|
||||||
|
|
||||||
|
.number {
|
||||||
|
font-weight: 500;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-of-type) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media #{$mat-gt-xs} {
|
@media #{$mat-gt-xs} {
|
||||||
|
|||||||
@ -56,6 +56,11 @@ export interface NotificationRequest extends Omit<BaseData<NotificationRequestId
|
|||||||
additionalConfig: NotificationRequestConfig;
|
additionalConfig: NotificationRequestConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface NotificationRequestInfo extends NotificationRequest {
|
||||||
|
templateName: string;
|
||||||
|
deliveryMethods: NotificationDeliveryMethod[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface NotificationRequestPreview {
|
export interface NotificationRequestPreview {
|
||||||
totalRecipientsCount: number;
|
totalRecipientsCount: number;
|
||||||
recipientsCountByTarget: { [key in string]: number };
|
recipientsCountByTarget: { [key in string]: number };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user