%PDF- %PDF-
Direktori : /home/graphicd/public_html/vebto/public/client/ |
Current File : /home/graphicd/public_html/vebto/public/client/72-es2015.d07d4f25b7726ef08d00.js.map |
{"version":3,"sources":["webpack:///src/common/notifications/notification-subscriptions/notification-subscriptions.service.ts","webpack:///src/common/notifications/notification-subscriptions/notification-subscriptions.component.html","webpack:///src/common/notifications/notification-subscriptions/notification-subscriptions.component.ts","webpack:///src/common/notifications/notification-subscriptions/notification-subscriptions-resolver.service.ts","webpack:///src/common/shared/pagination-widget/pagination-widget.component.html","webpack:///src/common/shared/pagination-widget/pagination-widget.component.ts","webpack:///src/common/notifications/notifications-routing.module.ts","webpack:///src/common/notifications/notification-page/notification-page.component.ts","webpack:///src/common/notifications/notification-page/notification-page.component.html","webpack:///src/common/shared/pagination-widget/pagination-widget.module.ts","webpack:///src/common/notifications/notifications.module.ts"],"names":["NotificationSubscriptionsService","http","userId","this","get","selections","put","NotificationSubscriptionsComponent","route","api","currentUser","toast","cd","settings","availableChannels","loading$","BehaviorSubject","supportsBrowserNotifications","window","form","data","subscribe","groupedNotifications","subscriptions","available_channels","initialUserSelections","user_selections","forEach","group","s","addNotifFormField","notif_id","notifId","channelGroup","channel","initial","find","channels","control","value","disabled","Notification","permission","valueChanges","pipe","filter","isChecked","_","open","setValue","emitEvent","markForCheck","requestPermission","then","addControl","channelName","newValue","allRowsSelectedFor","Object","values","controls","c","markAsDirty","every","some","next","payload","getPayload","updateUserSubscriptions","finalize","markAsPristine","entries","dirty","map","saveSettings","NotificationSubscriptionsResolverService","router","state","getAll","catchError","navigate","E","mergeMap","response","of","PaginationWidgetComponent","pageChanged","numberOfPages","last_page","iterator","Array","from","keys","n","currentPage","current_page","page","queryParams","replaceUrl","newPage","selectPage","prevPage","nextPage","routes","path","component","NotificationPageComponent","notifications","breakpoints","pagination$","loadPage","snapshot","load","perPage","pagination","markedNotif","id","read_at","markAsRead","resolve","permissions","NotificationsRoutingModule","PaginationWidgetModule","NotificationsModule"],"mappings":"6PAgB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M,GAAA,MCftC,6BACA,iBACI,+BAA2G,wCAAgB,EAAAY,WAAA,K,kCAAoB,QAC/I,+BAAkG,uCAAe,EAAAR,SAAA,K,kCAAkB,QACvI,S,WAJiB,qEAEM,+EAA6C,8CAC7C,sDAAkC,mD,iSDY5CJ,GAAb,IDHI,CACIF,KAAM,WACNC,UAAWlG,EACXgH,QAAS,CAAC9G,IAAKkE,GACfvD,KAAM,CAACoG,YAAa,CAAC,6BAQtB,IAAMC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BAHA,CAAC,cAAsBlB,IACtB,QAEDkB,GAAb,G,gDGJO,IAAMC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BATA,CACL,KACA,KACA,QAMKA,GAAb,GCgBaC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BAhBA,CACL,KACA,KACA,KACAF,EACA,IACA,IACA,IACAC,EACA,IAGA,KACA,SAGKC,GAAb","file":"x","sourcesContent":["import {Injectable} from '@angular/core';\nimport {AppHttpClient} from '@common/core/http/app-http-client.service';\nimport {BackendResponse} from '@common/core/types/backend-response';\nimport {\n NotificationSubscriptionGroup,\n NotificationSubscriptionsResponse\n} from '@common/notifications/notification-subscriptions/notification-subscription';\n\nexport type UpdateNotificationSubscriptionsPayload = {\n notif_id: string;\n channels: {[key: string]: boolean};\n}[];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NotificationSubscriptionsService {\n constructor(private http: AppHttpClient) {}\n\n public getAll(userId: number): BackendResponse<NotificationSubscriptionsResponse> {\n return this.http.get(`notifications/${userId}/subscriptions`);\n }\n\n public updateUserSubscriptions(userId: number, selections: UpdateNotificationSubscriptionsPayload): BackendResponse<void> {\n return this.http.put(`notifications/${userId}/subscriptions`, {selections});\n }\n}\n","<material-navbar\n [menuPosition]=\"settings.get('vebto.navbar.defaultPosition')\"\n class=\"box-shadow\"\n></material-navbar>\n\n<div class=\"be-container\">\n <form class=\"table material-panel\" (ngSubmit)=\"saveSettings()\">\n <div class=\"setting-group\" *ngFor=\"let group of groupedNotifications; let first = first\">\n <div class=\"row\">\n <div class=\"name-column strong\" trans>{{ group.group_name }}</div>\n <ng-container *ngIf=\"first\">\n <div class=\"channel-column\" *ngFor=\"let channelName of availableChannels\">\n <div class=\"channel-name\" trans>{{ channelName }}</div>\n <mat-checkbox\n (change)=\"$event ? toggleAllRowsFor(channelName) : null\"\n [checked]=\"allRowsSelectedFor(channelName)\"\n [indeterminate]=\"someRowsSelectedFor(channelName) && !allRowsSelectedFor(channelName)\"\n [disabled]=\"channelName === 'browser' && !supportsBrowserNotifications\"\n >\n </mat-checkbox>\n </div>\n </ng-container>\n </div>\n <div [formGroup]=\"form\">\n <div\n class=\"row indent\"\n *ngFor=\"let subscription of group.subscriptions; let last = last\"\n [class.no-border]=\"last\"\n [formGroupName]=\"subscription.notif_id\"\n >\n <div class=\"name-column\" trans>{{ subscription.name }}</div>\n <div class=\"channel-column\" *ngFor=\"let channelName of availableChannels\">\n <mat-checkbox [formControlName]=\"channelName\"></mat-checkbox>\n </div>\n </div>\n </div>\n </div>\n\n <button\n mat-raised-button\n color=\"accent\"\n class=\"submit-button\"\n [disabled]=\"loading$ | async\"\n trans\n >\n Save Settings\n </button>\n </form>\n</div>\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n OnInit,\n} from '@angular/core';\nimport {ActivatedRoute} from '@angular/router';\nimport {\n NotificationSubscription,\n NotificationSubscriptionGroup,\n NotificationSubscriptionsResponse,\n} from '@common/notifications/notification-subscriptions/notification-subscription';\nimport {\n NotificationSubscriptionsService,\n UpdateNotificationSubscriptionsPayload,\n} from '@common/notifications/notification-subscriptions/notification-subscriptions.service';\nimport {CurrentUser} from '@common/auth/current-user';\nimport {Toast} from '@common/core/ui/toast.service';\nimport {BehaviorSubject} from 'rxjs';\nimport {filter, finalize} from 'rxjs/operators';\nimport {Settings} from '@common/core/config/settings.service';\nimport {FormControl, FormGroup} from '@angular/forms';\n\n@Component({\n selector: 'notification-subscriptions',\n templateUrl: './notification-subscriptions.component.html',\n styleUrls: ['./notification-subscriptions.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NotificationSubscriptionsComponent implements OnInit {\n private initialUserSelections: NotificationSubscription[];\n groupedNotifications: NotificationSubscriptionGroup[];\n availableChannels: string[] = [];\n loading$ = new BehaviorSubject<boolean>(false);\n supportsBrowserNotifications = ('Notification' in window);\n form = new FormGroup({});\n\n constructor(\n private route: ActivatedRoute,\n private api: NotificationSubscriptionsService,\n private currentUser: CurrentUser,\n private toast: Toast,\n private cd: ChangeDetectorRef,\n public settings: Settings\n ) {}\n\n ngOnInit() {\n this.route.data.subscribe((data: {api: NotificationSubscriptionsResponse}) => {\n this.groupedNotifications = data.api.subscriptions;\n this.availableChannels = data.api.available_channels;\n this.initialUserSelections = data.api.user_selections;\n this.groupedNotifications.forEach(group => {\n group.subscriptions.forEach(s => this.addNotifFormField(s.notif_id));\n });\n });\n }\n\n public addNotifFormField(notifId: string) {\n const channelGroup = new FormGroup({});\n this.availableChannels.forEach(channel => {\n const initial = this.initialUserSelections.find(s => s.notif_id === notifId)\n ?.channels[channel];\n const disabled = channel === 'browser' && !this.supportsBrowserNotifications;\n const control = new FormControl({value: initial ?? false, disabled});\n if (channel === 'browser' && Notification.permission !== 'granted') {\n control.valueChanges.pipe(filter(isChecked => isChecked)).subscribe(_ => {\n if (Notification.permission === 'denied') {\n this.toast.open(\n 'Notifications blocked. Please enable them for this site from browser settings.'\n );\n control.setValue(false, {emitEvent: false});\n this.cd.markForCheck();\n } else {\n Notification.requestPermission().then(permission => {\n if (permission !== 'granted') {\n control.setValue(false, {emitEvent: false});\n this.cd.markForCheck();\n }\n });\n }\n });\n }\n channelGroup.addControl(channel, control);\n });\n this.form.addControl(notifId, channelGroup);\n }\n\n public toggleAllRowsFor(channelName: string) {\n const newValue = !this.allRowsSelectedFor(channelName);\n Object.values(this.form.controls).forEach(c => {\n (c as FormGroup).controls[channelName].setValue(newValue);\n (c as FormGroup).controls[channelName].markAsDirty();\n });\n }\n\n public allRowsSelectedFor(channelName: string): boolean {\n return Object.values(this.form.controls).every(control => {\n return (control as FormGroup).controls[channelName].value === true;\n });\n }\n\n public someRowsSelectedFor(channelName: string): boolean {\n return Object.values(this.form.controls).some(control => {\n return (control as FormGroup).controls[channelName].value === true;\n });\n }\n\n public saveSettings() {\n this.loading$.next(true);\n const payload = this.getPayload();\n this.api\n .updateUserSubscriptions(this.currentUser.get('id'), payload)\n .pipe(finalize(() => this.loading$.next(false)))\n .subscribe(() => {\n this.form.markAsPristine();\n this.toast.open('Notification settings updated.');\n });\n }\n\n private getPayload(): UpdateNotificationSubscriptionsPayload {\n return Object.entries(this.form.controls)\n .filter(([_, control]) => control.dirty)\n .map(([notifId, control]) => {\n return {notif_id: notifId, channels: control.value};\n });\n }\n}\n","import {Injectable} from '@angular/core';\nimport {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';\nimport {catchError, mergeMap} from 'rxjs/operators';\nimport {EMPTY, Observable, of} from 'rxjs';\nimport {NotificationSubscriptionsService} from '@common/notifications/notification-subscriptions/notification-subscriptions.service';\nimport {CurrentUser} from '@common/auth/current-user';\nimport {NotificationSubscriptionsResponse} from '@common/notifications/notification-subscriptions/notification-subscription';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NotificationSubscriptionsResolverService implements Resolve<Observable<NotificationSubscriptionsResponse>> {\n constructor(\n private router: Router,\n private subscriptions: NotificationSubscriptionsService,\n private currentUser: CurrentUser,\n ) {}\n\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<NotificationSubscriptionsResponse> {\n return this.subscriptions.getAll(+this.currentUser.get('id')).pipe(\n catchError(() => {\n this.router.navigate(['/account/settings']);\n return EMPTY; //\n }),\n mergeMap(response => {\n if (response) {\n return of(response);\n } else {\n this.router.navigate(['/account/settings']);\n return EMPTY;\n }\n })\n );\n }\n}\n","<ul class=\"page-numbers unstyled-list\">\n <li>\n <button type=\"button\" class=\"prev\" [disabled]=\"disabled\" (click)=\"prevPage()\" mat-button trans>Previous</button>\n </li>\n <li *ngFor=\"let page of iterator\">\n <button type=\"button\" class=\"page-number-button\" [disabled]=\"disabled\" [class.active]=\"currentPage === page\" (click)=\"selectPage(page)\" mat-flat-button color=\"gray\">{{page}}</button>\n </li>\n <li>\n <button type=\"button\" class=\"next\" [disabled]=\"disabled\" (click)=\"nextPage()\" mat-button trans>Next</button>\n </li>\n</ul>\n","import {ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output} from '@angular/core';\nimport {PaginationResponse} from '@common/core/types/pagination/pagination-response';\nimport {Router} from '@angular/router';\n\n@Component({\n selector: 'pagination-widget',\n templateUrl: './pagination-widget.component.html',\n styleUrls: ['./pagination-widget.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PaginationWidgetComponent {\n private numberOfPages: number;\n public iterator: number[];\n public currentPage: number;\n\n @HostBinding('class.hidden') get shouldHide() {\n return this.numberOfPages < 2;\n }\n\n @Output() pageChanged = new EventEmitter<number>();\n\n @Input() disabled = true;\n @Input() set pagination(value: PaginationResponse<any>) {\n if (value) {\n this.numberOfPages = value.last_page > 10 ? 10 : value.last_page;\n if (this.numberOfPages > 1) {\n this.iterator = Array.from(Array(this.numberOfPages).keys()).map(n => n + 1);\n this.currentPage = value.current_page;\n }\n }\n }\n\n constructor(private router: Router) {}\n\n public selectPage(page: number) {\n if (this.currentPage !== page) {\n this.currentPage = page;\n this.pageChanged.next(page);\n this.router.navigate([], {queryParams: {page}, replaceUrl: true});\n }\n }\n\n public nextPage() {\n const newPage = this.currentPage + 1;\n this.selectPage(newPage <= this.numberOfPages ? newPage : this.currentPage);\n }\n\n public prevPage() {\n const newPage = this.currentPage - 1;\n this.selectPage(newPage >= 1 ? newPage : this.currentPage);\n }\n}\n","import {NgModule} from '@angular/core';\nimport {Routes, RouterModule} from '@angular/router';\nimport {NotificationSubscriptionsComponent} from './notification-subscriptions/notification-subscriptions.component';\nimport {NotificationSubscriptionsResolverService} from './notification-subscriptions/notification-subscriptions-resolver.service';\nimport {NotificationPageComponent} from '@common/notifications/notification-page/notification-page.component';\n\n\nconst routes: Routes = [\n {\n path: '',\n component: NotificationPageComponent,\n },\n {\n path: 'settings',\n component: NotificationSubscriptionsComponent,\n resolve: {api: NotificationSubscriptionsResolverService},\n data: {permissions: ['notification.subscribe']},\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(routes)],\n exports: [RouterModule]\n})\nexport class NotificationsRoutingModule {\n}\n","import {Component, OnInit, ChangeDetectionStrategy} from '@angular/core';\nimport {Settings} from '@common/core/config/settings.service';\nimport {NotificationService} from '@common/notifications/notification-list/notification.service';\nimport {BreakpointsService} from '@common/core/ui/breakpoints.service';\nimport {ActivatedRoute} from '@angular/router';\nimport {BehaviorSubject} from 'rxjs';\nimport {PaginationResponse} from '@common/core/types/pagination/pagination-response';\nimport {DatabaseNotification} from '@common/notifications/database-notification';\n\n@Component({\n selector: 'notification-page',\n templateUrl: './notification-page.component.html',\n styleUrls: ['./notification-page.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NotificationPageComponent implements OnInit {\n public pagination$ = new BehaviorSubject<PaginationResponse<DatabaseNotification>>(null);\n\n constructor(\n public settings: Settings,\n public notifications: NotificationService,\n public breakpoints: BreakpointsService,\n private route: ActivatedRoute,\n ) {}\n\n ngOnInit() {\n this.loadPage(this.route.snapshot.queryParams.page || 1);\n }\n\n public loadPage(page: number) {\n this.notifications.load({page, perPage: 25})\n .subscribe(response => {\n this.pagination$.next(response.pagination);\n });\n }\n\n public markAsRead(markedNotif: DatabaseNotification) {\n const notification = this.pagination$.value.data.find(n => n.id === markedNotif.id);\n notification.read_at = markedNotif.read_at;\n }\n}\n","<material-navbar [menuPosition]=\"settings.get('vebto.navbar.defaultPosition')\"></material-navbar>\n<div class=\"be-container\">\n <notification-list [notifications]=\"(pagination$ | async)?.data\" [compact]=\"breakpoints.isMobile$ | async\" (markedAsRead)=\"markAsRead($event)\"></notification-list>\n <pagination-widget [pagination]=\"pagination$ | async\" [disabled]=\"notifications.loading$ | async\" (pageChanged)=\"loadPage($event)\"></pagination-widget>\n</div>\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {PaginationWidgetComponent} from '@common/shared/pagination-widget/pagination-widget.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport {TranslationsModule} from '@common/core/translations/translations.module';\n\n\n@NgModule({\n declarations: [\n PaginationWidgetComponent,\n ],\n imports: [\n CommonModule,\n MatButtonModule,\n TranslationsModule,\n ],\n exports: [\n PaginationWidgetComponent,\n ]\n})\nexport class PaginationWidgetModule {\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NotificationsRoutingModule } from './notifications-routing.module';\nimport { NotificationSubscriptionsComponent } from './notification-subscriptions/notification-subscriptions.component';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ImageOrIconModule } from '@common/core/ui/image-or-icon/image-or-icon.module';\nimport { NotificationListModule } from '@common/notifications/notification-list/notification-list.module';\nimport { MaterialNavbarModule } from '@common/core/ui/material-navbar/material-navbar.module';\nimport { NotificationPageComponent } from './notification-page/notification-page.component';\nimport {PaginationWidgetModule} from '@common/shared/pagination-widget/pagination-widget.module';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport { TranslationsModule } from '../core/translations/translations.module';\n\n\n@NgModule({\n declarations: [\n NotificationSubscriptionsComponent,\n NotificationPageComponent,\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NotificationsRoutingModule,\n MaterialNavbarModule,\n ImageOrIconModule,\n NotificationListModule,\n PaginationWidgetModule,\n TranslationsModule,\n\n // material\n MatCheckboxModule,\n MatButtonModule,\n ]\n})\nexport class NotificationsModule {\n}\n"]}