]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
Fix video channels quick filter overflow
[github/Chocobozzz/PeerTube.git] / client / src / app / +manage / video-channel-edit / video-channel-create.component.ts
index 5f8e0278e3c2fd78c85c78e2115c7c684d376ebc..8ca94b0b384f81535b12f4d1fbbd6384cb09103e 100644 (file)
@@ -1,15 +1,15 @@
 import { of } from 'rxjs'
 import { switchMap } from 'rxjs/operators'
-import { Component, OnInit } from '@angular/core'
+import { AfterViewInit, Component, OnInit } from '@angular/core'
 import { Router } from '@angular/router'
-import { AuthService, Notifier } from '@app/core'
+import { AuthService, HooksService, Notifier } from '@app/core'
 import {
   VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
   VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
   VIDEO_CHANNEL_NAME_VALIDATOR,
   VIDEO_CHANNEL_SUPPORT_VALIDATOR
 } from '@app/shared/form-validators/video-channel-validators'
-import { FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactiveService } from '@app/shared/shared-forms'
 import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
 import { HttpStatusCode, VideoChannelCreate } from '@shared/models'
 import { VideoChannelEdit } from './video-channel-edit'
@@ -18,7 +18,7 @@ import { VideoChannelEdit } from './video-channel-edit'
   templateUrl: './video-channel-edit.component.html',
   styleUrls: [ './video-channel-edit.component.scss' ]
 })
-export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit {
+export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit, AfterViewInit {
   error: string
   videoChannel = new VideoChannel({})
 
@@ -26,24 +26,29 @@ export class VideoChannelCreateComponent extends VideoChannelEdit implements OnI
   private banner: FormData
 
   constructor (
-    protected formValidatorService: FormValidatorService,
+    protected formReactiveService: FormReactiveService,
     private authService: AuthService,
     private notifier: Notifier,
     private router: Router,
-    private videoChannelService: VideoChannelService
+    private videoChannelService: VideoChannelService,
+    private hooks: HooksService
   ) {
     super()
   }
 
   ngOnInit () {
     this.buildForm({
-      name: VIDEO_CHANNEL_NAME_VALIDATOR,
+      'name': VIDEO_CHANNEL_NAME_VALIDATOR,
       'display-name': VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
-      description: VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
-      support: VIDEO_CHANNEL_SUPPORT_VALIDATOR
+      'description': VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
+      'support': VIDEO_CHANNEL_SUPPORT_VALIDATOR
     })
   }
 
+  ngAfterViewInit () {
+    this.hooks.runAction('action:video-channel-create.init', 'video-channel')
+  }
+
   formValidated () {
     this.error = undefined