import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
import { ServerService } from '@app/core'
-import { FormReactive, FormValidatorService, VideoCaptionsValidatorsService } from '@app/shared/shared-forms'
+import { VIDEO_CAPTION_FILE_VALIDATOR, VIDEO_CAPTION_LANGUAGE_VALIDATOR } from '@app/shared/form-validators/video-captions-validators'
+import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
import { VideoCaptionEdit } from '@app/shared/shared-main'
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
-import { ServerConfig, VideoConstant } from '@shared/models'
+import { HTMLServerConfig, VideoConstant } from '@shared/models'
@Component({
selector: 'my-video-caption-add-modal',
export class VideoCaptionAddModalComponent extends FormReactive implements OnInit {
@Input() existingCaptions: string[]
- @Input() serverConfig: ServerConfig
+ @Input() serverConfig: HTMLServerConfig
@Output() captionAdded = new EventEmitter<VideoCaptionEdit>()
constructor (
protected formValidatorService: FormValidatorService,
private modalService: NgbModal,
- private serverService: ServerService,
- private videoCaptionsValidatorsService: VideoCaptionsValidatorsService
+ private serverService: ServerService
) {
super()
}
.subscribe(languages => this.videoCaptionLanguages = languages)
this.buildForm({
- language: this.videoCaptionsValidatorsService.VIDEO_CAPTION_LANGUAGE,
- captionfile: this.videoCaptionsValidatorsService.VIDEO_CAPTION_FILE
+ language: VIDEO_CAPTION_LANGUAGE_VALIDATOR,
+ captionfile: VIDEO_CAPTION_FILE_VALIDATOR
})
}