diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index 29910369a..90ed58c99 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | |||
@@ -25,11 +25,12 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges { | |||
25 | private configService: ConfigService, | 25 | private configService: ConfigService, |
26 | private menuService: MenuService, | 26 | private menuService: MenuService, |
27 | private themeService: ThemeService | 27 | private themeService: ThemeService |
28 | ) { } | 28 | ) {} |
29 | 29 | ||
30 | ngOnInit () { | 30 | ngOnInit () { |
31 | this.buildLandingPageOptions() | 31 | this.buildLandingPageOptions() |
32 | this.checkSignupField() | 32 | this.checkSignupField() |
33 | this.checkImportSyncField() | ||
33 | 34 | ||
34 | this.availableThemes = this.themeService.buildAvailableThemes() | 35 | this.availableThemes = this.themeService.buildAvailableThemes() |
35 | } | 36 | } |
@@ -67,6 +68,14 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges { | |||
67 | return { 'disabled-checkbox-extra': !this.isSignupEnabled() } | 68 | return { 'disabled-checkbox-extra': !this.isSignupEnabled() } |
68 | } | 69 | } |
69 | 70 | ||
71 | isImportVideosHttpEnabled (): boolean { | ||
72 | return this.form.value['import']['videos']['http']['enabled'] === true | ||
73 | } | ||
74 | |||
75 | importSynchronizationChecked () { | ||
76 | return this.isImportVideosHttpEnabled() && this.form.value['import']['videoChannelSynchronization']['enabled'] | ||
77 | } | ||
78 | |||
70 | hasUnlimitedSignup () { | 79 | hasUnlimitedSignup () { |
71 | return this.form.value['signup']['limit'] === -1 | 80 | return this.form.value['signup']['limit'] === -1 |
72 | } | 81 | } |
@@ -97,6 +106,21 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges { | |||
97 | return this.themeService.getDefaultThemeLabel() | 106 | return this.themeService.getDefaultThemeLabel() |
98 | } | 107 | } |
99 | 108 | ||
109 | private checkImportSyncField () { | ||
110 | const importSyncControl = this.form.get('import.videoChannelSynchronization.enabled') | ||
111 | const importVideosHttpControl = this.form.get('import.videos.http.enabled') | ||
112 | |||
113 | importVideosHttpControl.valueChanges | ||
114 | .subscribe((httpImportEnabled) => { | ||
115 | importSyncControl.setValue(httpImportEnabled && importSyncControl.value) | ||
116 | if (httpImportEnabled) { | ||
117 | importSyncControl.enable() | ||
118 | } else { | ||
119 | importSyncControl.disable() | ||
120 | } | ||
121 | }) | ||
122 | } | ||
123 | |||
100 | private checkSignupField () { | 124 | private checkSignupField () { |
101 | const signupControl = this.form.get('signup.enabled') | 125 | const signupControl = this.form.get('signup.enabled') |
102 | 126 | ||