]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/video-add-components/video-send.ts
Remove deprecated NgbTabsetModule module
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / video-add-components / video-send.ts
index cf9d47cbe0d9349e85ce20407ac74ce80ab91652..b32f16950908a8f05f72557b38336ef0f3bd7622 100644 (file)
@@ -1,18 +1,17 @@
 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 { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
-import { VideoConstant, VideoPrivacy } from '../../../../../../shared'
-import { AuthService, ServerService } from '@app/core'
+import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared'
 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'
 import { VideoEdit } from '@app/shared/video/video-edit.model'
 import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils'
+import { CanComponentDeactivateResult } from '@app/shared/guards/can-deactivate-guard.service'
 
-export abstract class VideoSend extends FormReactive implements OnInit, CanComponentDeactivate {
+export abstract class VideoSend extends FormReactive implements OnInit {
   userVideoChannels: { id: number, label: string, support: string }[] = []
   videoPrivacies: VideoConstant<VideoPrivacy>[] = []
   videoCaptions: VideoCaptionEdit[] = []
@@ -21,16 +20,18 @@ export abstract class VideoSend extends FormReactive implements OnInit, CanCompo
   firstStepChannelId = 0
 
   abstract firstStepDone: EventEmitter<string>
+  abstract firstStepError: EventEmitter<void>
   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
   protected videoCaptionService: VideoCaptionService
+  protected serverConfig: ServerConfig
 
-  abstract canDeactivate (): any
+  abstract canDeactivate (): CanComponentDeactivateResult
 
   ngOnInit () {
     this.buildForm({})
@@ -38,10 +39,14 @@ export abstract class VideoSend extends FormReactive implements OnInit, CanCompo
     populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
       .then(() => this.firstStepChannelId = this.userVideoChannels[ 0 ].id)
 
-    this.serverService.videoPrivaciesLoaded
+    this.serverConfig = this.serverService.getTmpConfig()
+    this.serverService.getConfig()
+        .subscribe(config => this.serverConfig = config)
+
+    this.serverService.getVideoPrivacies()
         .subscribe(
-          () => {
-            this.videoPrivacies = this.serverService.getVideoPrivacies()
+          privacies => {
+            this.videoPrivacies = privacies
 
             this.firstStepPrivacyId = this.DEFAULT_VIDEO_PRIVACY
           })