video-import -> video-import-url

pull/918/head
Chocobozzz 2018-08-06 15:18:35 +02:00
parent 43620009d5
commit 047559af6e
6 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@
</tab>
<tab *ngIf="isVideoImportEnabled()" i18n-heading heading="Import with URL">
<my-video-import #videoImport (firstStepDone)="onFirstStepDone('import', $event)"></my-video-import>
<my-video-import-url #videoImportUrl (firstStepDone)="onFirstStepDone('import-url', $event)"></my-video-import-url>
</tab>
</tabset>
</div>

View File

@ -1,6 +1,6 @@
import { Component, ViewChild } from '@angular/core'
import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
import { VideoImportComponent } from '@app/videos/+video-edit/video-import.component'
import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-import-url.component'
import { VideoUploadComponent } from '@app/videos/+video-edit/video-upload.component'
import { ServerService } from '@app/core'
@ -11,23 +11,23 @@ import { ServerService } from '@app/core'
})
export class VideoAddComponent implements CanComponentDeactivate {
@ViewChild('videoUpload') videoUpload: VideoUploadComponent
@ViewChild('videoImport') videoImport: VideoImportComponent
@ViewChild('videoImportUrl') videoImportUrl: VideoImportUrlComponent
secondStepType: 'upload' | 'import'
secondStepType: 'upload' | 'import-url'
videoName: string
constructor (
private serverService: ServerService
) {}
onFirstStepDone (type: 'upload' | 'import', videoName: string) {
onFirstStepDone (type: 'upload' | 'import-url', videoName: string) {
this.secondStepType = type
this.videoName = videoName
}
canDeactivate () {
if (this.secondStepType === 'upload') return this.videoUpload.canDeactivate()
if (this.secondStepType === 'import') return this.videoImport.canDeactivate()
if (this.secondStepType === 'import-url') return this.videoImportUrl.canDeactivate()
return { canDeactivate: true }
}

View File

@ -6,7 +6,7 @@ import { VideoAddRoutingModule } from './video-add-routing.module'
import { VideoAddComponent } from './video-add.component'
import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service'
import { VideoUploadComponent } from '@app/videos/+video-edit/video-upload.component'
import { VideoImportComponent } from '@app/videos/+video-edit/video-import.component'
import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-import-url.component'
@NgModule({
imports: [
@ -18,7 +18,7 @@ import { VideoImportComponent } from '@app/videos/+video-edit/video-import.compo
declarations: [
VideoAddComponent,
VideoUploadComponent,
VideoImportComponent
VideoImportUrlComponent
],
exports: [
VideoAddComponent

View File

@ -14,14 +14,14 @@ import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoSend } from '@app/videos/+video-edit/shared/video-send'
@Component({
selector: 'my-video-import',
templateUrl: './video-import.component.html',
selector: 'my-video-import-url',
templateUrl: './video-import-url.component.html',
styleUrls: [
'./shared/video-edit.component.scss',
'./video-import.component.scss'
'./video-import-url.component.scss'
]
})
export class VideoImportComponent extends VideoSend implements OnInit, CanComponentDeactivate {
export class VideoImportUrlComponent extends VideoSend implements OnInit, CanComponentDeactivate {
@Output() firstStepDone = new EventEmitter<string>()
targetUrl = ''