Do not display empty notification settings group
This commit is contained in:
parent
b13e81e43f
commit
098c25ece6
|
@ -1,5 +1,6 @@
|
|||
<div *ngIf="webNotifications">
|
||||
<ng-container *ngFor="let group of notificationSettingGroups">
|
||||
<ng-container *ngIf="hasNotificationsInGroup(group)">
|
||||
<div class="header notification-row">
|
||||
<div i18n>{{ group.label }}</div>
|
||||
<div i18n>Web</div>
|
||||
|
@ -30,4 +31,5 @@
|
|||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
|
|
@ -116,6 +116,10 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
|
|||
return this.user.hasRight(rightToHave)
|
||||
}
|
||||
|
||||
hasNotificationsInGroup (group: { keys: (keyof UserNotificationSetting)[] }) {
|
||||
return group.keys.some(k => this.hasUserRight(k))
|
||||
}
|
||||
|
||||
getWebLabel (notificationType: keyof UserNotificationSetting) {
|
||||
return `Toggle web notification for "${this.labelNotifications[notificationType]}"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue