Skip to content

Commit

Permalink
Merge branch 'main' into feat/login-auth-guard
Browse files Browse the repository at this point in the history
  • Loading branch information
xixas committed Jan 16, 2024
2 parents 1c1080e + b021c28 commit 917a0bf
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ <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>
<span
[class]="'badge status-' + deliveryStatusMap[notification.deliveryStatus].style"
>
{{ deliveryStatusMap[notification.deliveryStatus].value }}
</span>
</td>
<td>
<button class="view-button" (click)="showJsonObject(notification.data)">
View Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,33 @@ tr:hover {

.no-result {
color: #757575; /* Gray text for no result */
}
}

.badge {
border-radius: 4px;
padding: 0.25em 0.5rem;
text-transform: uppercase;
font-weight: 700;
font-size: 0.75em;
letter-spacing: 0.3px;
}

.badge.status-success {
background: #c8e6c9;
color: #256029;
}

.badge.status-failed {
background: #ffcdd2;
color: #c63737;
}

.badge.status-pending {
background: #dadada;
color: #424242;
}

.badge.status-in-progress {
background: #abcdef;
color: #1558be;
}
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]: { value: 'Pending', style: 'pending' },
[DeliveryStatus.IN_PROGRESS]: { value: 'In Progress', style: 'in-progress' },
[DeliveryStatus.SUCCESS]: { value: 'Success', style: 'success' },
[DeliveryStatus.FAILED]: { value: 'Failed', style: 'failed' },
};

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

constructor(private notificationService: NotificationsService) {}

ngOnInit(): void {
Expand Down

0 comments on commit 917a0bf

Please sign in to comment.