From 67ed6552b831df66713bac9e672738796128d33f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:10:17 +0200 Subject: Reorganize client shared modules --- .../shared/i18n-primeng-calendar.service.ts | 94 ++++++++++++++++++++++ .../shared/video-caption-add-modal.component.ts | 8 +- .../+video-edit/shared/video-edit.component.ts | 26 ++---- .../videos/+video-edit/shared/video-edit.module.ts | 16 +++- .../video-import-torrent.component.ts | 18 ++--- .../video-import-url.component.ts | 20 ++--- .../+video-edit/video-add-components/video-send.ts | 16 ++-- .../video-add-components/video-upload.component.ts | 19 ++--- .../videos/+video-edit/video-add-routing.module.ts | 5 +- .../app/videos/+video-edit/video-add.component.ts | 9 +-- .../src/app/videos/+video-edit/video-add.module.ts | 23 +++--- .../+video-edit/video-update-routing.module.ts | 7 +- .../videos/+video-edit/video-update.component.ts | 12 +-- .../app/videos/+video-edit/video-update.module.ts | 13 ++- .../videos/+video-edit/video-update.resolver.ts | 8 +- 15 files changed, 175 insertions(+), 119 deletions(-) create mode 100644 client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts (limited to 'client/src/app/videos/+video-edit') diff --git a/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts new file mode 100644 index 000000000..b05852ff8 --- /dev/null +++ b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts @@ -0,0 +1,94 @@ +import { I18n } from '@ngx-translate/i18n-polyfill' +import { Injectable } from '@angular/core' + +@Injectable() +export class I18nPrimengCalendarService { + private readonly calendarLocale: any = {} + + constructor (private i18n: I18n) { + this.calendarLocale = { + firstDayOfWeek: 0, + dayNames: [ + this.i18n('Sunday'), + this.i18n('Monday'), + this.i18n('Tuesday'), + this.i18n('Wednesday'), + this.i18n('Thursday'), + this.i18n('Friday'), + this.i18n('Saturday') + ], + + dayNamesShort: [ + this.i18n({ value: 'Sun', description: 'Day name short' }), + this.i18n({ value: 'Mon', description: 'Day name short' }), + this.i18n({ value: 'Tue', description: 'Day name short' }), + this.i18n({ value: 'Wed', description: 'Day name short' }), + this.i18n({ value: 'Thu', description: 'Day name short' }), + this.i18n({ value: 'Fri', description: 'Day name short' }), + this.i18n({ value: 'Sat', description: 'Day name short' }) + ], + + dayNamesMin: [ + this.i18n({ value: 'Su', description: 'Day name min' }), + this.i18n({ value: 'Mo', description: 'Day name min' }), + this.i18n({ value: 'Tu', description: 'Day name min' }), + this.i18n({ value: 'We', description: 'Day name min' }), + this.i18n({ value: 'Th', description: 'Day name min' }), + this.i18n({ value: 'Fr', description: 'Day name min' }), + this.i18n({ value: 'Sa', description: 'Day name min' }) + ], + + monthNames: [ + this.i18n('January'), + this.i18n('February'), + this.i18n('March'), + this.i18n('April'), + this.i18n('May'), + this.i18n('June'), + this.i18n('July'), + this.i18n('August'), + this.i18n('September'), + this.i18n('October'), + this.i18n('November'), + this.i18n('December') + ], + + monthNamesShort: [ + this.i18n({ value: 'Jan', description: 'Month name short' }), + this.i18n({ value: 'Feb', description: 'Month name short' }), + this.i18n({ value: 'Mar', description: 'Month name short' }), + this.i18n({ value: 'Apr', description: 'Month name short' }), + this.i18n({ value: 'May', description: 'Month name short' }), + this.i18n({ value: 'Jun', description: 'Month name short' }), + this.i18n({ value: 'Jul', description: 'Month name short' }), + this.i18n({ value: 'Aug', description: 'Month name short' }), + this.i18n({ value: 'Sep', description: 'Month name short' }), + this.i18n({ value: 'Oct', description: 'Month name short' }), + this.i18n({ value: 'Nov', description: 'Month name short' }), + this.i18n({ value: 'Dec', description: 'Month name short' }) + ], + + today: this.i18n('Today'), + + clear: this.i18n('Clear') + } + } + + getCalendarLocale () { + return this.calendarLocale + } + + getTimezone () { + const gmt = new Date().toString().match(/([A-Z]+[\+-][0-9]+)/)[1] + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone + + return `${timezone} - ${gmt}` + } + + getDateFormat () { + return this.i18n({ + value: 'yy-mm-dd ', + description: 'Date format in this locale.' + }) + } +} diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts index 9856aac9e..a90d04ce8 100644 --- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts @@ -1,11 +1,9 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' -import { FormReactive } from '@app/shared' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service' import { ServerService } from '@app/core' -import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' +import { FormReactive, FormValidatorService, VideoCaptionsValidatorsService } 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' +import { ServerConfig, VideoConstant } from '@shared/models' @Component({ selector: 'my-video-caption-add-modal', diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 15073fc44..239e453ad 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -1,19 +1,13 @@ +import { map } from 'rxjs/operators' import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' -import { ActivatedRoute, Router } from '@angular/router' -import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared' -import { Notifier } from '@app/core' -import { ServerService } from '../../../core/server' -import { VideoEdit } from '../../../shared/video/video-edit.model' -import { map } from 'rxjs/operators' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar' -import { VideoCaptionService } from '@app/shared/video-caption' -import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component' -import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' -import { removeElementFromArray } from '@app/shared/misc/utils' -import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' -import { VideoService } from '@app/shared/video/video.service' +import { ServerService } from '@app/core' +import { removeElementFromArray } from '@app/helpers' +import { FormReactiveValidationMessages, FormValidatorService, VideoValidatorsService } from '@app/shared/shared-forms' +import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' +import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' +import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' +import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' @Component({ selector: 'my-video-edit', @@ -60,11 +54,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { constructor ( private formValidatorService: FormValidatorService, private videoValidatorsService: VideoValidatorsService, - private videoCaptionService: VideoCaptionService, private videoService: VideoService, - private route: ActivatedRoute, - private router: Router, - private notifier: Notifier, private serverService: ServerService, private i18nPrimengCalendarService: I18nPrimengCalendarService, private ngZone: NgZone diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts index 1357d607c..96061a300 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts @@ -1,16 +1,20 @@ -import { NgModule } from '@angular/core' import { TagInputModule } from 'ngx-chips' -import { SharedModule } from '../../../shared/' -import { VideoEditComponent } from './video-edit.component' import { CalendarModule } from 'primeng/calendar' +import { NgModule } from '@angular/core' +import { SharedFormModule } from '@app/shared/shared-forms' +import { SharedGlobalIconModule } from '@app/shared/shared-icons' +import { SharedMainModule } from '@app/shared/shared-main' import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' +import { VideoEditComponent } from './video-edit.component' @NgModule({ imports: [ TagInputModule, CalendarModule, - SharedModule + SharedMainModule, + SharedFormModule, + SharedGlobalIconModule ], declarations: [ @@ -22,6 +26,10 @@ import { VideoCaptionAddModalComponent } from './video-caption-add-modal.compone TagInputModule, CalendarModule, + SharedMainModule, + SharedFormModule, + SharedGlobalIconModule, + VideoEditComponent ], diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts index 4d0b0b080..5b453a1d9 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts @@ -1,17 +1,13 @@ import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' import { Router } from '@angular/router' -import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' -import { AuthService, Notifier, ServerService } from '../../../core' -import { VideoService } from '../../../shared/video/video.service' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { LoadingBarService } from '@ngx-loading-bar/core' +import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' +import { scrollToTop } from '@app/helpers' +import { FormValidatorService } from '@app/shared/shared-forms' +import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' -import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' -import { VideoEdit } from '@app/shared/video/video-edit.model' -import { FormValidatorService } from '@app/shared' -import { VideoCaptionService } from '@app/shared/video-caption' -import { VideoImportService } from '@app/shared/video-import' -import { scrollToTop } from '@app/shared/misc/utils' +import { LoadingBarService } from '@ngx-loading-bar/core' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoPrivacy, VideoUpdate } from '@shared/models' @Component({ selector: 'my-video-import-torrent', diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts index 213c42333..d0bd1f54d 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts @@ -1,18 +1,14 @@ +import { map, switchMap } from 'rxjs/operators' import { Component, EventEmitter, OnInit, Output } from '@angular/core' import { Router } from '@angular/router' -import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' -import { AuthService, Notifier, ServerService } from '../../../core' -import { VideoService } from '../../../shared/video/video.service' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { LoadingBarService } from '@ngx-loading-bar/core' +import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' +import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers' +import { FormValidatorService } from '@app/shared/shared-forms' +import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' -import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' -import { VideoEdit } from '@app/shared/video/video-edit.model' -import { FormValidatorService } from '@app/shared' -import { VideoCaptionService } from '@app/shared/video-caption' -import { VideoImportService } from '@app/shared/video-import' -import { scrollToTop, getAbsoluteAPIUrl } from '@app/shared/misc/utils' -import { switchMap, map } from 'rxjs/operators' +import { LoadingBarService } from '@ngx-loading-bar/core' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoPrivacy, VideoUpdate } from '@shared/models' @Component({ selector: 'my-video-import-url', diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.ts index b32f16950..94479321d 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts @@ -1,15 +1,11 @@ +import { catchError, switchMap, tap } from 'rxjs/operators' import { EventEmitter, OnInit } from '@angular/core' +import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' +import { populateAsyncUserVideoChannels } from '@app/helpers' +import { FormReactive } from '@app/shared/shared-forms' +import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' -import { AuthService, Notifier, ServerService } from '@app/core' -import { catchError, switchMap, tap } from 'rxjs/operators' -import { FormReactive } from '@app/shared' -import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared' -import { VideoService } from '@app/shared/video/video.service' -import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' -import { VideoCaptionService } from '@app/shared/video-caption' -import { VideoEdit } from '@app/shared/video/video-edit.model' -import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' -import { CanComponentDeactivateResult } from '@app/shared/guards/can-deactivate-guard.service' +import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' export abstract class VideoSend extends FormReactive implements OnInit { userVideoChannels: { id: number, label: string, support: string }[] = [] diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts index 9ce3fbc6d..eb7ac32ae 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts @@ -1,19 +1,16 @@ +import { BytesPipe } from 'ngx-pipes' +import { Subscription } from 'rxjs' import { HttpEventType, HttpResponse } from '@angular/common/http' import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' import { Router } from '@angular/router' +import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserService } from '@app/core' +import { scrollToTop } from '@app/helpers' +import { FormValidatorService } from '@app/shared/shared-forms' +import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' +import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' import { LoadingBarService } from '@ngx-loading-bar/core' -import { BytesPipe } from 'ngx-pipes' -import { Subscription } from 'rxjs' -import { VideoPrivacy } from '../../../../../../shared/models/videos' -import { AuthService, Notifier, ServerService } from '../../../core' -import { VideoEdit } from '../../../shared/video/video-edit.model' -import { VideoService } from '../../../shared/video/video.service' import { I18n } from '@ngx-translate/i18n-polyfill' -import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' -import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' -import { FormValidatorService, UserService } from '@app/shared' -import { VideoCaptionService } from '@app/shared/video-caption' -import { scrollToTop } from '@app/shared/misc/utils' +import { VideoPrivacy } from '@shared/models' @Component({ selector: 'my-video-upload', diff --git a/client/src/app/videos/+video-edit/video-add-routing.module.ts b/client/src/app/videos/+video-edit/video-add-routing.module.ts index e0fef7158..9ff66bea0 100644 --- a/client/src/app/videos/+video-edit/video-add-routing.module.ts +++ b/client/src/app/videos/+video-edit/video-add-routing.module.ts @@ -1,10 +1,7 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' - +import { CanDeactivateGuard, LoginGuard } from '@app/core' import { MetaGuard } from '@ngx-meta/core' - -import { LoginGuard } from '../../core' -import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service' import { VideoAddComponent } from './video-add.component' const videoAddRoutes: Routes = [ diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 30ab08ea0..5bd768809 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -1,10 +1,9 @@ import { Component, HostListener, OnInit, ViewChild } from '@angular/core' -import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' -import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' -import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' -import { AuthService, ServerService } from '@app/core' -import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' +import { AuthService, CanComponentDeactivate, ServerService } from '@app/core' import { ServerConfig } from '@shared/models' +import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' +import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' +import { VideoUploadComponent } from './video-add-components/video-upload.component' @Component({ selector: 'my-videos-add', diff --git a/client/src/app/videos/+video-edit/video-add.module.ts b/client/src/app/videos/+video-edit/video-add.module.ts index b8f5a9a47..477c1cf5e 100644 --- a/client/src/app/videos/+video-edit/video-add.module.ts +++ b/client/src/app/videos/+video-edit/video-add.module.ts @@ -1,20 +1,20 @@ import { NgModule } from '@angular/core' -import { SharedModule } from '../../shared' +import { CanDeactivateGuard } from '@app/core' import { VideoEditModule } from './shared/video-edit.module' +import { DragDropDirective } from './video-add-components/drag-drop.directive' +import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' +import { VideoImportUrlComponent } from './video-add-components/video-import-url.component' +import { VideoUploadComponent } from './video-add-components/video-upload.component' import { VideoAddRoutingModule } from './video-add-routing.module' import { VideoAddComponent } from './video-add.component' -import { DragDropDirective } from './video-add-components/drag-drop.directive' -import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service' -import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' -import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' -import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' @NgModule({ imports: [ VideoAddRoutingModule, - VideoEditModule, - SharedModule + + VideoEditModule ], + declarations: [ VideoAddComponent, VideoUploadComponent, @@ -22,10 +22,9 @@ import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-c VideoImportTorrentComponent, DragDropDirective ], - exports: [ - VideoAddComponent, - DragDropDirective - ], + + exports: [ ], + providers: [ CanDeactivateGuard ] diff --git a/client/src/app/videos/+video-edit/video-update-routing.module.ts b/client/src/app/videos/+video-edit/video-update-routing.module.ts index 564b8fb45..a04351b05 100644 --- a/client/src/app/videos/+video-edit/video-update-routing.module.ts +++ b/client/src/app/videos/+video-edit/video-update-routing.module.ts @@ -1,12 +1,9 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' - +import { CanDeactivateGuard, LoginGuard } from '@app/core' import { MetaGuard } from '@ngx-meta/core' - -import { LoginGuard } from '../../core' import { VideoUpdateComponent } from './video-update.component' -import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' -import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service' +import { VideoUpdateResolver } from './video-update.resolver' const videoUpdateRoutes: Routes = [ { diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 20a607134..7bd6eb553 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -1,17 +1,11 @@ import { map, switchMap } from 'rxjs/operators' import { Component, HostListener, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { LoadingBarService } from '@ngx-loading-bar/core' import { Notifier } from '@app/core' -import { ServerService } from '../../core' -import { FormReactive } from '../../shared' -import { VideoEdit } from '../../shared/video/video-edit.model' -import { VideoService } from '../../shared/video/video.service' +import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' +import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' +import { LoadingBarService } from '@ngx-loading-bar/core' import { I18n } from '@ngx-translate/i18n-polyfill' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { VideoCaptionService } from '@app/shared/video-caption' -import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' -import { VideoDetails } from '@app/shared/video/video-details.model' import { VideoPrivacy } from '@shared/models' @Component({ diff --git a/client/src/app/videos/+video-edit/video-update.module.ts b/client/src/app/videos/+video-edit/video-update.module.ts index d60aa699f..322c69629 100644 --- a/client/src/app/videos/+video-edit/video-update.module.ts +++ b/client/src/app/videos/+video-edit/video-update.module.ts @@ -1,25 +1,22 @@ import { NgModule } from '@angular/core' -import { SharedModule } from '../../shared' +import { CanDeactivateGuard } from '@app/core' +import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' import { VideoEditModule } from './shared/video-edit.module' import { VideoUpdateRoutingModule } from './video-update-routing.module' import { VideoUpdateComponent } from './video-update.component' -import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' -import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service' @NgModule({ imports: [ VideoUpdateRoutingModule, - VideoEditModule, - SharedModule + + VideoEditModule ], declarations: [ VideoUpdateComponent ], - exports: [ - VideoUpdateComponent - ], + exports: [ ], providers: [ VideoUpdateResolver, diff --git a/client/src/app/videos/+video-edit/video-update.resolver.ts b/client/src/app/videos/+video-edit/video-update.resolver.ts index 4ac517d96..30bcf4d74 100644 --- a/client/src/app/videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/videos/+video-edit/video-update.resolver.ts @@ -1,10 +1,8 @@ +import { forkJoin } from 'rxjs' +import { map, switchMap } from 'rxjs/operators' import { Injectable } from '@angular/core' -import { VideoService } from '@app/shared/video/video.service' import { ActivatedRouteSnapshot, Resolve } from '@angular/router' -import { map, switchMap } from 'rxjs/operators' -import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' -import { VideoCaptionService } from '@app/shared/video-caption' -import { forkJoin } from 'rxjs' +import { VideoCaptionService, VideoChannelService, VideoService } from '@app/shared/shared-main' @Injectable() export class VideoUpdateResolver implements Resolve { -- cgit v1.2.3