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/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 +- 4 files changed, 6 insertions(+), 15 deletions(-) (limited to 'client/src/app/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, -- cgit v1.2.3