aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts56
1 files changed, 48 insertions, 8 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
index 1eac06234..09da979ab 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
@@ -11,14 +11,14 @@ import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from
11 styleUrls: [ './my-account-notification-preferences.component.scss' ] 11 styleUrls: [ './my-account-notification-preferences.component.scss' ]
12}) 12})
13export class MyAccountNotificationPreferencesComponent implements OnInit { 13export class MyAccountNotificationPreferencesComponent implements OnInit {
14 @Input() user: User = null 14 @Input() user: User
15 @Input() userInformationLoaded: Subject<any> 15 @Input() userInformationLoaded: Subject<any>
16 16
17 notificationSettingKeys: (keyof UserNotificationSetting)[] = [] 17 notificationSettingGroups: { label: string, keys: (keyof UserNotificationSetting)[] }[] = []
18 emailNotifications: { [ id in keyof UserNotificationSetting ]: boolean } = {} as any 18 emailNotifications: { [ id in keyof UserNotificationSetting ]?: boolean } = {}
19 webNotifications: { [ id in keyof UserNotificationSetting ]: boolean } = {} as any 19 webNotifications: { [ id in keyof UserNotificationSetting ]?: boolean } = {}
20 labelNotifications: { [ id in keyof UserNotificationSetting ]: string } = {} as any 20 labelNotifications: { [ id in keyof UserNotificationSetting ]?: string } = {}
21 rightNotifications: { [ id in keyof Partial<UserNotificationSetting> ]: UserRight } = {} as any 21 rightNotifications: { [ id in keyof Partial<UserNotificationSetting> ]?: UserRight } = {}
22 emailEnabled = false 22 emailEnabled = false
23 23
24 private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500) 24 private savePreferences = debounce(this.savePreferencesImpl.bind(this), 500)
@@ -32,7 +32,7 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
32 newVideoFromSubscription: $localize`New video from your subscriptions`, 32 newVideoFromSubscription: $localize`New video from your subscriptions`,
33 newCommentOnMyVideo: $localize`New comment on your video`, 33 newCommentOnMyVideo: $localize`New comment on your video`,
34 abuseAsModerator: $localize`New abuse`, 34 abuseAsModerator: $localize`New abuse`,
35 videoAutoBlacklistAsModerator: $localize`Video blocked automatically waiting review`, 35 videoAutoBlacklistAsModerator: $localize`An automatically blocked video is awaiting review`,
36 blacklistOnMyVideo: $localize`One of your video is blocked/unblocked`, 36 blacklistOnMyVideo: $localize`One of your video is blocked/unblocked`,
37 myVideoPublished: $localize`Video published (after transcoding/scheduled update)`, 37 myVideoPublished: $localize`Video published (after transcoding/scheduled update)`,
38 myVideoImportFinished: $localize`Video import finished`, 38 myVideoImportFinished: $localize`Video import finished`,
@@ -46,7 +46,47 @@ export class MyAccountNotificationPreferencesComponent implements OnInit {
46 newPeerTubeVersion: $localize`A new PeerTube version is available`, 46 newPeerTubeVersion: $localize`A new PeerTube version is available`,
47 newPluginVersion: $localize`One of your plugin/theme has a new available version` 47 newPluginVersion: $localize`One of your plugin/theme has a new available version`
48 } 48 }
49 this.notificationSettingKeys = Object.keys(this.labelNotifications) as (keyof UserNotificationSetting)[] 49 this.notificationSettingGroups = [
50 {
51 label: $localize`Social`,
52 keys: [
53 'newVideoFromSubscription',
54 'newFollow',
55 'commentMention'
56 ]
57 },
58
59 {
60 label: $localize`Your videos`,
61 keys: [
62 'newCommentOnMyVideo',
63 'blacklistOnMyVideo',
64 'myVideoPublished',
65 'myVideoImportFinished'
66 ]
67 },
68
69 {
70 label: $localize`Moderation`,
71 keys: [
72 'abuseStateChange',
73 'abuseNewMessage',
74 'abuseAsModerator',
75 'videoAutoBlacklistAsModerator'
76 ]
77 },
78
79 {
80 label: $localize`Administration`,
81 keys: [
82 'newUserRegistration',
83 'newInstanceFollower',
84 'autoInstanceFollowing',
85 'newPeerTubeVersion',
86 'newPluginVersion'
87 ]
88 }
89 ]
50 90
51 this.rightNotifications = { 91 this.rightNotifications = {
52 abuseAsModerator: UserRight.MANAGE_ABUSES, 92 abuseAsModerator: UserRight.MANAGE_ABUSES,