diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 69629770f..00a0bfad2 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -1,11 +1,16 @@ | |||
1 | import { SelectItem } from 'primeng/api' | ||
2 | import { forkJoin } from 'rxjs' | 1 | import { forkJoin } from 'rxjs' |
3 | import { ViewportScroller } from '@angular/common' | 2 | import { ViewportScroller } from '@angular/common' |
4 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' | 3 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' |
5 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 4 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
6 | import { Notifier } from '@app/core' | 5 | import { Notifier } from '@app/core' |
7 | import { ServerService } from '@app/core/server/server.service' | 6 | import { ServerService } from '@app/core/server/server.service' |
8 | import { CustomConfigValidatorsService, FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 7 | import { |
8 | CustomConfigValidatorsService, | ||
9 | FormReactive, | ||
10 | FormValidatorService, | ||
11 | SelectOptionsItem, | ||
12 | UserValidatorsService | ||
13 | } from '@app/shared/shared-forms' | ||
9 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' | 14 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 15 | import { I18n } from '@ngx-translate/i18n-polyfill' |
11 | import { CustomConfig, ServerConfig } from '@shared/models' | 16 | import { CustomConfig, ServerConfig } from '@shared/models' |
@@ -25,8 +30,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
25 | resolutions: { id: string, label: string, description?: string }[] = [] | 30 | resolutions: { id: string, label: string, description?: string }[] = [] |
26 | transcodingThreadOptions: { label: string, value: number }[] = [] | 31 | transcodingThreadOptions: { label: string, value: number }[] = [] |
27 | 32 | ||
28 | languageItems: SelectItem[] = [] | 33 | languageItems: SelectOptionsItem[] = [] |
29 | categoryItems: SelectItem[] = [] | 34 | categoryItems: SelectOptionsItem[] = [] |
30 | 35 | ||
31 | private serverConfig: ServerConfig | 36 | private serverConfig: ServerConfig |
32 | 37 | ||
@@ -290,22 +295,6 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
290 | ) | 295 | ) |
291 | } | 296 | } |
292 | 297 | ||
293 | getSelectedLanguageLabel () { | ||
294 | return this.i18n('{{\'{0} languages selected') | ||
295 | } | ||
296 | |||
297 | getDefaultLanguageLabel () { | ||
298 | return this.i18n('No language') | ||
299 | } | ||
300 | |||
301 | getSelectedCategoryLabel () { | ||
302 | return this.i18n('{{\'{0} categories selected') | ||
303 | } | ||
304 | |||
305 | getDefaultCategoryLabel () { | ||
306 | return this.i18n('No category') | ||
307 | } | ||
308 | |||
309 | gotoAnchor () { | 298 | gotoAnchor () { |
310 | const hashToNav = { | 299 | const hashToNav = { |
311 | 'customizations': 'advanced-configuration' | 300 | 'customizations': 'advanced-configuration' |
@@ -331,8 +320,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
331 | ([ config, languages, categories ]) => { | 320 | ([ config, languages, categories ]) => { |
332 | this.customConfig = config | 321 | this.customConfig = config |
333 | 322 | ||
334 | this.languageItems = languages.map(l => ({ label: l.label, value: l.id })) | 323 | this.languageItems = languages.map(l => ({ label: l.label, id: l.id })) |
335 | this.categoryItems = categories.map(l => ({ label: l.label, value: l.id })) | 324 | this.categoryItems = categories.map(l => ({ label: l.label, id: l.id + '' })) |
336 | 325 | ||
337 | this.updateForm() | 326 | this.updateForm() |
338 | // Force form validation | 327 | // Force form validation |