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 --- client/src/app/+admin/admin-routing.module.ts | 8 +-- client/src/app/+admin/admin.component.ts | 6 +- client/src/app/+admin/admin.module.ts | 52 +++++++++-------- client/src/app/+admin/config/config.routes.ts | 2 +- .../edit-custom-config.component.ts | 16 +++-- .../shared/batch-domains-modal.component.html | 43 -------------- .../shared/batch-domains-modal.component.scss | 3 - .../config/shared/batch-domains-modal.component.ts | 54 ----------------- .../shared/batch-domains-validators.service.ts | 68 ---------------------- .../src/app/+admin/config/shared/config.service.ts | 6 +- .../followers-list/followers-list.component.ts | 11 ++-- .../following-list/following-list.component.ts | 14 ++--- client/src/app/+admin/follows/follows.routes.ts | 9 ++- .../shared/redundancy-checkbox.component.ts | 2 +- .../follows/video-redundancies-list/index.ts | 1 + .../video-redundancies-list.component.ts | 12 ++-- client/src/app/+admin/moderation/index.ts | 1 + .../instance-account-blocklist.component.ts | 6 +- .../instance-server-blocklist.component.ts | 6 +- .../app/+admin/moderation/moderation.component.ts | 2 +- .../src/app/+admin/moderation/moderation.routes.ts | 8 +-- .../moderation-comment-modal.component.ts | 8 +-- .../video-abuse-details.component.ts | 5 +- .../video-abuse-list/video-abuse-list.component.ts | 25 +++----- .../video-block-list/video-block-list.component.ts | 18 +++--- .../plugin-list-installed.component.ts | 15 +++-- .../plugin-search/plugin-search.component.ts | 14 ++--- .../plugin-show-installed.component.ts | 15 +++-- .../+admin/plugins/shared/plugin-api.service.ts | 26 +++++---- .../src/app/+admin/system/debug/debug.component.ts | 4 +- .../src/app/+admin/system/debug/debug.service.ts | 7 +-- client/src/app/+admin/system/index.ts | 1 + client/src/app/+admin/system/jobs/job.service.ts | 9 ++- .../src/app/+admin/system/jobs/jobs.component.ts | 12 ++-- client/src/app/+admin/system/logs/log-row.model.ts | 2 +- .../src/app/+admin/system/logs/logs.component.ts | 6 +- client/src/app/+admin/system/logs/logs.service.ts | 9 ++- client/src/app/+admin/system/system.routes.ts | 12 ++-- .../users/user-edit/user-create.component.ts | 15 ++--- client/src/app/+admin/users/user-edit/user-edit.ts | 11 ++-- .../users/user-edit/user-password.component.ts | 10 +--- .../users/user-edit/user-update.component.ts | 18 ++---- .../+admin/users/user-list/user-list.component.ts | 13 ++--- client/src/app/+admin/users/users.routes.ts | 8 +-- 44 files changed, 190 insertions(+), 403 deletions(-) delete mode 100644 client/src/app/+admin/config/shared/batch-domains-modal.component.html delete mode 100644 client/src/app/+admin/config/shared/batch-domains-modal.component.scss delete mode 100644 client/src/app/+admin/config/shared/batch-domains-modal.component.ts delete mode 100644 client/src/app/+admin/config/shared/batch-domains-validators.service.ts (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts index 79c57221b..986dae8eb 100644 --- a/client/src/app/+admin/admin-routing.module.ts +++ b/client/src/app/+admin/admin-routing.module.ts @@ -1,15 +1,13 @@ import { NgModule } from '@angular/core' import { RouterModule, Routes } from '@angular/router' import { ConfigRoutes } from '@app/+admin/config' - +import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' +import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' +import { SystemRoutes } from '@app/+admin/system' import { MetaGuard } from '@ngx-meta/core' - import { AdminComponent } from './admin.component' import { FollowsRoutes } from './follows' import { UsersRoutes } from './users' -import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes' -import { SystemRoutes } from '@app/+admin/system' -import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes' const adminRoutes: Routes = [ { diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index a97a33cf5..e47c7a8f4 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core' -import { UserRight } from '../../../../shared' -import { AuthService } from '../core/auth/auth.service' -import { ListOverflowItem } from '@app/shared/misc/list-overflow.component' +import { AuthService } from '@app/core' +import { ListOverflowItem } from '@app/shared/shared-main' import { I18n } from '@ngx-translate/i18n-polyfill' +import { UserRight } from '@shared/models' @Component({ templateUrl: './admin.component.html' diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index eccec8a49..728227a84 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts @@ -1,39 +1,41 @@ -import { NgModule } from '@angular/core' -import { ConfigComponent, EditCustomConfigComponent } from '@app/+admin/config' -import { ConfigService } from '@app/+admin/config/shared/config.service' +import { ChartModule } from 'primeng/chart' +import { SelectButtonModule } from 'primeng/selectbutton' import { TableModule } from 'primeng/table' -import { SharedModule } from '../shared' +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 { SharedModerationModule } from '@app/shared/shared-moderation' import { AdminRoutingModule } from './admin-routing.module' import { AdminComponent } from './admin.component' +import { ConfigComponent, EditCustomConfigComponent } from './config' +import { ConfigService } from './config/shared/config.service' import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows' import { FollowingListComponent } from './follows/following-list/following-list.component' -import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' -import { - ModerationCommentModalComponent, - VideoAbuseListComponent, - VideoBlockListComponent -} from './moderation' -import { ModerationComponent } from '@app/+admin/moderation/moderation.component' -import { RedundancyCheckboxComponent } from '@app/+admin/follows/shared/redundancy-checkbox.component' -import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' -import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' -import { JobService, LogsComponent, LogsService, SystemComponent } from '@app/+admin/system' -import { DebugComponent, DebugService } from '@app/+admin/system/debug' -import { PluginsComponent } from '@app/+admin/plugins/plugins.component' -import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-installed/plugin-list-installed.component' -import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component' -import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component' -import { SelectButtonModule } from 'primeng/selectbutton' -import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' -import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component' -import { ChartModule } from 'primeng/chart' +import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbox.component' +import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component' +import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlockListComponent } from './moderation' +import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist' +import { ModerationComponent } from './moderation/moderation.component' import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' +import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component' +import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component' +import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component' +import { PluginsComponent } from './plugins/plugins.component' +import { PluginApiService } from './plugins/shared/plugin-api.service' +import { JobService, LogsComponent, LogsService, SystemComponent } from './system' +import { DebugComponent, DebugService } from './system/debug' +import { JobsComponent } from './system/jobs/jobs.component' +import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' @NgModule({ imports: [ AdminRoutingModule, - SharedModule, + SharedMainModule, + SharedFormModule, + SharedModerationModule, + SharedGlobalIconModule, TableModule, SelectButtonModule, diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts index 2ca2f8fde..7c1a1a166 100644 --- a/client/src/app/+admin/config/config.routes.ts +++ b/client/src/app/+admin/config/config.routes.ts @@ -1,7 +1,7 @@ import { Routes } from '@angular/router' import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' import { UserRightGuard } from '@app/core' -import { UserRight } from '../../../../../shared/models/users' +import { UserRight } from '@shared/models' import { ConfigComponent } from './config.component' export const ConfigRoutes: Routes = [ 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 3a47ba25e..69629770f 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,16 +1,14 @@ -import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' -import { ConfigService } from '@app/+admin/config/shared/config.service' -import { ServerService } from '@app/core/server/server.service' -import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared' -import { Notifier } from '@app/core' -import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' import { SelectItem } from 'primeng/api' import { forkJoin } from 'rxjs' -import { ServerConfig } from '@shared/models' import { ViewportScroller } from '@angular/common' +import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' +import { ConfigService } from '@app/+admin/config/shared/config.service' +import { Notifier } from '@app/core' +import { ServerService } from '@app/core/server/server.service' +import { CustomConfigValidatorsService, FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' import { NgbNav } from '@ng-bootstrap/ng-bootstrap' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { CustomConfig, ServerConfig } from '@shared/models' @Component({ selector: 'my-edit-custom-config', diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.html b/client/src/app/+admin/config/shared/batch-domains-modal.component.html deleted file mode 100644 index 1b85c8f48..000000000 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss b/client/src/app/+admin/config/shared/batch-domains-modal.component.scss deleted file mode 100644 index 9621a566f..000000000 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -textarea { - height: 200px; -} diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts b/client/src/app/+admin/config/shared/batch-domains-modal.component.ts deleted file mode 100644 index 620f2726b..000000000 --- a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component, OnInit, ViewChild, Input, Output, EventEmitter } from '@angular/core' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { FormReactive } from '@app/shared/forms' -import { BatchDomainsValidatorsService } from './batch-domains-validators.service' - -@Component({ - selector: 'my-batch-domains-modal', - templateUrl: './batch-domains-modal.component.html', - styleUrls: [ './batch-domains-modal.component.scss' ] -}) -export class BatchDomainsModalComponent extends FormReactive implements OnInit { - @ViewChild('modal', { static: true }) modal: NgbModal - @Input() placeholder = 'example.com' - @Input() action: string - @Output() domains = new EventEmitter() - - private openedModal: NgbModalRef - - constructor ( - protected formValidatorService: FormValidatorService, - private modalService: NgbModal, - private batchDomainsValidatorsService: BatchDomainsValidatorsService, - private i18n: I18n - ) { - super() - } - - ngOnInit () { - if (!this.action) this.action = this.i18n('Process domains') - - this.buildForm({ - domains: this.batchDomainsValidatorsService.DOMAINS - }) - } - - openModal () { - this.openedModal = this.modalService.open(this.modal, { centered: true }) - } - - hide () { - this.openedModal.close() - } - - submit () { - this.domains.emit( - this.batchDomainsValidatorsService.getNotEmptyHosts(this.form.controls['domains'].value) - ) - this.form.reset() - this.hide() - } -} diff --git a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts b/client/src/app/+admin/config/shared/batch-domains-validators.service.ts deleted file mode 100644 index 46fa6514d..000000000 --- a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { I18n } from '@ngx-translate/i18n-polyfill' -import { Validators, ValidatorFn } from '@angular/forms' -import { Injectable } from '@angular/core' -import { BuildFormValidator, validateHost } from '@app/shared/forms/form-validators' - -@Injectable() -export class BatchDomainsValidatorsService { - readonly DOMAINS: BuildFormValidator - - constructor (private i18n: I18n) { - this.DOMAINS = { - VALIDATORS: [ Validators.required, this.validDomains, this.isHostsUnique ], - MESSAGES: { - 'required': this.i18n('Domain is required.'), - 'validDomains': this.i18n('Domains entered are invalid.'), - 'uniqueDomains': this.i18n('Domains entered contain duplicates.') - } - } - } - - getNotEmptyHosts (hosts: string) { - return hosts - .split('\n') - .filter((host: string) => host && host.length !== 0) // Eject empty hosts - } - - private validDomains: ValidatorFn = (control) => { - if (!control.value) return null - - const newHostsErrors = [] - const hosts = this.getNotEmptyHosts(control.value) - - for (const host of hosts) { - if (validateHost(host) === false) { - newHostsErrors.push(this.i18n('{{host}} is not valid', { host })) - } - } - - /* Is not valid. */ - if (newHostsErrors.length !== 0) { - return { - 'validDomains': { - reason: 'invalid', - value: newHostsErrors.join('. ') + '.' - } - } - } - - /* Is valid. */ - return null - } - - private isHostsUnique: ValidatorFn = (control) => { - if (!control.value) return null - - const hosts = this.getNotEmptyHosts(control.value) - - if (hosts.every((host: string) => hosts.indexOf(host) === hosts.lastIndexOf(host))) { - return null - } else { - return { - 'uniqueDomains': { - reason: 'invalid' - } - } - } - } -} diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts index 874b8094d..f182946b8 100644 --- a/client/src/app/+admin/config/shared/config.service.ts +++ b/client/src/app/+admin/config/shared/config.service.ts @@ -1,10 +1,10 @@ import { catchError } from 'rxjs/operators' import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' -import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' -import { environment } from '../../../../environments/environment' -import { RestExtractor } from '../../../shared' +import { RestExtractor } from '@app/core' import { I18n } from '@ngx-translate/i18n-polyfill' +import { CustomConfig } from '@shared/models' +import { environment } from '../../../../environments/environment' @Injectable() export class ConfigService { diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 17352a601..63135f898 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts @@ -1,10 +1,9 @@ -import { Component, OnInit } from '@angular/core' -import { ConfirmService, Notifier } from '@app/core' import { SortMeta } from 'primeng/api' -import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' -import { RestPagination, RestTable } from '../../../shared' -import { FollowService } from '@app/shared/instance/follow.service' +import { Component, OnInit } from '@angular/core' +import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' +import { InstanceFollowService } from '@app/shared/shared-instance' import { I18n } from '@ngx-translate/i18n-polyfill' +import { ActorFollow } from '@shared/models' @Component({ selector: 'my-followers-list', @@ -21,7 +20,7 @@ export class FollowersListComponent extends RestTable implements OnInit { private confirmService: ConfirmService, private notifier: Notifier, private i18n: I18n, - private followService: FollowService + private followService: InstanceFollowService ) { super() } diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index 6ddbf02d6..dae8923b5 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts @@ -1,12 +1,10 @@ -import { Component, OnInit, ViewChild } from '@angular/core' -import { Notifier } from '@app/core' import { SortMeta } from 'primeng/api' -import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' -import { ConfirmService } from '../../../core/confirm/confirm.service' -import { RestPagination, RestTable } from '../../../shared' -import { FollowService } from '@app/shared/instance/follow.service' +import { Component, OnInit, ViewChild } from '@angular/core' +import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' +import { InstanceFollowService } from '@app/shared/shared-instance' +import { BatchDomainsModalComponent } from '@app/shared/shared-moderation' import { I18n } from '@ngx-translate/i18n-polyfill' -import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' +import { ActorFollow } from '@shared/models' @Component({ selector: 'my-followers-list', @@ -24,7 +22,7 @@ export class FollowingListComponent extends RestTable implements OnInit { constructor ( private notifier: Notifier, private confirmService: ConfirmService, - private followService: FollowService, + private followService: InstanceFollowService, private i18n: I18n ) { super() diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts index 8270ae444..817074536 100644 --- a/client/src/app/+admin/follows/follows.routes.ts +++ b/client/src/app/+admin/follows/follows.routes.ts @@ -1,11 +1,10 @@ import { Routes } from '@angular/router' - -import { UserRightGuard } from '../../core' -import { FollowsComponent } from './follows.component' +import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' +import { UserRightGuard } from '@app/core' +import { UserRight } from '@shared/models' import { FollowersListComponent } from './followers-list' -import { UserRight } from '../../../../../shared' import { FollowingListComponent } from './following-list/following-list.component' -import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' +import { FollowsComponent } from './follows.component' export const FollowsRoutes: Routes = [ { diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 9d7883d97..662143abc 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts @@ -1,7 +1,7 @@ import { Component, Input } from '@angular/core' import { Notifier } from '@app/core' +import { RedundancyService } from '@app/shared/shared-main' import { I18n } from '@ngx-translate/i18n-polyfill' -import { RedundancyService } from '@app/shared/video/redundancy.service' @Component({ selector: 'my-redundancy-checkbox', diff --git a/client/src/app/+admin/follows/video-redundancies-list/index.ts b/client/src/app/+admin/follows/video-redundancies-list/index.ts index 6a7c7f483..07e734b1a 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/index.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/index.ts @@ -1 +1,2 @@ export * from './video-redundancies-list.component' +export * from './video-redundancy-information.component' diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index 267a1f58e..0048882bc 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts @@ -1,14 +1,12 @@ -import { Component, OnInit } from '@angular/core' -import { Notifier, ServerService } from '@app/core' +import { BytesPipe } from 'ngx-pipes' import { SortMeta } from 'primeng/api' -import { ConfirmService } from '../../../core/confirm/confirm.service' -import { RestPagination, RestTable } from '../../../shared' +import { Component, OnInit } from '@angular/core' +import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' +import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' +import { RedundancyService } from '@app/shared/shared-main' import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' -import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' import { VideosRedundancyStats } from '@shared/models/server' -import { BytesPipe } from 'ngx-pipes' -import { RedundancyService } from '@app/shared/video/redundancy.service' @Component({ selector: 'my-video-redundancies-list', diff --git a/client/src/app/+admin/moderation/index.ts b/client/src/app/+admin/moderation/index.ts index e99244b74..16249236c 100644 --- a/client/src/app/+admin/moderation/index.ts +++ b/client/src/app/+admin/moderation/index.ts @@ -1,3 +1,4 @@ +export * from './instance-blocklist' export * from './video-abuse-list' export * from './video-block-list' export * from './moderation.component' diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts index 90a176194..d9fec29ce 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core' -import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' +import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation' @Component({ selector: 'my-instance-account-blocklist', - styleUrls: [ '../moderation.component.scss', '../../../shared/blocklist/account-blocklist.component.scss' ], - templateUrl: '../../../shared/blocklist/account-blocklist.component.html' + styleUrls: [ '../moderation.component.scss', '../../../shared/shared-moderation/account-blocklist.component.scss' ], + templateUrl: '../../../shared/shared-moderation/account-blocklist.component.html' }) export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent { mode = BlocklistComponentType.Instance diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts index 9d4ec174a..3afae529f 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core' -import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' +import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/shared-moderation' @Component({ selector: 'my-instance-server-blocklist', - styleUrls: [ '../../../shared/blocklist/server-blocklist.component.scss' ], - templateUrl: '../../../shared/blocklist/server-blocklist.component.html' + styleUrls: [ '../../../shared/shared-moderation/server-blocklist.component.scss' ], + templateUrl: '../../../shared/shared-moderation/server-blocklist.component.html' }) export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent { mode = BlocklistComponentType.Instance diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts index 1b1df6f09..806f9d100 100644 --- a/client/src/app/+admin/moderation/moderation.component.ts +++ b/client/src/app/+admin/moderation/moderation.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core' -import { UserRight } from '../../../../../shared' import { AuthService, ServerService } from '@app/core' +import { UserRight } from '@shared/models' @Component({ templateUrl: './moderation.component.html', diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts index c08333f17..cd837bcb9 100644 --- a/client/src/app/+admin/moderation/moderation.routes.ts +++ b/client/src/app/+admin/moderation/moderation.routes.ts @@ -1,10 +1,10 @@ import { Routes } from '@angular/router' -import { UserRight } from '../../../../../shared' -import { UserRightGuard } from '@app/core' +import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' +import { ModerationComponent } from '@app/+admin/moderation/moderation.component' import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list' import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' -import { ModerationComponent } from '@app/+admin/moderation/moderation.component' -import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' +import { UserRightGuard } from '@app/core' +import { UserRight } from '@shared/models' export const ModerationRoutes: Routes = [ { diff --git a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts index a0471f2b0..3cd763ca4 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts @@ -1,11 +1,11 @@ import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' import { Notifier } from '@app/core' -import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' -import { I18n } from '@ngx-translate/i18n-polyfill' +import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms' +import { VideoAbuseService } from '@app/shared/shared-moderation' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' -import { FormValidatorService } from '../../../shared/forms/form-validators/form-validator.service' -import { VideoAbuse } from '../../../../../../shared/models/videos' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoAbuse } from '@shared/models' @Component({ selector: 'my-moderation-comment-modal', diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts index 13485124f..9aa70288d 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts @@ -1,9 +1,8 @@ import { Component, Input } from '@angular/core' -import { Actor } from '@app/shared/actor/actor.model' +import { Actor } from '@app/shared/shared-main' +import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' import { ProcessedVideoAbuse } from './video-abuse-list.component' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { durationToString } from '@app/shared/misc/utils' @Component({ selector: 'my-video-abuse-details', diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts index d7f5beef3..b0a655e71 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts @@ -1,23 +1,16 @@ -import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core' -import { Account } from '@app/shared/account/account.model' -import { Notifier } from '@app/core' import { SortMeta } from 'primeng/api' -import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' -import { RestPagination, RestTable, VideoAbuseService, VideoBlockService } from '../../../shared' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { DropdownAction } from '../../../shared/buttons/action-dropdown.component' -import { ConfirmService } from '../../../core/index' -import { ModerationCommentModalComponent } from './moderation-comment-modal.component' -import { Video } from '../../../shared/video/video.model' -import { MarkdownService } from '@app/shared/renderer' -import { Actor } from '@app/shared/actor/actor.model' +import { filter } from 'rxjs/operators' import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' +import { environment } from 'src/environments/environment' +import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' -import { BlocklistService } from '@app/shared/blocklist' -import { VideoService } from '@app/shared/video/video.service' import { ActivatedRoute, Params, Router } from '@angular/router' -import { filter } from 'rxjs/operators' -import { environment } from 'src/environments/environment' +import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core' +import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main' +import { BlocklistService, VideoAbuseService, VideoBlockService } from '@app/shared/shared-moderation' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoAbuse, VideoAbuseState } from '@shared/models' +import { ModerationCommentModalComponent } from './moderation-comment-modal.component' export type ProcessedVideoAbuse = VideoAbuse & { moderationCommentHtml?: string, diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index c0ac32242..c03f9248e 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts @@ -1,16 +1,12 @@ -import { Component, OnInit, AfterViewInit } from '@angular/core' import { SortMeta } from 'primeng/api' -import { Notifier, ServerService } from '@app/core' -import { ConfirmService } from '../../../core' -import { RestPagination, RestTable, VideoBlockService } from '../../../shared' -import { VideoBlacklist, VideoBlacklistType } from '../../../../../../shared' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { DropdownAction } from '../../../shared/buttons/action-dropdown.component' -import { Video } from '../../../shared/video/video.model' -import { MarkdownService } from '@app/shared/renderer' -import { Params, ActivatedRoute, Router } from '@angular/router' import { filter, switchMap } from 'rxjs/operators' -import { VideoService } from '@app/shared/video/video.service' +import { AfterViewInit, Component, OnInit } from '@angular/core' +import { ActivatedRoute, Params, Router } from '@angular/router' +import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' +import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' +import { VideoBlockService } from '@app/shared/shared-moderation' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { VideoBlacklist, VideoBlacklistType } from '@shared/models' @Component({ selector: 'my-video-block-list', diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index a8973f2b2..af31f1144 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts @@ -1,14 +1,13 @@ +import { Subject } from 'rxjs' import { Component, OnInit } from '@angular/core' -import { PluginType } from '@shared/models/plugins/plugin.type' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' -import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' -import { ConfirmService, Notifier } from '@app/core' -import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' import { ActivatedRoute, Router } from '@angular/router' -import { compareSemVer } from '@shared/core-utils/miscs/miscs' +import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' +import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' import { PluginService } from '@app/core/plugins/plugin.service' -import { Subject } from 'rxjs' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { compareSemVer } from '@shared/core-utils/miscs/miscs' +import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' +import { PluginType } from '@shared/models/plugins/plugin.type' @Component({ selector: 'my-plugin-list-installed', diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts index dc59e759b..ccf9f1ed5 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts @@ -1,14 +1,12 @@ +import { Subject } from 'rxjs' +import { debounceTime, distinctUntilChanged } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' -import { Notifier, ServerService } from '@app/core' -import { ConfirmService } from '../../../core' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { PluginType } from '@shared/models/plugins/plugin.type' -import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' -import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' import { ActivatedRoute, Router } from '@angular/router' +import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' +import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, ServerService } from '@app/core' +import { I18n } from '@ngx-translate/i18n-polyfill' import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' -import { Subject } from 'rxjs' -import { debounceTime, distinctUntilChanged } from 'rxjs/operators' +import { PluginType } from '@shared/models/plugins/plugin.type' @Component({ selector: 'my-plugin-search', diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts index 13d12b145..dde03f1da 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts @@ -1,13 +1,12 @@ -import { Component, OnDestroy, OnInit } from '@angular/core' -import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' -import { Notifier } from '@app/core' -import { ActivatedRoute } from '@angular/router' import { Subscription } from 'rxjs' import { map, switchMap } from 'rxjs/operators' -import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared' -import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' +import { Component, OnDestroy, OnInit } from '@angular/core' +import { ActivatedRoute } from '@angular/router' +import { Notifier } from '@app/core' +import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared/shared-forms' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models' +import { PluginApiService } from '../shared/plugin-api.service' @Component({ selector: 'my-plugin-show-installed', diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index f6ef68e9c..bf9129e01 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts @@ -1,19 +1,21 @@ +import { Observable } from 'rxjs' import { catchError, map, switchMap } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' -import { environment } from '../../../../environments/environment' -import { RestExtractor, RestService } from '../../../shared' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { PluginType } from '@shared/models/plugins/plugin.type' -import { ComponentPagination } from '@app/shared/rest/component-pagination.model' -import { peertubeTranslate, ResultList } from '@shared/models' -import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' -import { ManagePlugin } from '@shared/models/plugins/manage-plugin.model' -import { InstallOrUpdatePlugin } from '@shared/models/plugins/install-plugin.model' -import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' -import { RegisteredServerSettings, RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' +import { ComponentPagination, RestExtractor, RestService } from '@app/core' import { PluginService } from '@app/core/plugins/plugin.service' -import { Observable } from 'rxjs' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { + InstallOrUpdatePlugin, + ManagePlugin, + PeerTubePlugin, + PeerTubePluginIndex, + peertubeTranslate, + PluginType, + RegisteredServerSettings, + ResultList +} from '@shared/models' +import { environment } from '../../../../environments/environment' @Injectable() export class PluginApiService { diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts index 8a77f79f7..a88d837f3 100644 --- a/client/src/app/+admin/system/debug/debug.component.ts +++ b/client/src/app/+admin/system/debug/debug.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core' import { Notifier } from '@app/core' -import { Debug } from '@shared/models/server' -import { DebugService } from '@app/+admin/system/debug/debug.service' +import { Debug } from '@shared/models' +import { DebugService } from './debug.service' @Component({ templateUrl: './debug.component.html', diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts index 6c722d177..ab1d0a7fa 100644 --- a/client/src/app/+admin/system/debug/debug.service.ts +++ b/client/src/app/+admin/system/debug/debug.service.ts @@ -1,10 +1,10 @@ +import { Observable } from 'rxjs' import { catchError } from 'rxjs/operators' import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' -import { Observable } from 'rxjs' +import { RestExtractor } from '@app/core' +import { Debug } from '@shared/models' import { environment } from '../../../../environments/environment' -import { RestExtractor, RestService } from '../../../shared' -import { Debug } from '@shared/models/server' @Injectable() export class DebugService { @@ -12,7 +12,6 @@ export class DebugService { constructor ( private authHttp: HttpClient, - private restService: RestService, private restExtractor: RestExtractor ) {} diff --git a/client/src/app/+admin/system/index.ts b/client/src/app/+admin/system/index.ts index 226d999d2..8cced0cdb 100644 --- a/client/src/app/+admin/system/index.ts +++ b/client/src/app/+admin/system/index.ts @@ -1,3 +1,4 @@ +export * from './debug' export * from './jobs' export * from './logs' export * from './system.component' diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts index 1e2291ad1..1ac50f050 100644 --- a/client/src/app/+admin/system/jobs/job.service.ts +++ b/client/src/app/+admin/system/jobs/job.service.ts @@ -1,12 +1,11 @@ +import { SortMeta } from 'primeng/api' +import { Observable } from 'rxjs' import { catchError, map } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' -import { SortMeta } from 'primeng/api' -import { Observable } from 'rxjs' -import { ResultList } from '../../../../../../shared' -import { Job } from '../../../../../../shared/models/server/job.model' +import { RestExtractor, RestPagination, RestService } from '@app/core' +import { Job, ResultList } from '@shared/models' import { environment } from '../../../../environments/environment' -import { RestExtractor, RestPagination, RestService } from '../../../shared' import { JobStateClient } from '../../../../types/job-state-client.type' import { JobTypeClient } from '../../../../types/job-type-client.type' diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index 4f7f7c368..38a78de33 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts @@ -1,14 +1,12 @@ -import { Component, OnInit } from '@angular/core' -import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' -import { Notifier } from '@app/core' import { SortMeta } from 'primeng/api' -import { Job, JobType } from '../../../../../../shared/index' -import { JobState } from '../../../../../../shared/models' -import { RestPagination, RestTable } from '../../../shared' -import { JobService } from './job.service' +import { Component, OnInit } from '@angular/core' +import { Notifier, RestPagination, RestTable } from '@app/core' +import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' import { I18n } from '@ngx-translate/i18n-polyfill' +import { Job, JobState, JobType } from '@shared/models' import { JobStateClient } from '../../../../types/job-state-client.type' import { JobTypeClient } from '../../../../types/job-type-client.type' +import { JobService } from './job.service' @Component({ selector: 'my-jobs', diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts index b22581b5a..615778210 100644 --- a/client/src/app/+admin/system/logs/log-row.model.ts +++ b/client/src/app/+admin/system/logs/log-row.model.ts @@ -1,4 +1,4 @@ -import { LogLevel } from '@shared/models/server/log-level.type' +import { LogLevel } from '@shared/models' import omit from 'lodash-es/omit' export class LogRow { diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts index b63f11953..51f047188 100644 --- a/client/src/app/+admin/system/logs/logs.component.ts +++ b/client/src/app/+admin/system/logs/logs.component.ts @@ -1,9 +1,9 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' -import { LogsService } from '@app/+admin/system/logs/logs.service' import { Notifier } from '@app/core' -import { LogRow } from '@app/+admin/system/logs/log-row.model' import { I18n } from '@ngx-translate/i18n-polyfill' -import { LogLevel } from '@shared/models/server/log-level.type' +import { LogLevel } from '@shared/models' +import { LogRow } from './log-row.model' +import { LogsService } from './logs.service' @Component({ templateUrl: './logs.component.html', diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts index 41b38c7ba..69439a179 100644 --- a/client/src/app/+admin/system/logs/logs.service.ts +++ b/client/src/app/+admin/system/logs/logs.service.ts @@ -1,11 +1,11 @@ +import { Observable } from 'rxjs' import { catchError, map } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' -import { Observable } from 'rxjs' +import { RestExtractor } from '@app/core' +import { LogLevel } from '@shared/models' import { environment } from '../../../../environments/environment' -import { RestExtractor, RestService } from '../../../shared' -import { LogRow } from '@app/+admin/system/logs/log-row.model' -import { LogLevel } from '@shared/models/server/log-level.type' +import { LogRow } from './log-row.model' @Injectable() export class LogsService { @@ -14,7 +14,6 @@ export class LogsService { constructor ( private authHttp: HttpClient, - private restService: RestService, private restExtractor: RestExtractor ) {} diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts index 2d851794d..0e8d98519 100644 --- a/client/src/app/+admin/system/system.routes.ts +++ b/client/src/app/+admin/system/system.routes.ts @@ -1,10 +1,10 @@ import { Routes } from '@angular/router' -import { UserRightGuard } from '../../core' -import { UserRight } from '../../../../../shared' -import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' -import { LogsComponent } from '@app/+admin/system/logs' -import { SystemComponent } from '@app/+admin/system/system.component' -import { DebugComponent } from '@app/+admin/system/debug' +import { UserRightGuard } from '@app/core' +import { UserRight } from '@shared/models' +import { DebugComponent } from './debug' +import { JobsComponent } from './jobs/jobs.component' +import { LogsComponent } from './logs' +import { SystemComponent } from './system.component' export const SystemRoutes: Routes = [ { diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index b459eb8fa..f9f5b90bd 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts @@ -1,14 +1,11 @@ import { Component, OnInit } from '@angular/core' -import { Router, ActivatedRoute } from '@angular/router' -import { AuthService, Notifier, ServerService } from '@app/core' -import { UserCreate, UserRole } from '../../../../../../shared' -import { UserEdit } from './user-edit' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' +import { ActivatedRoute, Router } from '@angular/router' import { ConfigService } from '@app/+admin/config/shared/config.service' -import { UserService } from '@app/shared' -import { ScreenService } from '@app/shared/misc/screen.service' +import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core' +import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { UserCreate, UserRole } from '@shared/models' +import { UserEdit } from './user-edit' @Component({ selector: 'my-user-create', diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index 5f5cc590c..8fa4b0635 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts @@ -1,11 +1,8 @@ -import { AuthService, ServerService } from '../../../core' -import { FormReactive } from '../../../shared' -import { ServerConfig, USER_ROLE_LABELS, UserRole, VideoResolution } from '../../../../../../shared' -import { ConfigService } from '@app/+admin/config/shared/config.service' -import { UserAdminFlag } from '@shared/models/users/user-flag.model' import { OnInit } from '@angular/core' -import { User } from '@app/shared/users/user.model' -import { ScreenService } from '@app/shared/misc/screen.service' +import { ConfigService } from '@app/+admin/config/shared/config.service' +import { AuthService, ScreenService, ServerService, User } from '@app/core' +import { FormReactive } from '@app/shared/shared-forms' +import { ServerConfig, USER_ROLE_LABELS, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' export abstract class UserEdit extends FormReactive implements OnInit { videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts index ecad000f7..33c7de31f 100644 --- a/client/src/app/+admin/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/users/user-edit/user-password.component.ts @@ -1,12 +1,8 @@ import { Component, Input, OnInit } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { UserService } from '@app/shared/users/user.service' -import { Notifier } from '../../../core' -import { User, UserUpdate } from '../../../../../../shared' +import { Notifier, UserService } from '@app/core' +import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' import { I18n } from '@ngx-translate/i18n-polyfill' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' -import { FormReactive } from '../../../shared' +import { UserUpdate } from '@shared/models' @Component({ selector: 'my-user-password', diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 035c0d4bb..870880fee 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts @@ -1,18 +1,12 @@ +import { Subscription } from 'rxjs' import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' -import { Subscription } from 'rxjs' -import { AuthService, Notifier } from '@app/core' -import { ServerService } from '../../../core' -import { UserEdit } from './user-edit' -import { User as UserType, UserUpdate, UserRole } from '../../../../../../shared' -import { I18n } from '@ngx-translate/i18n-polyfill' -import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' -import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service' import { ConfigService } from '@app/+admin/config/shared/config.service' -import { UserService } from '@app/shared' -import { UserAdminFlag } from '@shared/models/users/user-flag.model' -import { User } from '@app/shared/users/user.model' -import { ScreenService } from '@app/shared/misc/screen.service' +import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core' +import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models' +import { UserEdit } from './user-edit' @Component({ selector: 'my-user-update', diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts index da50b7ed0..8f01c7d51 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/users/user-list/user-list.component.ts @@ -1,13 +1,10 @@ -import { Component, OnInit, ViewChild } from '@angular/core' -import { AuthService, Notifier } from '@app/core' import { SortMeta } from 'primeng/api' -import { ConfirmService, ServerService } from '../../../core' -import { RestPagination, RestTable, UserService } from '../../../shared' +import { Component, OnInit, ViewChild } from '@angular/core' +import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core' +import { Actor, DropdownAction } from '@app/shared/shared-main' +import { UserBanModalComponent } from '@app/shared/shared-moderation' import { I18n } from '@ngx-translate/i18n-polyfill' -import { ServerConfig, User } from '../../../../../../shared' -import { UserBanModalComponent } from '@app/shared/moderation' -import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' -import { Actor } from '@app/shared/actor/actor.model' +import { ServerConfig, User } from '@shared/models' @Component({ selector: 'my-user-list', diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts index 2d4f9305e..6560f0260 100644 --- a/client/src/app/+admin/users/users.routes.ts +++ b/client/src/app/+admin/users/users.routes.ts @@ -1,11 +1,9 @@ import { Routes } from '@angular/router' - -import { UserRightGuard } from '../../core' -import { UserRight } from '../../../../../shared' -import { UsersComponent } from './users.component' +import { ServerConfigResolver, UserRightGuard } from '@app/core' +import { UserRight } from '@shared/models' import { UserCreateComponent, UserUpdateComponent } from './user-edit' import { UserListComponent } from './user-list' -import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' +import { UsersComponent } from './users.component' export const UsersRoutes: Routes = [ { -- cgit v1.2.3