From bd45d503e5d007e730f4e81dccd7e7864c9a85cc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 6 Aug 2020 14:58:01 +0200 Subject: Reorganize shared models --- client/src/app/+admin/plugins/shared/plugin-api.service.ts | 2 +- client/src/app/+admin/users/user-edit/user-edit.ts | 5 +++-- .../src/app/+videos/video-list/overview/overview.service.ts | 3 ++- client/src/app/app.component.ts | 3 ++- client/src/app/app.module.ts | 2 +- client/src/app/core/auth/auth-user.model.ts | 4 ++-- client/src/app/core/plugins/plugin.service.ts | 4 +--- client/src/app/core/server/server.service.ts | 11 ++--------- client/src/app/core/users/user.model.ts | 2 +- client/src/app/menu/language-chooser.component.ts | 2 +- client/src/app/shared/shared-instance/instance.service.ts | 3 ++- .../shared/shared-main/video-caption/video-caption.service.ts | 3 ++- .../src/app/shared/shared-main/video/video-import.service.ts | 3 ++- client/src/app/shared/shared-main/video/video.model.ts | 2 +- .../report-modals/account-report.component.ts | 3 ++- .../report-modals/comment-report.component.ts | 3 ++- .../shared-moderation/report-modals/video-report.component.ts | 3 ++- .../app/shared/shared-video-playlist/video-playlist.model.ts | 2 +- 18 files changed, 30 insertions(+), 30 deletions(-) (limited to 'client/src/app') 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 bf9129e01..1fb827832 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts @@ -5,12 +5,12 @@ import { Injectable } from '@angular/core' import { ComponentPagination, RestExtractor, RestService } from '@app/core' import { PluginService } from '@app/core/plugins/plugin.service' import { I18n } from '@ngx-translate/i18n-polyfill' +import { peertubeTranslate } from '@shared/core-utils/i18n' import { InstallOrUpdatePlugin, ManagePlugin, PeerTubePlugin, PeerTubePluginIndex, - peertubeTranslate, PluginType, RegisteredServerSettings, ResultList 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 22ec42520..bdbb10814 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts @@ -1,8 +1,9 @@ -import { OnInit, Directive } from '@angular/core' +import { Directive, OnInit } from '@angular/core' 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' +import { USER_ROLE_LABELS } from '@shared/core-utils/users' +import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' @Directive() export abstract class UserEdit extends FormReactive implements OnInit { diff --git a/client/src/app/+videos/video-list/overview/overview.service.ts b/client/src/app/+videos/video-list/overview/overview.service.ts index 4458454d5..3aa64ebc8 100644 --- a/client/src/app/+videos/video-list/overview/overview.service.ts +++ b/client/src/app/+videos/video-list/overview/overview.service.ts @@ -5,7 +5,8 @@ import { Injectable } from '@angular/core' import { RestExtractor, ServerService } from '@app/core' import { immutableAssign } from '@app/helpers' import { VideoService } from '@app/shared/shared-main' -import { peertubeTranslate, VideosOverview as VideosOverviewServer } from '@shared/models' +import { peertubeTranslate } from '@shared/core-utils/i18n' +import { VideosOverview as VideosOverviewServer } from '@shared/models' import { environment } from '../../../../environments/environment' import { VideosOverview } from './videos-overview.model' diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index dee7fd056..ff0e28aa5 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -13,7 +13,8 @@ import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config- import { WelcomeModalComponent } from '@app/modal/welcome-modal.component' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { I18n } from '@ngx-translate/i18n-polyfill' -import { BroadcastMessageLevel, getShortLocale, is18nPath, ServerConfig, UserRole } from '@shared/models' +import { getShortLocale, is18nPath } from '@shared/core-utils/i18n' +import { BroadcastMessageLevel, ServerConfig, UserRole } from '@shared/models' import { MenuService } from './core/menu/menu.service' import { POP_STATE_MODAL_DISMISS } from './helpers' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 9698de275..b35cc1716 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts @@ -5,7 +5,7 @@ import { BrowserModule } from '@angular/platform-browser' import { ServerService } from '@app/core' import localeOc from '@app/helpers/locales/oc' import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' -import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models' +import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/core-utils/i18n' import { AppRoutingModule } from './app-routing.module' import { AppComponent } from './app.component' import { CoreModule } from './core' diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index ee61ff881..5efc6e1ab 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts @@ -1,9 +1,9 @@ import { Observable, of } from 'rxjs' import { map } from 'rxjs/operators' import { User } from '@app/core/users/user.model' -import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' +import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage' +import { hasUserRight } from '@shared/core-utils/users' import { - hasUserRight, MyUser as ServerMyUserModel, MyUserSpecialPlaylist, NSFWPolicyType, diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 3cab64142..dc115c0e1 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts @@ -9,15 +9,13 @@ import { RestExtractor } from '@app/core/rest' import { ServerService } from '@app/core/server/server.service' import { getDevLocale, importModule, isOnDevLocale } from '@app/helpers' import { CustomModalComponent } from '@app/modal/custom-modal.component' +import { getCompleteLocale, isDefaultLocale, peertubeTranslate } from '@shared/core-utils/i18n' import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks' import { ClientHook, ClientHookName, clientHookObject, ClientScript, - getCompleteLocale, - isDefaultLocale, - peertubeTranslate, PluginClientScope, PluginTranslation, PluginType, diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index c69e0919a..5bcf33c1b 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -4,15 +4,8 @@ import { HttpClient } from '@angular/common/http' import { Inject, Injectable, LOCALE_ID } from '@angular/core' import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' import { peertubeLocalStorage } from '@root-helpers/peertube-web-storage' -import { - getCompleteLocale, - isDefaultLocale, - peertubeTranslate, - SearchTargetType, - ServerConfig, - ServerStats, - VideoConstant -} from '@shared/models' +import { getCompleteLocale, isDefaultLocale, peertubeTranslate } from '@shared/core-utils/i18n' +import { SearchTargetType, ServerConfig, ServerStats, VideoConstant } from '@shared/models' import { environment } from '../../../environments/environment' @Injectable() diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index a94b35c46..f0d3a08b8 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts @@ -1,7 +1,7 @@ import { Account } from '@app/shared/shared-main/account/account.model' +import { hasUserRight } from '@shared/core-utils/users' import { Avatar, - hasUserRight, NSFWPolicyType, User as UserServerModel, UserAdminFlag, diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts index 3e89f72b8..e15aeff20 100644 --- a/client/src/app/menu/language-chooser.component.ts +++ b/client/src/app/menu/language-chooser.component.ts @@ -1,7 +1,7 @@ import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core' import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/models' +import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/core-utils/i18n' @Component({ selector: 'my-language-chooser', diff --git a/client/src/app/shared/shared-instance/instance.service.ts b/client/src/app/shared/shared-instance/instance.service.ts index ba9797bb5..fcfa59f28 100644 --- a/client/src/app/shared/shared-instance/instance.service.ts +++ b/client/src/app/shared/shared-instance/instance.service.ts @@ -3,7 +3,8 @@ import { catchError, map } from 'rxjs/operators' import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' import { MarkdownService, RestExtractor, ServerService } from '@app/core' -import { About, peertubeTranslate } from '@shared/models' +import { peertubeTranslate } from '@shared/core-utils/i18n' +import { About } from '@shared/models' import { environment } from '../../../environments/environment' @Injectable() diff --git a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts index d45fb837a..283c63f98 100644 --- a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts +++ b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts @@ -5,7 +5,8 @@ import { Injectable } from '@angular/core' import { RestExtractor, ServerService } from '@app/core' import { objectToFormData, sortBy } from '@app/helpers' import { VideoService } from '@app/shared/shared-main/video' -import { peertubeTranslate, ResultList, VideoCaption } from '@shared/models' +import { peertubeTranslate } from '@shared/core-utils/i18n' +import { ResultList, VideoCaption } from '@shared/models' import { VideoCaptionEdit } from './video-caption-edit.model' @Injectable() diff --git a/client/src/app/shared/shared-main/video/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts index a700abacb..99df78e3a 100644 --- a/client/src/app/shared/shared-main/video/video-import.service.ts +++ b/client/src/app/shared/shared-main/video/video-import.service.ts @@ -5,7 +5,8 @@ import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { RestExtractor, RestPagination, RestService, ServerService, UserService } from '@app/core' import { objectToFormData } from '@app/helpers' -import { peertubeTranslate, ResultList, VideoImport, VideoImportCreate, VideoUpdate } from '@shared/models' +import { peertubeTranslate } from '@shared/core-utils/i18n' +import { ResultList, VideoImport, VideoImportCreate, VideoUpdate } from '@shared/models' import { environment } from '../../../../environments/environment' @Injectable() diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 147d0817e..73f0198e2 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -1,9 +1,9 @@ import { AuthUser } from '@app/core' import { User } from '@app/core/users/user.model' import { durationToString, getAbsoluteAPIUrl, getAbsoluteEmbedUrl } from '@app/helpers' +import { peertubeTranslate } from '@shared/core-utils/i18n' import { Avatar, - peertubeTranslate, ServerConfig, UserRight, Video as VideoServerModel, diff --git a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts index 78ca934c7..08dbe9538 100644 --- a/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/account-report.component.ts @@ -6,7 +6,8 @@ import { Account } from '@app/shared/shared-main' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' import { I18n } from '@ngx-translate/i18n-polyfill' -import { abusePredefinedReasonsMap, AbusePredefinedReasonsString } from '@shared/models' +import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' +import { AbusePredefinedReasonsString } from '@shared/models' import { AbuseService } from '../abuse.service' @Component({ diff --git a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts index 00d7b8d34..2769874d9 100644 --- a/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/comment-report.component.ts @@ -6,7 +6,8 @@ import { VideoComment } from '@app/shared/shared-video-comment' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' import { I18n } from '@ngx-translate/i18n-polyfill' -import { abusePredefinedReasonsMap, AbusePredefinedReasonsString } from '@shared/models' +import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' +import { AbusePredefinedReasonsString } from '@shared/models' import { AbuseService } from '../abuse.service' @Component({ diff --git a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts index 7d53ea3c9..09ab98dfe 100644 --- a/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts +++ b/client/src/app/shared/shared-moderation/report-modals/video-report.component.ts @@ -7,7 +7,8 @@ import { AbuseValidatorsService, FormReactive, FormValidatorService } from '@app import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' import { I18n } from '@ngx-translate/i18n-polyfill' -import { abusePredefinedReasonsMap, AbusePredefinedReasonsString } from '@shared/models' +import { abusePredefinedReasonsMap } from '@shared/core-utils/abuse' +import { AbusePredefinedReasonsString } from '@shared/models' import { Video } from '../../shared-main' import { AbuseService } from '../abuse.service' diff --git a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts index 8f63d2abd..7de379cdf 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts @@ -1,8 +1,8 @@ import { getAbsoluteAPIUrl } from '@app/helpers' import { Actor } from '@app/shared/shared-main' +import { peertubeTranslate } from '@shared/core-utils/i18n' import { AccountSummary, - peertubeTranslate, VideoChannelSummary, VideoConstant, VideoPlaylist as ServerVideoPlaylist, -- cgit v1.2.3