diff options
Diffstat (limited to 'client/src/app/+manage')
-rw-r--r-- | client/src/app/+manage/video-channel-edit/video-channel-create.component.ts | 13 | ||||
-rw-r--r-- | client/src/app/+manage/video-channel-edit/video-channel-update.component.ts | 18 |
2 files changed, 21 insertions, 10 deletions
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts b/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts index 5f8e0278e..8211451a4 100644 --- a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts +++ b/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { of } from 'rxjs' | 1 | import { of } from 'rxjs' |
2 | import { switchMap } from 'rxjs/operators' | 2 | import { switchMap } from 'rxjs/operators' |
3 | import { Component, OnInit } from '@angular/core' | 3 | import { AfterViewInit, Component, OnInit } from '@angular/core' |
4 | import { Router } from '@angular/router' | 4 | import { Router } from '@angular/router' |
5 | import { AuthService, Notifier } from '@app/core' | 5 | import { AuthService, HooksService, Notifier } from '@app/core' |
6 | import { | 6 | import { |
7 | VIDEO_CHANNEL_DESCRIPTION_VALIDATOR, | 7 | VIDEO_CHANNEL_DESCRIPTION_VALIDATOR, |
8 | VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, | 8 | VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, |
@@ -18,7 +18,7 @@ import { VideoChannelEdit } from './video-channel-edit' | |||
18 | templateUrl: './video-channel-edit.component.html', | 18 | templateUrl: './video-channel-edit.component.html', |
19 | styleUrls: [ './video-channel-edit.component.scss' ] | 19 | styleUrls: [ './video-channel-edit.component.scss' ] |
20 | }) | 20 | }) |
21 | export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit { | 21 | export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit, AfterViewInit { |
22 | error: string | 22 | error: string |
23 | videoChannel = new VideoChannel({}) | 23 | videoChannel = new VideoChannel({}) |
24 | 24 | ||
@@ -30,7 +30,8 @@ export class VideoChannelCreateComponent extends VideoChannelEdit implements OnI | |||
30 | private authService: AuthService, | 30 | private authService: AuthService, |
31 | private notifier: Notifier, | 31 | private notifier: Notifier, |
32 | private router: Router, | 32 | private router: Router, |
33 | private videoChannelService: VideoChannelService | 33 | private videoChannelService: VideoChannelService, |
34 | private hooks: HooksService | ||
34 | ) { | 35 | ) { |
35 | super() | 36 | super() |
36 | } | 37 | } |
@@ -44,6 +45,10 @@ export class VideoChannelCreateComponent extends VideoChannelEdit implements OnI | |||
44 | }) | 45 | }) |
45 | } | 46 | } |
46 | 47 | ||
48 | ngAfterViewInit () { | ||
49 | this.hooks.runAction('action:video-channel-create.init', 'video-channel') | ||
50 | } | ||
51 | |||
47 | formValidated () { | 52 | formValidated () { |
48 | this.error = undefined | 53 | this.error = undefined |
49 | 54 | ||
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts b/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts index 6b4947912..7e8d6ffe6 100644 --- a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts +++ b/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Subscription } from 'rxjs' | 1 | import { Subscription } from 'rxjs' |
2 | import { HttpErrorResponse } from '@angular/common/http' | 2 | import { HttpErrorResponse } from '@angular/common/http' |
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute } from '@angular/router' |
5 | import { AuthService, Notifier, RedirectService, ServerService } from '@app/core' | 5 | import { AuthService, HooksService, Notifier, RedirectService, ServerService } from '@app/core' |
6 | import { genericUploadErrorHandler } from '@app/helpers' | 6 | import { genericUploadErrorHandler } from '@app/helpers' |
7 | import { | 7 | import { |
8 | VIDEO_CHANNEL_DESCRIPTION_VALIDATOR, | 8 | VIDEO_CHANNEL_DESCRIPTION_VALIDATOR, |
@@ -19,7 +19,7 @@ import { VideoChannelEdit } from './video-channel-edit' | |||
19 | templateUrl: './video-channel-edit.component.html', | 19 | templateUrl: './video-channel-edit.component.html', |
20 | styleUrls: [ './video-channel-edit.component.scss' ] | 20 | styleUrls: [ './video-channel-edit.component.scss' ] |
21 | }) | 21 | }) |
22 | export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, OnDestroy { | 22 | export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, AfterViewInit, OnDestroy { |
23 | error: string | 23 | error: string |
24 | videoChannel: VideoChannel | 24 | videoChannel: VideoChannel |
25 | 25 | ||
@@ -31,11 +31,11 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI | |||
31 | protected formValidatorService: FormValidatorService, | 31 | protected formValidatorService: FormValidatorService, |
32 | private authService: AuthService, | 32 | private authService: AuthService, |
33 | private notifier: Notifier, | 33 | private notifier: Notifier, |
34 | private router: Router, | ||
35 | private route: ActivatedRoute, | 34 | private route: ActivatedRoute, |
36 | private videoChannelService: VideoChannelService, | 35 | private videoChannelService: VideoChannelService, |
37 | private serverService: ServerService, | 36 | private serverService: ServerService, |
38 | private redirectService: RedirectService | 37 | private redirectService: RedirectService, |
38 | private hooks: HooksService | ||
39 | ) { | 39 | ) { |
40 | super() | 40 | super() |
41 | } | 41 | } |
@@ -58,6 +58,8 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI | |||
58 | next: videoChannelToUpdate => { | 58 | next: videoChannelToUpdate => { |
59 | this.videoChannel = videoChannelToUpdate | 59 | this.videoChannel = videoChannelToUpdate |
60 | 60 | ||
61 | this.hooks.runAction('action:video-channel-update.video-channel.loaded', 'video-channel', { videoChannel: this.videoChannel }) | ||
62 | |||
61 | this.oldSupportField = videoChannelToUpdate.support | 63 | this.oldSupportField = videoChannelToUpdate.support |
62 | 64 | ||
63 | this.form.patchValue({ | 65 | this.form.patchValue({ |
@@ -74,6 +76,10 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI | |||
74 | }) | 76 | }) |
75 | } | 77 | } |
76 | 78 | ||
79 | ngAfterViewInit () { | ||
80 | this.hooks.runAction('action:video-channel-update.init', 'video-channel') | ||
81 | } | ||
82 | |||
77 | ngOnDestroy () { | 83 | ngOnDestroy () { |
78 | if (this.paramsSub) this.paramsSub.unsubscribe() | 84 | if (this.paramsSub) this.paramsSub.unsubscribe() |
79 | } | 85 | } |