Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add display mappings for delivery status and channel type #117

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ <h2 class="p-col-12">Notifications</h2>
<ng-template pTemplate="body" let-notification>
<tr>
<td>{{ notification.id }}</td>
<td>{{ notification.channelType }}</td>
<td>{{ channelTypeMap[notification.channelType] }}</td>
<td>{{ notification.createdBy }}</td>
<td>{{ notification.createdOn | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
<td>{{ notification.updatedBy }}</td>
<td>{{ notification.updatedOn | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
<td>{{ notification.deliveryStatus }}</td>
<td>{{ deliveryStatusMap[notification.deliveryStatus] }}</td>
<td>
<button class="view-button" (click)="showJsonObject(notification.data)">
View Data
Expand Down
13 changes: 13 additions & 0 deletions apps/portal/src/app/views/notifications/notifications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ export class NotificationsComponent implements OnInit {

jsonDialogVisible: Boolean = false;

deliveryStatusMap = {
[DeliveryStatus.PENDING]: 'Pending',
[DeliveryStatus.IN_PROGRESS]: 'In Progress',
[DeliveryStatus.SUCCESS]: 'Success',
[DeliveryStatus.FAILED]: 'Failed',
};

channelTypeMap = {
[ChannelType.SMTP]: 'SMTP',
[ChannelType.MAILGUN]: 'Mailgun',
[ChannelType.WA_360_DAILOG]: 'WhatsApp 360 Dialog',
};

constructor(private notificationService: NotificationsService) {}

ngOnInit(): void {
Expand Down
Loading