diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts index da4fb645a..081e956d2 100644 --- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts +++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts | |||
@@ -20,6 +20,7 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE | |||
20 | videoChannelToUpdate: VideoChannel | 20 | videoChannelToUpdate: VideoChannel |
21 | 21 | ||
22 | private paramsSub: Subscription | 22 | private paramsSub: Subscription |
23 | private oldSupportField: string | ||
23 | 24 | ||
24 | constructor ( | 25 | constructor ( |
25 | protected formValidatorService: FormValidatorService, | 26 | protected formValidatorService: FormValidatorService, |
@@ -39,7 +40,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE | |||
39 | this.buildForm({ | 40 | this.buildForm({ |
40 | 'display-name': this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME, | 41 | 'display-name': this.videoChannelValidatorsService.VIDEO_CHANNEL_DISPLAY_NAME, |
41 | description: this.videoChannelValidatorsService.VIDEO_CHANNEL_DESCRIPTION, | 42 | description: this.videoChannelValidatorsService.VIDEO_CHANNEL_DESCRIPTION, |
42 | support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT | 43 | support: this.videoChannelValidatorsService.VIDEO_CHANNEL_SUPPORT, |
44 | bulkVideosSupportUpdate: null | ||
43 | }) | 45 | }) |
44 | 46 | ||
45 | this.paramsSub = this.route.params.subscribe(routeParams => { | 47 | this.paramsSub = this.route.params.subscribe(routeParams => { |
@@ -49,6 +51,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE | |||
49 | videoChannelToUpdate => { | 51 | videoChannelToUpdate => { |
50 | this.videoChannelToUpdate = videoChannelToUpdate | 52 | this.videoChannelToUpdate = videoChannelToUpdate |
51 | 53 | ||
54 | this.oldSupportField = videoChannelToUpdate.support | ||
55 | |||
52 | this.form.patchValue({ | 56 | this.form.patchValue({ |
53 | 'display-name': videoChannelToUpdate.displayName, | 57 | 'display-name': videoChannelToUpdate.displayName, |
54 | description: videoChannelToUpdate.description, | 58 | description: videoChannelToUpdate.description, |
@@ -72,7 +76,8 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE | |||
72 | const videoChannelUpdate: VideoChannelUpdate = { | 76 | const videoChannelUpdate: VideoChannelUpdate = { |
73 | displayName: body['display-name'], | 77 | displayName: body['display-name'], |
74 | description: body.description || null, | 78 | description: body.description || null, |
75 | support: body.support || null | 79 | support: body.support || null, |
80 | bulkVideosSupportUpdate: body.bulkVideosSupportUpdate || false | ||
76 | } | 81 | } |
77 | 82 | ||
78 | this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.name, videoChannelUpdate).subscribe( | 83 | this.videoChannelService.updateVideoChannel(this.videoChannelToUpdate.name, videoChannelUpdate).subscribe( |
@@ -118,4 +123,10 @@ export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelE | |||
118 | getFormButtonTitle () { | 123 | getFormButtonTitle () { |
119 | return this.i18n('Update') | 124 | return this.i18n('Update') |
120 | } | 125 | } |
126 | |||
127 | isBulkUpdateVideosDisplayed () { | ||
128 | if (this.oldSupportField === undefined) return false | ||
129 | |||
130 | return this.oldSupportField !== this.form.value['support'] | ||
131 | } | ||
121 | } | 132 | } |