diff --git a/ui-ngx/src/app/core/http/notification.service.ts b/ui-ngx/src/app/core/http/notification.service.ts index 7f3bf58802..a83aa3c998 100644 --- a/ui-ngx/src/app/core/http/notification.service.ts +++ b/ui-ngx/src/app/core/http/notification.service.ts @@ -23,6 +23,7 @@ import { PageData } from '@shared/models/page/page-data'; import { Notification, NotificationRequest, + NotificationRequestInfo, NotificationRequestPreview, NotificationRule, NotificationSettings, @@ -69,8 +70,8 @@ export class NotificationService { notification, defaultHttpOptionsFromConfig(config)); } - public getNotificationRequests(pageLink: PageLink, config?: RequestConfig): Observable> { - return this.http.get>(`/api/notification/requests${pageLink.toQuery()}`, + public getNotificationRequests(pageLink: PageLink, config?: RequestConfig): Observable> { + return this.http.get>(`/api/notification/requests${pageLink.toQuery()}`, defaultHttpOptionsFromConfig(config)); } diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts index 074381f5de..618901c174 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.ts @@ -692,4 +692,8 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa this.updateData(); } } + + detectChanges() { + this.cd.markForCheck(); + } } diff --git a/ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts b/ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts index 0b0789aaf2..39ecad3954 100644 --- a/ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts +++ b/ui-ngx/src/app/modules/home/models/entity/entity-table-component.models.ts @@ -85,4 +85,5 @@ export interface IEntitiesTableComponent { cellStyle(entity: BaseData, column: EntityColumn>, row: number): any; trackByColumnKey(index, column: EntityTableColumn>): string; trackByEntityId(index: number, entity: BaseData): string; + detectChanges(): void; } diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts index bac119e77b..01a773abb9 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/inbox-table-config.ts @@ -110,7 +110,8 @@ export class InboxTableConfig extends EntityTableConfig { } ); } else { - this.updateData(); + entity.status = NotificationStatus.READ; + this.getTable().detectChanges(); } }); } diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts index a5da7b9788..efd84c0565 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts +++ b/ui-ngx/src/app/modules/home/pages/notification-center/notification-table/request-table-config.ts @@ -21,7 +21,9 @@ import { EntityTableConfig } from '@home/models/entity/entities-table-config.models'; import { + NotificationDeliveryMethodTranslateMap, NotificationRequest, + NotificationRequestInfo, NotificationRequestStatus, NotificationRequestStatusTranslateMap, NotificationTemplate @@ -37,8 +39,9 @@ import { RequestNotificationDialogComponent, RequestNotificationDialogData } from '@home/pages/notification-center/request-table/request-notification-dialog.componet'; +import { PageLink } from '@shared/models/page/page-link'; -export class RequestTableConfig extends EntityTableConfig { +export class RequestTableConfig extends EntityTableConfig { constructor(private notificationService: NotificationService, private translate: TranslateService, @@ -66,16 +69,18 @@ export class RequestTableConfig extends EntityTableConfig { this.defaultSortOrder = {property: 'createdTime', direction: Direction.DESC}; this.columns.push( - new DateEntityTableColumn('createdTime', 'notification.created-time', this.datePipe, '150px'), - new EntityTableColumn('status', 'notification.status', '100%', + new DateEntityTableColumn('createdTime', 'notification.created-time', this.datePipe, '150px'), + new EntityTableColumn('status', 'notification.status', '15%', request => this.requestStatus(request.status), request => this.requestStatusStyle(request.status)), - // new EntityTableColumn('deliveryMethods', 'notification.delivery-method', '20%', - // (request) => request.deliveryMethods.toString(), - // () => ({}), false) + new EntityTableColumn('deliveryMethods', 'notification.delivery-method', '35%', + (request) => request.deliveryMethods + .map((deliveryMethod) => this.translate.instant(NotificationDeliveryMethodTranslateMap.get(deliveryMethod))).join(', '), + () => ({}), false), + new EntityTableColumn('templateName', 'notification.template', '50%') ); } - private configureCellActions(): Array> { + private configureCellActions(): Array> { return []; } diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html index d5be241d2c..75b51f898a 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.html @@ -62,6 +62,11 @@ supervisor_account
{{ 'notification.recipients-count' | translate : {count: preview.totalRecipientsCount} }}
+
+
+ {{ detail.value }}{{ detail.key }} +
+
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss index bd49595bbd..54aeea8bc4 100644 --- a/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/pages/notification-center/request-table/request-notification-dialog.component.scss @@ -32,6 +32,25 @@ font-weight: 500; 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} { diff --git a/ui-ngx/src/app/shared/models/notification.models.ts b/ui-ngx/src/app/shared/models/notification.models.ts index 44a648282a..b1f39f9de9 100644 --- a/ui-ngx/src/app/shared/models/notification.models.ts +++ b/ui-ngx/src/app/shared/models/notification.models.ts @@ -56,6 +56,11 @@ export interface NotificationRequest extends Omit