import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { ServerService } from '@app/core'
import { AdvancedSearch } from '@app/shared/shared-search'
-import { ServerConfig, VideoConstant } from '@shared/models'
+import { HTMLServerConfig, VideoConstant } from '@shared/models'
type FormOption = { id: string, label: string }
originallyPublishedStartYear: string
originallyPublishedEndYear: string
- private serverConfig: ServerConfig
+ private serverConfig: HTMLServerConfig
constructor (
private serverService: ServerService
}
ngOnInit () {
- this.serverConfig = this.serverService.getTmpConfig()
- this.serverService.getConfig()
- .subscribe(config => this.serverConfig = config)
+ this.serverConfig = this.serverService.getHTMLConfig()
this.serverService.getVideoCategories().subscribe(categories => this.videoCategories = categories)
this.serverService.getVideoLicences().subscribe(licences => this.videoLicences = licences)
this.loadOriginallyPublishedAtYears()
}
- onInputUpdated () {
+ onDurationOrPublishedUpdated () {
this.updateModelFromDurationRange()
this.updateModelFromPublishedRange()
this.updateModelFromOriginallyPublishedAtYears()
}
formUpdated () {
- this.onInputUpdated()
+ this.onDurationOrPublishedUpdated()
this.filtered.emit(this.advancedSearch)
}
this.durationRange = undefined
this.publishedDateRange = undefined
- this.onInputUpdated()
+ this.onDurationOrPublishedUpdated()
}
resetField (fieldName: string, value?: any) {
resetLocalField (fieldName: string, value?: any) {
this[fieldName] = value
- this.onInputUpdated()
+ this.onDurationOrPublishedUpdated()
}
resetOriginalPublicationYears () {