"@types/video.js": "^7.2.5",
"@types/webtorrent": "^0.98.4",
"angular2-hotkeys": "^2.1.2",
- "angular2-notifications": "^1.0.2",
"awesome-typescript-loader": "5.2.1",
"bootstrap": "^4.1.3",
"buffer": "^5.1.0",
import { Component, OnInit } from '@angular/core'
-import { ServerService } from '@app/core'
+import { Notifier, ServerService } from '@app/core'
import { MarkdownService } from '@app/videos/shared'
-import { NotificationsService } from 'angular2-notifications'
import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
templateUrl: './about-instance.component.html',
styleUrls: [ './about-instance.component.scss' ]
})
-
export class AboutInstanceComponent implements OnInit {
shortDescription = ''
descriptionHTML = ''
termsHTML = ''
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private serverService: ServerService,
private markdownService: MarkdownService,
private i18n: I18n
this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms)
},
- err => this.notificationsService.error(this.i18n('Error getting about from server'), err)
+ () => this.notifier.error(this.i18n('Cannot get about information from server'))
)
}
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { Subscription } from 'rxjs'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-account-videos',
protected router: Router,
protected route: ActivatedRoute,
protected authService: AuthService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected confirmService: ConfirmService,
protected location: Location,
protected screenService: ScreenService,
import { RestExtractor, UserService } from '@app/shared'
import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'
import { Subscription } from 'rxjs'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier, RedirectService } from '@app/core'
import { User, UserRight } from '../../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { AuthService, RedirectService } from '@app/core'
@Component({
templateUrl: './accounts.component.html',
private route: ActivatedRoute,
private userService: UserService,
private accountService: AccountService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private restExtractor: RestExtractor,
private redirectService: RedirectService,
private authService: AuthService,
.subscribe(
account => this.account = account,
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
.subscribe(
user => this.user = user,
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { ConfigService } from '@app/+admin/config/shared/config.service'
import { ServerService } from '@app/core/server/server.service'
import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
protected formValidatorService: FormValidatorService,
private customConfigValidatorsService: CustomConfigValidatorsService,
private userValidatorsService: UserValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private configService: ConfigService,
private serverService: ServerService,
private i18n: I18n
this.forceCheck()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.updateForm()
- this.notificationsService.success(this.i18n('Success'), this.i18n('Configuration updated.'))
+ this.notifier.success(this.i18n('Configuration updated.'))
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { SortMeta } from 'primeng/primeng'
import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
import { RestPagination, RestTable } from '../../../shared'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private followService: FollowService,
private i18n: I18n
) {
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { ConfirmService } from '../../../core'
import { validateHost } from '../../../shared'
import { FollowService } from '../shared'
constructor (
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private followService: FollowService,
private i18n: I18n
this.followService.follow(hosts).subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Follow request(s) sent!'))
+ this.notifier.success(this.i18n('Follow request(s) sent!'))
setTimeout(() => this.router.navigate([ '/admin/follows/following-list' ]), 500)
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { SortMeta } from 'primeng/primeng'
import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
import { ConfirmService } from '../../../core/confirm/confirm.service'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private followService: FollowService,
private i18n: I18n
this.followService.unfollow(follow).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('You are not following {{host}} anymore.', { host: follow.following.host })
- )
+ this.notifier.success(this.i18n('You are not following {{host}} anymore.', { host: follow.following.host }))
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, Input } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { RedundancyService } from '@app/+admin/follows/shared/redundancy.service'
@Input() host: string
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private redundancyService: RedundancyService,
private i18n: I18n
) { }
updateRedundancyState () {
this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed)
- .subscribe(
- () => {
- const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled')
+ .subscribe(
+ () => {
+ const stateLabel = this.redundancyAllowed ? this.i18n('enabled') : this.i18n('disabled')
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel })
- )
- },
+ this.notifier.success(this.i18n('Redundancy for {{host}} is {{stateLabel}}', { host: this.host, stateLabel }))
+ },
- err => this.notificationsService.error(this.i18n('Error'), err.message)
- )
+ err => this.notifier.error(err.message)
+ )
}
}
import { Component, OnInit } from '@angular/core'
import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { SortMeta } from 'primeng/primeng'
import { Job } from '../../../../../../shared/index'
import { JobState } from '../../../../../../shared/models'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private jobsService: JobService,
private i18n: I18n
) {
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
-import { BlocklistService, AccountBlock } from '@app/shared/blocklist'
+import { AccountBlock, BlocklistService } from '@app/shared/blocklist'
@Component({
selector: 'my-instance-account-blocklist',
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private blocklistService: BlocklistService,
private i18n: I18n
) {
this.blocklistService.unblockAccountByInstance(blockedAccount)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
+ this.notifier.success(
this.i18n('Account {{nameWithHost}} unmuted by your instance.', { nameWithHost: blockedAccount.nameWithHost })
)
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private blocklistService: BlocklistService,
private i18n: I18n
) {
this.blocklistService.unblockServerByInstance(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} unmuted by your instance.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} unmuted by your instance.', { host }))
this.loadData()
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
constructor (
protected formValidatorService: FormValidatorService,
private modalService: NgbModal,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoAbuseService: VideoAbuseService,
private videoAbuseValidatorsService: VideoAbuseValidatorsService,
private i18n: I18n
}
async banUser () {
- const moderationComment: string = this.form.value['moderationComment']
+ const moderationComment: string = this.form.value[ 'moderationComment' ]
this.videoAbuseService.updateVideoAbuse(this.abuseToComment, { moderationComment })
- .subscribe(
- () => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Comment updated.')
- )
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Comment updated.'))
- this.commentUpdated.emit(moderationComment)
- this.hideModerationCommentModal()
- },
+ this.commentUpdated.emit(moderationComment)
+ this.hideModerationCommentModal()
+ },
- err => this.notificationsService.error(this.i18n('Error'), err.message)
- )
+ err => this.notifier.error(err.message)
+ )
}
}
import { Component, OnInit, ViewChild } from '@angular/core'
import { Account } from '../../../shared/account/account.model'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { SortMeta } from 'primeng/components/common/sortmeta'
import { VideoAbuse, VideoAbuseState } from '../../../../../../shared'
import { RestPagination, RestTable, VideoAbuseService } from '../../../shared'
videoAbuseActions: DropdownAction<VideoAbuse>[] = []
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoAbuseService: VideoAbuseService,
private confirmService: ConfirmService,
private i18n: I18n
this.videoAbuseService.removeVideoAbuse(videoAbuse).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Abuse deleted.')
- )
+ this.notifier.success(this.i18n('Abuse deleted.'))
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
.subscribe(
() => this.loadData(),
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
import { SortMeta } from 'primeng/components/common/sortmeta'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { ConfirmService } from '../../../core'
import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared'
import { VideoBlacklist } from '../../../../../../shared'
videoBlacklistActions: DropdownAction<VideoBlacklist>[] = []
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private videoBlacklistService: VideoBlacklistService,
private i18n: I18n
this.videoBlacklistService.removeVideoFromBlacklist(entry.video.id).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Video {{name}} removed from the blacklist.', { name: entry.video.name })
- )
+ this.notifier.success(this.i18n('Video {{name}} removed from the blacklist.', { name: entry.video.name }))
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
-import { ServerService } from '../../../core'
+import { Notifier, ServerService } from '@app/core'
import { UserCreate, UserRole } from '../../../../../../shared'
import { UserEdit } from './user-edit'
import { I18n } from '@ngx-translate/i18n-polyfill'
protected configService: ConfigService,
private userValidatorsService: UserValidatorsService,
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private i18n: I18n
) {
this.userService.addUser(userCreate).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('User {{username}} created.', { username: userCreate.username })
- )
+ this.notifier.success(this.i18n('User {{username}} created.', { username: userCreate.username }))
this.router.navigate([ '/admin/users/list' ])
},
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Subscription } from 'rxjs'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { ServerService } from '../../../core'
import { UserEdit } from './user-edit'
import { User, UserUpdate } from '../../../../../../shared'
private userValidatorsService: UserValidatorsService,
private route: ActivatedRoute,
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private i18n: I18n
) {
this.userService.updateUser(this.userId, userUpdate).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('User {{username}} updated.', { username: this.username })
- )
+ this.notifier.success(this.i18n('User {{username}} updated.', { username: this.username }))
this.router.navigate([ '/admin/users/list' ])
},
import { Component, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { SortMeta } from 'primeng/components/common/sortmeta'
import { ConfirmService, ServerService } from '../../../core'
import { RestPagination, RestTable, UserService } from '../../../shared'
bulkUserActions: DropdownAction<User[]>[] = []
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private serverService: ServerService,
private userService: UserService,
openBanUserModal (users: User[]) {
for (const user of users) {
if (user.username === 'root') {
- this.notificationsService.error(this.i18n('Error'), this.i18n('You cannot ban root.'))
+ this.notifier.error(this.i18n('You cannot ban root.'))
return
}
}
() => {
const message = this.i18n('{{num}} users unbanned.', { num: users.length })
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
async removeUsers (users: User[]) {
for (const user of users) {
if (user.username === 'root') {
- this.notificationsService.error(this.i18n('Error'), this.i18n('You cannot delete root.'))
+ this.notifier.error(this.i18n('You cannot delete root.'))
return
}
}
this.userService.removeUser(users).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('{{num}} users deleted.', { num: users.length })
- )
+ this.notifier.success(this.i18n('{{num}} users deleted.', { num: users.length }))
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
async setEmailsAsVerified (users: User[]) {
this.userService.updateUsers(users, { emailVerified: true }).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('{{num}} users email set as verified.', { num: users.length })
- )
+ this.notifier.success(this.i18n('{{num}} users email set as verified.', { num: users.length }))
this.loadData()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.selectedUsers = []
this.userService.getUsers(this.pagination, this.sort, this.search)
- .subscribe(
- resultList => {
- this.users = resultList.data
- this.totalRecords = resultList.total
- },
-
- err => this.notificationsService.error(this.i18n('Error'), err.message)
- )
+ .subscribe(
+ resultList => {
+ this.users = resultList.data
+ this.totalRecords = resultList.total
+ },
+
+ err => this.notifier.error(err.message)
+ )
}
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
-import { BlocklistService, AccountBlock } from '@app/shared/blocklist'
+import { AccountBlock, BlocklistService } from '@app/shared/blocklist'
@Component({
selector: 'my-account-blocklist',
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private blocklistService: BlocklistService,
private i18n: I18n
) {
this.blocklistService.unblockAccountByUser(blockedAccount)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: blockedAccount.nameWithHost })
- )
+ this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: blockedAccount.nameWithHost }))
this.loadData()
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private blocklistService: BlocklistService,
private i18n: I18n
) {
this.blocklistService.unblockServerByUser(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} unmuted.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} unmuted.', { host }))
this.loadData()
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { ScreenService } from '@app/shared/misc/screen.service'
import { UserHistoryService } from '@app/shared/users/user-history.service'
import { UserService } from '@app/shared'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-account-history',
protected route: ActivatedRoute,
protected authService: AuthService,
protected userService: UserService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected location: Location,
protected screenService: ScreenService,
protected i18n: I18n,
this.i18n('Videos history is enabled') :
this.i18n('Videos history is disabled')
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.authService.refreshUserInformation()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.userHistoryService.deleteUserVideosHistory()
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Videos history deleted'))
+ this.notifier.success(this.i18n('Videos history deleted'))
this.reloadVideos()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { FormReactive } from '@app/shared'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoOwnershipService } from '@app/shared/video-ownership'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { AuthService } from '@app/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
@Component({
protected formValidatorService: FormValidatorService,
private videoChangeOwnershipValidatorsService: VideoAcceptOwnershipValidatorsService,
private videoOwnershipService: VideoOwnershipService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private authService: AuthService,
private videoChannelService: VideoChannelService,
private modalService: NgbModal,
.acceptOwnership(videoChangeOwnership.id, { channelId: channel })
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Ownership accepted'))
+ this.notifier.success(this.i18n('Ownership accepted'))
if (this.accepted) this.accepted.emit()
this.videoChangeOwnership = undefined
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
-import { I18n } from '@ngx-translate/i18n-polyfill'
+import { Notifier } from '@app/core'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
import { VideoChangeOwnership } from '../../../../../shared'
import { VideoOwnershipService } from '@app/shared/video-ownership'
import { Account } from '@app/shared/account/account.model'
-import { MyAccountAcceptOwnershipComponent }
-from '@app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component'
+import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component'
@Component({
selector: 'my-account-ownership',
@ViewChild('myAccountAcceptOwnershipComponent') myAccountAcceptOwnershipComponent: MyAccountAcceptOwnershipComponent
constructor (
- private notificationsService: NotificationsService,
- private videoOwnershipService: VideoOwnershipService,
- private i18n: I18n
+ private notifier: Notifier,
+ private videoOwnershipService: VideoOwnershipService
) {
super()
}
this.videoOwnershipService.refuseOwnership(videoChangeOwnership.id)
.subscribe(
() => this.loadData(),
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { FormReactive, UserService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
import { filter } from 'rxjs/operators'
-import { AuthService } from '@app/core'
import { User } from '../../../../../../shared'
@Component({
constructor (
protected formValidatorService: FormValidatorService,
private userValidatorsService: UserValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private authService: AuthService,
private userService: UserService,
private i18n: I18n
this.userService.changePassword(currentPassword, newPassword).subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Password updated.'))
+ this.notifier.success(this.i18n('Password updated.'))
this.form.reset()
this.error = null
import { Component, Input } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { AuthService, ConfirmService, RedirectService } from '../../../core'
import { UserService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
constructor (
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private confirmService: ConfirmService,
private redirectService: RedirectService,
this.userService.deleteMe().subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Your account is deleted.'))
+ this.notifier.success(this.i18n('Your account is deleted.'))
this.authService.logout()
this.redirectService.redirectToHomepage()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, Input, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { FormReactive, UserService } from '../../../shared'
import { User } from '@app/shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
constructor (
protected formValidatorService: FormValidatorService,
private userValidatorsService: UserValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private i18n: I18n
) {
this.user.account.displayName = displayName
this.user.account.description = description
- this.notificationsService.success(this.i18n('Success'), this.i18n('Profile updated.'))
+ this.notifier.success(this.i18n('Profile updated.'))
},
err => this.error = err.message
import { Component, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { BytesPipe } from 'ngx-pipes'
import { AuthService } from '../../core'
import { User } from '../../shared'
constructor (
private userService: UserService,
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) {}
this.userService.changeAvatar(formData)
.subscribe(
data => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Avatar changed.'))
+ this.notifier.success(this.i18n('Avatar changed.'))
this.user.updateAccountAvatar(data.avatar)
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, Input, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { UserUpdateMe } from '../../../../../../shared'
import { AuthService } from '../../../core'
import { FormReactive, User, UserService } from '../../../shared'
constructor (
protected formValidatorService: FormValidatorService,
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private i18n: I18n
) {
this.userService.updateMyProfile(details).subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Information updated.'))
+ this.notifier.success(this.i18n('Information updated.'))
this.authService.refreshUserInformation()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { UserSubscriptionService } from '@app/shared/user-subscription'
constructor (
private userSubscriptionService: UserSubscriptionService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) {}
this.pagination.totalItems = res.total
},
- error => this.notificationsService.error(this.i18n('Error'), error.message)
+ error => this.notifier.error(error.message)
)
}
import { Component, OnInit } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
import { VideoChannelCreate } from '../../../../../shared/models/videos'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
-import { AuthService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service'
protected formValidatorService: FormValidatorService,
private authService: AuthService,
private videoChannelValidatorsService: VideoChannelValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private router: Router,
private videoChannelService: VideoChannelService,
private i18n: I18n
this.videoChannelService.createVideoChannel(videoChannelCreate).subscribe(
() => {
this.authService.refreshUserInformation()
- this.notificationsService.success(
- this.i18n('Success'),
+
+ this.notifier.success(
this.i18n('Video channel {{videoChannelName}} created.', { videoChannelName: videoChannelCreate.displayName })
)
this.router.navigate([ '/my-account', 'video-channels' ])
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier, ServerService } from '@app/core'
import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
import { VideoChannelUpdate } from '../../../../../shared/models/videos'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
import { Subscription } from 'rxjs'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
-import { AuthService, ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service'
protected formValidatorService: FormValidatorService,
private authService: AuthService,
private videoChannelValidatorsService: VideoChannelValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private router: Router,
private route: ActivatedRoute,
private videoChannelService: VideoChannelService,
this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.name, videoChannelUpdate).subscribe(
() => {
this.authService.refreshUserInformation()
- this.notificationsService.success(
- this.i18n('Success'),
+
+ this.notifier.success(
this.i18n('Video channel {{videoChannelName}} updated.', { videoChannelName: videoChannelUpdate.displayName })
)
+
this.router.navigate([ '/my-account', 'video-channels' ])
},
this.videoChannelService.changeVideoChannelAvatar(this.videoChannelToUpdate.name, formData)
.subscribe(
data => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Avatar changed.'))
+ this.notifier.success(this.i18n('Avatar changed.'))
this.videoChannelToUpdate.updateAvatar(data.avatar)
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
constructor (
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private videoChannelService: VideoChannelService,
private i18n: I18n
this.videoChannelService.removeVideoChannel(videoChannel)
.subscribe(
- status => {
+ () => {
this.loadVideoChannels()
- this.notificationsService.success(
- this.i18n('Success'),
+ this.notifier.success(
this.i18n('Video channel {{videoChannelName}} deleted.', { videoChannelName: videoChannel.displayName })
)
},
- error => this.notificationsService.error(this.i18n('Error'), error.message)
+ error => this.notifier.error(error.message)
)
}
import { Component, OnInit } from '@angular/core'
import { RestPagination, RestTable } from '@app/shared'
import { SortMeta } from 'primeng/components/common/sortmeta'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { VideoImport, VideoImportState } from '../../../../../shared/models/videos'
import { VideoImportService } from '@app/shared/video-import'
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoImportService: VideoImportService,
private i18n: I18n
) {
this.totalRecords = resultList.total
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
protected router: Router,
protected route: ActivatedRoute,
protected authService: AuthService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected location: Location,
protected screenService: ScreenService,
protected i18n: I18n,
.pipe(concatAll())
.subscribe(
res => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('{{deleteLength}} videos deleted.', { deleteLength: toDeleteVideosIds.length })
- )
+ this.notifier.success(this.i18n('{{deleteLength}} videos deleted.', { deleteLength: toDeleteVideosIds.length }))
this.abortSelectionMode()
this.reloadVideos()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.videoService.removeVideo(video.id)
.subscribe(
- status => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Video {{videoName}} deleted.', { videoName: video.name })
- )
+ () => {
+ this.notifier.success(this.i18n('Video {{videoName}} deleted.', { videoName: video.name }))
this.reloadVideos()
},
- error => this.notificationsService.error(this.i18n('Error'), error.message)
+ error => this.notifier.error(error.message)
)
}
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { FormReactive, UserService } from '../../../shared/index'
import { Video } from '@app/shared/video/video.model'
protected formValidatorService: FormValidatorService,
private videoChangeOwnershipValidatorsService: VideoChangeOwnershipValidatorsService,
private videoOwnershipService: VideoOwnershipService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private modalService: NgbModal,
private i18n: I18n
const query = event.query
this.userService.autocomplete(query)
.subscribe(
- usernames => {
- this.usernamePropositions = usernames
- },
+ usernames => this.usernamePropositions = usernames,
- err => this.notificationsService.error('Error', err.message)
+ err => this.notifier.error(err.message)
)
}
this.videoOwnershipService
.changeOwnership(this.video.id, username)
.subscribe(
- () => this.notificationsService.success(this.i18n('Success'), this.i18n('Ownership change request sent.')),
+ () => this.notifier.success(this.i18n('Ownership change request sent.')),
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core'
import { ServerService } from '../../core/server'
-import { NotificationsService } from 'angular2-notifications'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { Account } from '@app/shared/account/account.model'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-actor-avatar-info',
constructor (
private serverService: ServerService,
- private notificationsService: NotificationsService
+ private notifier: Notifier
) {}
onAvatarChange () {
const avatarfile = this.avatarfileInput.nativeElement.files[ 0 ]
if (avatarfile.size > this.maxAvatarSize) {
- this.notificationsService.error('Error', 'This image is too large.')
+ this.notifier.error('Error', 'This image is too large.')
return
}
import { Component, OnInit } from '@angular/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier, RedirectService } from '@app/core'
import { ServerService } from '@app/core/server'
-import { RedirectService } from '@app/core'
-import { UserService, FormReactive } from '@app/shared'
+import { FormReactive, UserService } from '@app/shared'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
private userValidatorsService: UserValidatorsService,
private userService: UserService,
private serverService: ServerService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private redirectService: RedirectService,
private i18n: I18n
) {
'An email with verification link will be sent to {{email}}.',
{ email }
)
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.redirectService.redirectToHomepage()
},
err => {
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { UserService } from '@app/shared'
@Component({
constructor (
private userService: UserService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private router: Router,
private route: ActivatedRoute,
private i18n: I18n
this.verificationString = this.route.snapshot.queryParams['verificationString']
if (!this.userId || !this.verificationString) {
- this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.'))
+ this.notifier.error(this.i18n('Unable to find user id or verification string.'))
} else {
this.verifyEmail()
}
},
err => {
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { Subscription } from 'rxjs'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-video-channel-videos',
protected router: Router,
protected route: ActivatedRoute,
protected authService: AuthService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected confirmService: ConfirmService,
protected location: Location,
protected screenService: ScreenService,
<ngx-loading-bar [includeSpinner]="false"></ngx-loading-bar>
<my-confirm></my-confirm>
-<simple-notifications [options]="notificationOptions"></simple-notifications>
+<p-toast position="bottom-right">
+ <ng-template let-message pTemplate="message">
+ <div class="message">
+ <h3>{{ message.summary }}</h3>
+ <p>{{ message.detail }}</p>
+ </div>
+
+ <span *ngIf="message.severity === 'success'" class="glyphicon glyphicon-ok"></span>
+ <span *ngIf="message.severity === 'info'" class="glyphicon glyphicon-info-sign"></span>
+ <span *ngIf="message.severity === 'error'" class="glyphicon glyphicon-remove"></span>
+ </ng-template>
+</p-toast>
styleUrls: [ './app.component.scss' ]
})
export class AppComponent implements OnInit {
- notificationOptions = {
- timeOut: 5000,
- lastOnBottom: true,
- clickToClose: true,
- maxLength: 0,
- maxStack: 7,
- showProgressBar: false,
- pauseOnHover: false,
- preventDuplicates: false,
- preventLastDuplicates: 'visible',
- rtl: false
- }
-
isMenuDisplayed = true
isMenuChangedByUser = false
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core/notification'
import { OAuthClientLocal, User as UserServerModel, UserRefreshToken } from '../../../../../shared'
import { User } from '../../../../../shared/models/users'
import { UserLogin } from '../../../../../shared/models/users/user-login.model'
constructor (
private http: HttpClient,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private hotkeysService: HotkeysService,
private restExtractor: RestExtractor,
private router: Router,
)
}
- // We put a bigger timeout
- // This is an important message
- this.notificationsService.error(this.i18n('Error'), errorMessage, { timeOut: 7000 })
+ // We put a bigger timeout: this is an important message
+ this.notifier.error(errorMessage, this.i18n('Error'), 7000)
}
)
}
export * from './auth-status.model'
export * from './auth-user.model'
export * from './auth.service'
-export * from '../routing/login-guard.service'
import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'
import { LoadingBarRouterModule } from '@ngx-loading-bar/router'
-import { SimpleNotificationsModule } from 'angular2-notifications'
-
import { AuthService } from './auth'
import { ConfirmComponent, ConfirmService } from './confirm'
import { throwIfAlreadyLoaded } from './module-import-guard'
import { ServerService } from './server'
import { ThemeService } from './theme'
import { HotkeyModule } from 'angular2-hotkeys'
-import { CheatSheetComponent } from '@app/core/hotkeys'
+import { CheatSheetComponent } from './hotkeys'
+import { ToastModule } from 'primeng/toast'
+import { Notifier } from './notification'
+import { MessageService } from 'primeng/api'
@NgModule({
imports: [
FormsModule,
BrowserAnimationsModule,
- SimpleNotificationsModule.forRoot(),
-
LoadingBarHttpClientModule,
LoadingBarRouterModule,
LoadingBarModule,
+ ToastModule,
HotkeyModule.forRoot({
cheatSheetCloseEsc: true
],
exports: [
- SimpleNotificationsModule,
LoadingBarHttpClientModule,
LoadingBarModule,
+ ToastModule,
+
ConfirmComponent,
CheatSheetComponent
],
ThemeService,
LoginGuard,
UserRightGuard,
- RedirectService
+ RedirectService,
+ Notifier,
+ MessageService
]
})
export class CoreModule {
export * from './confirm'
export * from './routing'
export * from './server'
+export * from './notification'
export * from './theme'
export * from './core.module'
--- /dev/null
+export * from './notifier.service'
--- /dev/null
+import { Injectable } from '@angular/core'
+import { MessageService } from 'primeng/api'
+import { I18n } from '@ngx-translate/i18n-polyfill'
+
+@Injectable()
+export class Notifier {
+ readonly TIMEOUT = 5000
+
+ constructor (
+ private i18n: I18n,
+ private messageService: MessageService) {
+ }
+
+ info (text: string, title?: string, timeout?: number) {
+ if (!title) title = this.i18n('Info')
+
+ return this.notify('info', text, title, timeout)
+ }
+
+ error (text: string, title?: string, timeout?: number) {
+ if (!title) title = this.i18n('Error')
+
+ return this.notify('error', text, title, timeout)
+ }
+
+ success (text: string, title?: string, timeout?: number) {
+ if (!title) title = this.i18n('Success')
+
+ return this.notify('success', text, title, timeout)
+ }
+
+ private notify (severity: 'success' | 'info' | 'warn' | 'error', text: string, title: string, timeout?: number) {
+ this.messageService.add({
+ severity,
+ summary: title,
+ detail: text,
+ closable: true,
+ life: timeout || this.TIMEOUT
+ })
+ }
+}
Router
} from '@angular/router'
-import { AuthService } from '../auth'
+import { AuthService } from '../auth/auth.service'
@Injectable()
export class UserRightGuard implements CanActivate, CanActivateChild {
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
-import { RedirectService, ServerService } from '@app/core'
+import { Notifier, RedirectService, ServerService } from '@app/core'
import { UserService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../core'
import { FormReactive } from '../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
private userService: UserService,
private serverService: ServerService,
private redirectService: RedirectService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) {
super()
'An email with the reset password instructions will be sent to {{email}}.',
{ email: this.forgotPasswordEmail }
)
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.hideForgotPasswordModal()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { UserService, UserValidatorsService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
-import { FormReactive } from '../shared'
+import { UserService, UserValidatorsService, FormReactive } from '@app/shared'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { ResetPasswordValidatorsService } from '@app/shared/forms/form-validators/reset-password-validators.service'
private resetPasswordValidatorsService: ResetPasswordValidatorsService,
private userValidatorsService: UserValidatorsService,
private userService: UserService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private router: Router,
private route: ActivatedRoute,
private i18n: I18n
this.verificationString = this.route.snapshot.queryParams['verificationString']
if (!this.userId || !this.verificationString) {
- this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.'))
+ this.notifier.error(this.i18n('Unable to find user id or verification string.'))
this.router.navigate([ '/' ])
}
}
this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password)
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Your password has been successfully reset!'))
+ this.notifier.success(this.i18n('Your password has been successfully reset!'))
this.router.navigate([ '/login' ])
},
- err => this.notificationsService.error('Error', err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
-import { ActivatedRoute } from '@angular/router'
-import { RedirectService, ServerService } from '@app/core'
-import { NotificationsService } from 'angular2-notifications'
-import { SearchService } from '@app/search/search.service'
+import { ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { MetaService } from '@ngx-meta/core'
import { AdvancedSearch } from '@app/search/advanced-search.model'
import { VideoConstant } from '../../../../shared'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService } from '@app/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { forkJoin, Subscription } from 'rxjs'
import { SearchService } from '@app/search/search.service'
import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
private route: ActivatedRoute,
private router: Router,
private metaService: MetaService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private searchService: SearchService,
private authService: AuthService
) { }
this.search()
},
- err => this.notificationsService.error('Error', err.text)
+ err => this.notifier.error(err.text)
)
}
this.firstSearch = false
},
- error => {
- this.notificationsService.error(this.i18n('Error'), error.message)
- }
+ err => this.notifier.error(err.message)
)
}
import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
private file: File
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) {}
const [ file ] = event.target.files
if (file.size > this.maxFileSize) {
- this.notificationsService.error(this.i18n('Error'), this.i18n('This file is too large.'))
+ this.notifier.error(this.i18n('This file is too large.'))
return
}
import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
constructor (
protected formValidatorService: FormValidatorService,
private modalService: NgbModal,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private userValidatorsService: UserValidatorsService,
private i18n: I18n
? this.i18n('{{num}} users banned.', { num: this.usersToBan.length })
: this.i18n('User {{username}} banned.', { username: this.usersToBan.username })
- this.notificationsService.success(this.i18n('Success'), message)
+ this.notifier.success(message)
this.userBanned.emit(this.usersToBan)
this.hideBanUserModal()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component'
import { UserService } from '@app/shared/users'
-import { AuthService, ConfirmService, ServerService } from '@app/core'
+import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
import { User, UserRight } from '../../../../../shared/models/users'
import { Account } from '@app/shared/account/account.model'
import { BlocklistService } from '@app/shared/blocklist'
constructor (
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private serverService: ServerService,
private userService: UserService,
openBanUserModal (user: User) {
if (user.username === 'root') {
- this.notificationsService.error(this.i18n('Error'), this.i18n('You cannot ban root.'))
+ this.notifier.error(this.i18n('You cannot ban root.'))
return
}
this.userService.unbanUsers(user)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('User {{username}} unbanned.', { username: user.username })
- )
+ this.notifier.success(this.i18n('User {{username}} unbanned.', { username: user.username }))
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
async removeUser (user: User) {
if (user.username === 'root') {
- this.notificationsService.error(this.i18n('Error'), this.i18n('You cannot delete root.'))
+ this.notifier.error(this.i18n('You cannot delete root.'))
return
}
this.userService.removeUser(user).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('User {{username}} deleted.', { username: user.username })
- )
+ this.notifier.success(this.i18n('User {{username}} deleted.', { username: user.username }))
this.userDeleted.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
setEmailAsVerified (user: User) {
this.userService.updateUser(user.id, { emailVerified: true }).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('User {{username}} email set as verified', { username: user.username })
- )
+ this.notifier.success(this.i18n('User {{username}} email set as verified', { username: user.username }))
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.blockAccountByUser(account)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Account {{nameWithHost}} muted.', { nameWithHost: account.nameWithHost })
- )
+ this.notifier.success(this.i18n('Account {{nameWithHost}} muted.', { nameWithHost: account.nameWithHost }))
this.account.mutedByUser = true
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.unblockAccountByUser(account)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: account.nameWithHost })
- )
+ this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: account.nameWithHost }))
this.account.mutedByUser = false
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.blockServerByUser(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} muted.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} muted.', { host }))
this.account.mutedServerByUser = true
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.unblockServerByUser(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} unmuted.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} unmuted.', { host }))
this.account.mutedServerByUser = false
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.blockAccountByInstance(account)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Account {{nameWithHost}} muted by the instance.', { nameWithHost: account.nameWithHost })
- )
+ this.notifier.success(this.i18n('Account {{nameWithHost}} muted by the instance.', { nameWithHost: account.nameWithHost }))
this.account.mutedByInstance = true
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.unblockAccountByInstance(account)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Account {{nameWithHost}} unmuted by the instance.', { nameWithHost: account.nameWithHost })
- )
+ this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted by the instance.', { nameWithHost: account.nameWithHost }))
this.account.mutedByInstance = false
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.blockServerByInstance(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} muted by the instance.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} muted by the instance.', { host }))
this.account.mutedServerByInstance = true
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.blocklistService.unblockServerByInstance(host)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} unmuted by the instance.', { host })
- )
+ this.notifier.success(this.i18n('Instance {{host}} unmuted by the instance.', { host }))
this.account.mutedServerByInstance = false
this.userChanged.emit()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, Input, OnInit } from '@angular/core'
import { Router } from '@angular/router'
-import { AuthService } from '@app/core'
+import { AuthService, Notifier } from '@app/core'
import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
-import { NotificationsService } from 'angular2-notifications'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { VideoService } from '@app/shared/video/video.service'
import { FeedFormat } from '../../../../../shared/models/feeds'
constructor (
private authService: AuthService,
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userSubscriptionService: UserSubscriptionService,
private i18n: I18n,
private videoService: VideoService
.subscribe(
res => this.subscribed = res[this.uri],
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
() => {
this.subscribed = true
- this.notificationsService.success(
- this.i18n('Subscribed'),
- this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName })
+ this.notifier.success(
+ this.i18n('Subscribed to {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }),
+ this.i18n('Subscribed')
)
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
() => {
this.subscribed = false
- this.notificationsService.success(
- this.i18n('Unsubscribed'),
- this.i18n('Unsubscribed from {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName })
+ this.notifier.success(
+ this.i18n('Unsubscribed from {{nameWithHost}}', { nameWithHost: this.videoChannel.displayName }),
+ this.i18n('Unsubscribed')
)
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
-import { NotificationsService } from 'angular2-notifications'
import { fromEvent, Observable, Subscription } from 'rxjs'
import { AuthService } from '../../core/auth'
import { ComponentPagination } from '../rest/component-pagination.model'
import { ScreenService } from '@app/shared/misc/screen.service'
import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
import { Syndication } from '@app/shared/video/syndication.model'
+import { Notifier } from '@app/core'
export abstract class AbstractVideoList implements OnInit, OnDestroy {
private static LINES_PER_PAGE = 4
protected baseVideoWidth = 215
protected baseVideoHeight = 205
- protected abstract notificationsService: NotificationsService
+ protected abstract notifier: Notifier
protected abstract authService: AuthService
protected abstract router: Router
protected abstract route: ActivatedRoute
},
error => {
this.loadingPage[page] = false
- this.notificationsService.error(this.i18n('Error'), error.message)
+ this.notifier.error(error.message)
}
)
}
import { Component, OnInit } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier, RedirectService, ServerService } from '@app/core'
import { UserCreate } from '../../../../shared'
import { FormReactive, UserService, UserValidatorsService } from '../shared'
-import { AuthService, RedirectService, ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
protected formValidatorService: FormValidatorService,
private authService: AuthService,
private userValidatorsService: UserValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private userService: UserService,
private serverService: ServerService,
private redirectService: RedirectService,
this.authService.login(userCreate.username, userCreate.password)
.subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('You are now logged in as {{username}}!', { username: userCreate.username })
- )
+ this.notifier.success(this.i18n('You are now logged in as {{username}}!', { username: userCreate.username }))
this.redirectService.redirectToHomepage()
},
import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
import { ActivatedRoute, Router } from '@angular/router'
import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { ServerService } from '../../../core/server'
import { VideoEdit } from '../../../shared/video/video-edit.model'
import { map } from 'rxjs/operators'
private videoCaptionService: VideoCaptionService,
private route: ActivatedRoute,
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private serverService: ServerService,
private i18nPrimengCalendarService: I18nPrimengCalendarService
) {
import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos'
-import { AuthService, ServerService } from '../../../core'
+import { AuthService, Notifier, ServerService } from '../../../core'
import { VideoService } from '../../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { LoadingBarService } from '@ngx-loading-bar/core'
constructor (
protected formValidatorService: FormValidatorService,
protected loadingBar: LoadingBarService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected serverService: ServerService,
protected videoService: VideoService,
this.loadingBar.complete()
this.isImportingVideo = false
this.firstStepError.emit()
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
.subscribe(
() => {
this.isUpdatingVideo = false
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video to import updated.'))
+ this.notifier.success(this.i18n('Video to import updated.'))
this.router.navigate([ '/my-account', 'video-imports' ])
},
import { Component, EventEmitter, OnInit, Output } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos'
-import { AuthService, ServerService } from '../../../core'
+import { AuthService, Notifier, ServerService } from '../../../core'
import { VideoService } from '../../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { LoadingBarService } from '@ngx-loading-bar/core'
constructor (
protected formValidatorService: FormValidatorService,
protected loadingBar: LoadingBarService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected serverService: ServerService,
protected videoService: VideoService,
this.loadingBar.complete()
this.isImportingVideo = false
this.firstStepError.emit()
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
.subscribe(
() => {
this.isUpdatingVideo = false
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video to import updated.'))
+ this.notifier.success(this.i18n('Video to import updated.'))
this.router.navigate([ '/my-account', 'video-imports' ])
},
import { EventEmitter, OnInit } from '@angular/core'
import { LoadingBarService } from '@ngx-loading-bar/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier, ServerService } from '@app/core'
import { catchError, switchMap, tap } from 'rxjs/operators'
import { FormReactive } from '@app/shared'
import { VideoConstant, VideoPrivacy } from '../../../../../../shared'
-import { AuthService, ServerService } from '@app/core'
import { VideoService } from '@app/shared/video/video.service'
import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
import { VideoCaptionService } from '@app/shared/video-caption'
protected abstract readonly DEFAULT_VIDEO_PRIVACY: VideoPrivacy
protected loadingBar: LoadingBarService
- protected notificationsService: NotificationsService
+ protected notifier: Notifier
protected authService: AuthService
protected serverService: ServerService
protected videoService: VideoService
import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { Router } from '@angular/router'
import { LoadingBarService } from '@ngx-loading-bar/core'
-import { NotificationsService } from 'angular2-notifications'
import { BytesPipe } from 'ngx-pipes'
import { Subscription } from 'rxjs'
import { VideoPrivacy } from '../../../../../../shared/models/videos'
-import { AuthService, ServerService } from '../../../core'
+import { AuthService, Notifier, ServerService } from '../../../core'
import { VideoEdit } from '../../../shared/video/video-edit.model'
import { VideoService } from '../../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
constructor (
protected formValidatorService: FormValidatorService,
protected loadingBar: LoadingBarService,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected serverService: ServerService,
protected videoService: VideoService,
this.isUploadingVideo = false
this.videoUploadPercents = 0
this.videoUploadObservable = null
- this.notificationsService.info(this.i18n('Info'), this.i18n('Upload cancelled'))
+ this.notifier.info(this.i18n('Upload cancelled'))
}
}
videoQuota: bytePipes.transform(videoQuota, 0)
}
)
- this.notificationsService.error(this.i18n('Error'), msg)
+ this.notifier.error(msg)
return
}
quotaDaily: bytePipes.transform(videoQuotaDaily, 0)
}
)
- this.notificationsService.error(this.i18n('Error'), msg)
+ this.notifier.error(msg)
return
}
this.videoUploadPercents = 0
this.videoUploadObservable = null
this.firstStepError.emit()
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
this.isUpdatingVideo = false
this.isUploadingVideo = false
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video published.'))
+ this.notifier.success(this.i18n('Video published.'))
this.router.navigate([ '/videos/watch', video.uuid ])
},
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { LoadingBarService } from '@ngx-loading-bar/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos'
import { ServerService } from '../../core'
import { FormReactive } from '../../shared'
protected formValidatorService: FormValidatorService,
private route: ActivatedRoute,
private router: Router,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private serverService: ServerService,
private videoService: VideoService,
private loadingBar: LoadingBarService,
err => {
console.error(err)
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
}
)
}
this.updateDone = true
this.isUpdatingVideo = false
this.loadingBar.complete()
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video updated.'))
+ this.notifier.success(this.i18n('Video updated.'))
this.router.navigate([ '/videos/watch', this.video.uuid ])
},
err => {
this.loadingBar.complete()
this.isUpdatingVideo = false
- this.notificationsService.error(this.i18n('Error'), err.message)
+ this.notifier.error(err.message)
console.error(err)
}
)
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
import { Router } from '@angular/router'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { Observable } from 'rxjs'
import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model'
import { FormReactive } from '../../../shared'
constructor (
protected formValidatorService: FormValidatorService,
private videoCommentValidatorsService: VideoCommentValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private videoCommentService: VideoCommentService,
private authService: AuthService,
private modalService: NgbModal,
err => {
this.addingComment = false
- this.notificationsService.error(this.i18n('Error'), err.text)
+ this.notifier.error(err.text)
}
)
}
-import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild, ElementRef } from '@angular/core'
+import { Component, ElementRef, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild } from '@angular/core'
import { ActivatedRoute } from '@angular/router'
-import { ConfirmService } from '@app/core'
-import { NotificationsService } from 'angular2-notifications'
+import { ConfirmService, Notifier } from '@app/core'
import { Subscription } from 'rxjs'
import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/video-comment.model'
import { AuthService } from '../../../core/auth'
constructor (
private authService: AuthService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private confirmService: ConfirmService,
private videoCommentService: VideoCommentService,
private activatedRoute: ActivatedRoute,
}
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.componentPagination.totalItems = res.totalComments
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
if (this.highlightedThread.id === commentToDelete.id) this.highlightedThread = undefined
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, Input, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier, RedirectService } from '@app/core'
import { FormReactive, VideoBlacklistService, VideoBlacklistValidatorsService } from '../../../shared/index'
import { VideoDetails } from '../../../shared/video/video-details.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
-import { RedirectService } from '@app/core'
@Component({
selector: 'my-video-blacklist',
private modalService: NgbModal,
private videoBlacklistValidatorsService: VideoBlacklistValidatorsService,
private videoBlacklistService: VideoBlacklistService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private redirectService: RedirectService,
private i18n: I18n
) {
this.videoBlacklistService.blacklistVideo(this.video.id, reason)
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video blacklisted.'))
+ this.notifier.success(this.i18n('Video blacklisted.'))
this.hide()
this.redirectService.redirectToHomepage()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
}
import { VideoDetails } from '../../../shared/video/video-details.model'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { I18n } from '@ngx-translate/i18n-polyfill'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-video-download',
resolutionId: number | string = -1
constructor (
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private modalService: NgbModal,
private i18n: I18n
) { }
}
activateCopiedMessage () {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Copied'))
+ this.notifier.success(this.i18n('Copied'))
}
}
import { Component, Input, OnInit, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { FormReactive, VideoAbuseService } from '../../../shared/index'
import { VideoDetails } from '../../../shared/video/video-details.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
private modalService: NgbModal,
private videoAbuseValidatorsService: VideoAbuseValidatorsService,
private videoAbuseService: VideoAbuseService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) {
super()
this.videoAbuseService.reportVideo(this.video.id, reason)
.subscribe(
() => {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Video reported.'))
+ this.notifier.success(this.i18n('Video reported.'))
this.hide()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
import { Component, ElementRef, Input, ViewChild } from '@angular/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { VideoDetails } from '../../../shared/video/video-details.model'
import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils'
import { I18n } from '@ngx-translate/i18n-polyfill'
constructor (
private modalService: NgbModal,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private i18n: I18n
) { }
}
activateCopiedMessage () {
- this.notificationsService.success(this.i18n('Success'), this.i18n('Copied'))
+ this.notifier.success(this.i18n('Copied'))
}
getStartCheckboxLabel () {
import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component'
import { MetaService } from '@ngx-meta/core'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier, ServerService } from '@app/core'
import { forkJoin, Subscription } from 'rxjs'
// FIXME: something weird with our path definition in tsconfig and typings
// @ts-ignore
import 'videojs-hotkeys'
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import * as WebTorrent from 'webtorrent'
-import { UserVideoRateType, VideoCaption, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared'
+import { UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared'
import '../../../assets/player/peertube-videojs-plugin'
import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared'
import { VideoBlacklistComponent } from './modal/video-blacklist.component'
import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
import { addContextMenu, getVideojsOptions, loadLocaleInVideoJS } from '../../../assets/player/peertube-player'
-import { ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { environment } from '../../../environments/environment'
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
private authService: AuthService,
private serverService: ServerService,
private restExtractor: RestExtractor,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private markdownService: MarkdownService,
private zone: NgZone,
private redirectService: RedirectService,
error => {
this.descriptionLoading = false
- this.notificationsService.error(this.i18n('Error'), error.message)
+ this.notifier.error(error.message)
}
)
}
this.videoBlacklistService.removeVideoFromBlacklist(this.video.id).subscribe(
() => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Video {{name}} removed from the blacklist.', { name: this.video.name })
- )
+ this.notifier.success(this.i18n('Video {{name}} removed from the blacklist.', { name: this.video.name }))
this.video.blacklisted = false
this.video.blacklistedReason = null
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.videoService.removeVideo(this.video.id)
.subscribe(
- status => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Video {{videoName}} deleted.', { videoName: this.video.name })
- )
+ () => {
+ this.notifier.success(this.i18n('Video {{videoName}} deleted.', { videoName: this.video.name }))
// Go back to the video-list.
this.redirectService.redirectToHomepage()
},
- error => this.notificationsService.error(this.i18n('Error'), error.message)
+ error => this.notifier.error(error.message)
)
}
return
}
- this.notificationsService.error(this.i18n('Error'), errorMessage)
+ this.notifier.error(errorMessage)
}
private checkUserRating () {
}
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
this.userRating = nextRating
},
- (err: { message: string }) => this.notificationsService.error(this.i18n('Error'), err.message)
+ (err: { message: string }) => this.notifier.error(err.message)
)
}
import { ActivatedRoute, Router } from '@angular/router'
import { immutableAssign } from '@app/shared/misc/utils'
import { Location } from '@angular/common'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoSortField } from '../../shared/video/sort-field.type'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
import { UserRight } from '../../../../../shared/models/users'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-videos-local',
constructor (
protected router: Router,
protected route: ActivatedRoute,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected location: Location,
protected i18n: I18n,
import { Component, OnInit } from '@angular/core'
-import { AuthService } from '@app/core'
-import { NotificationsService } from 'angular2-notifications'
+import { AuthService, Notifier } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { VideosOverview } from '@app/shared/overview/videos-overview.model'
import { OverviewService } from '@app/shared/overview'
constructor (
private i18n: I18n,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private authService: AuthService,
private overviewService: OverviewService
) { }
) this.notResults = true
},
- err => {
- console.log(err)
- this.notificationsService.error('Error', err.text)
- }
+ err => this.notifier.error(err.message)
)
}
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoSortField } from '../../shared/video/sort-field.type'
import { VideoService } from '../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-videos-recently-added',
protected router: Router,
protected route: ActivatedRoute,
protected location: Location,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected i18n: I18n,
protected screenService: ScreenService,
import { ActivatedRoute, Router } from '@angular/router'
import { Location } from '@angular/common'
import { immutableAssign } from '@app/shared/misc/utils'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoSortField } from '../../shared/video/sort-field.type'
import { VideoService } from '../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-videos-trending',
constructor (
protected router: Router,
protected route: ActivatedRoute,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected location: Location,
protected screenService: ScreenService,
import { ActivatedRoute, Router } from '@angular/router'
import { immutableAssign } from '@app/shared/misc/utils'
import { Location } from '@angular/common'
-import { NotificationsService } from 'angular2-notifications'
import { AuthService } from '../../core/auth'
import { AbstractVideoList } from '../../shared/video/abstract-video-list'
import { VideoSortField } from '../../shared/video/sort-field.type'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { ScreenService } from '@app/shared/misc/screen.service'
import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
+import { Notifier } from '@app/core'
@Component({
selector: 'my-videos-user-subscriptions',
constructor (
protected router: Router,
protected route: ActivatedRoute,
- protected notificationsService: NotificationsService,
+ protected notifier: Notifier,
protected authService: AuthService,
protected location: Location,
protected i18n: I18n,
background-color: var(--mainColor) !important;
}
}
+
+p-toast {
+ .ui-toast-message {
+ font-family: $main-fonts;
+
+ &.ui-toast-message-success {
+ color: #fff !important;
+ background-color: #8BC34A !important;
+ }
+
+ &.ui-toast-message-error {
+ color: #fff !important;
+ background-color: #F44336 !important;
+ }
+
+ &.ui-toast-message-info {
+ color: #fff !important;
+ background-color: #03A9F4 !important;
+ }
+
+ &.ui-toast-message-info {
+ color: #fff !important;
+ background-color: #03A9F4 !important;
+ }
+
+ .message {
+ float: left;
+
+ h3 {
+ font-size: 21px;
+ }
+
+ p {
+ font-size: 15px;
+ }
+ }
+
+ .glyphicon {
+ float: right;
+ font-size: 32px;
+ margin-top: 15px;
+ margin-right: 5px;
+ }
+ }
+}
"@types/mousetrap" "^1.6.0"
mousetrap "^1.6.0"
-angular2-notifications@^1.0.2:
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/angular2-notifications/-/angular2-notifications-1.0.4.tgz#7b3c449dbad45503965f8cd8ac00e998a4463544"
- integrity sha512-DjazfwXtLY8BNXKIEw1oEEMy7G6fmldpzP1FYwyVGUwEtZPLQyYGu9MQYCjtVlZMljxpa3qvnv8l9ZUfXAarNA==
-
ansi-colors@^3.0.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.2.tgz#e49349137dbeb6d381b91e607c189915e53265ba"