thingsboard/ui-ngx/src/app/modules/home/components/notification/show-notification-popover.component.html

60 lines
2.7 KiB
HTML
Raw Normal View History

2023-01-20 15:08:44 +02:00
<!--
2025-02-25 09:39:16 +02:00
Copyright © 2016-2025 The Thingsboard Authors
2023-01-20 15:08:44 +02:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<section class="flex flex-row items-center justify-between" style="margin: 0 10px 4px; min-height: 36px">
2023-01-20 15:08:44 +02:00
<div style="font-weight: 500; letter-spacing: .25px" translate>notification.notification</div>
<button mat-button color="primary"
*ngIf="(notifications$ | async)?.length"
2023-01-20 15:08:44 +02:00
(click)="markAsAllRead($event)">
{{ 'notification.mark-all-as-read' | translate }}
</button>
</section>
<mat-divider></mat-divider>
<ng-container *ngIf="notifications$ | async; else loadingNotification">
<div *ngIf="(notifications$ | async).length; else emptyNotification" style="overflow: auto">
<section style="min-height: 100px; overflow: auto; padding: 6px 0;">
<div *ngFor="let notification of (notifications$ | async); let last = last; trackBy: trackById">
<tb-notification [notification]="notification"
[onClose]="onClose"
(markAsRead)="markAsRead($event)">
</tb-notification>
<mat-divider *ngIf="!last" style="margin: 4px"></mat-divider>
</div>
</section>
</div>
<mat-divider *ngIf="(notifications$ | async).length"></mat-divider>
<section class="flex items-center justify-center" *ngIf="(notifications$ | async).length">
<button class="flex-1" mat-button color="primary" (click)="viewAll($event)">
{{ 'notification.view-all' | translate }}
</button>
</section>
</ng-container>
<ng-template #emptyNotification>
2024-07-05 15:53:48 +03:00
<div class="tb-no-notification-svg-color" style="margin: 20px 24%">
<svg height="100%" preserveAspectRatio="xMidYMid meet" viewBox="0 0 149 156" width="100%">
<use [attr.xlink:href]="'assets/notification-bell.svg#CHECK_ICON'"></use>
</svg>
</div>
<span style="text-align: center; margin-bottom: 12px" translate>notification.no-notifications-yet</span>
</ng-template>
<ng-template #loadingNotification>
<div class="tb-no-data-available" style="margin: 20px; gap: 16px;">
<mat-spinner color="accent" diameter="65" strokeWidth="4"></mat-spinner>
<div class="tb-no-data-text" translate>notification.loading-notifications</div>
</div>
</ng-template>