From 0d3b8823e461035a6931b171efb2180c4f451204 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 3 Mar 2019 10:30:12 +0100 Subject: [PATCH] ui directory refactoring adding thumbnail loader for faces --- backend/middlewares/PersonMWs.ts | 46 +++++++- .../thumbnail/ThumbnailGeneratorMWs.ts | 34 ++++++ backend/model/sql/enitites/PersonEntry.ts | 3 + backend/routes/PersonRouter.ts | 9 ++ common/entities/PersonDTO.ts | 16 +++ frontend/app/app.component.ts | 2 +- frontend/app/app.module.ts | 103 ++++++++++-------- frontend/app/app.routing.ts | 12 +- frontend/app/faces/face/face.component.ts | 31 ------ frontend/app/faces/faces.component.ts | 21 ---- .../directory/directory.gallery.component.ts | 79 -------------- frontend/app/model/navigation.service.ts | 2 +- .../network/autehentication.service.spec.ts | 2 +- .../model/network/authentication.service.ts | 2 +- frontend/app/model/network/network.service.ts | 1 - .../app/model/network/user.service.spec.ts | 2 +- frontend/app/model/network/user.service.ts | 2 +- frontend/app/model/query.service.ts | 4 +- .../{gallery => pipes}/FixOrientationPipe.ts | 0 .../app/{ => ui}/admin/admin.component.css | 0 .../app/{ => ui}/admin/admin.component.html | 0 .../app/{ => ui}/admin/admin.component.ts | 10 +- .../duplicates/duplicates.component.css | 0 .../duplicates/duplicates.component.html | 0 .../duplicates/duplicates.component.ts | 12 +- .../{ => ui}/duplicates/duplicates.service.ts | 4 +- .../photo/photo.duplicates.component.css | 0 .../photo/photo.duplicates.component.html | 0 .../photo/photo.duplicates.component.ts | 4 +- .../{ => ui}/faces/face/face.component.css | 0 .../{ => ui}/faces/face/face.component.html | 13 ++- frontend/app/ui/faces/face/face.component.ts | 46 ++++++++ .../app/{ => ui}/faces/faces.component.css | 0 .../app/{ => ui}/faces/faces.component.html | 3 +- frontend/app/ui/faces/faces.component.ts | 36 ++++++ frontend/app/{ => ui}/faces/faces.service.ts | 4 +- .../app/{ => ui}/frame/frame.component.css | 0 .../app/{ => ui}/frame/frame.component.html | 0 .../app/{ => ui}/frame/frame.component.ts | 10 +- frontend/app/{ => ui}/gallery/Media.ts | 6 +- frontend/app/{ => ui}/gallery/MediaIcon.ts | 6 +- .../{ => ui}/gallery/cache.gallery.service.ts | 16 +-- .../directories/directories.component.css | 4 + .../directories/directories.component.html | 4 + .../directories/directories.component.ts | 28 +++++ .../directory/directory.gallery.component.css | 0 .../directory.gallery.component.html | 10 +- .../directory/directory.gallery.component.ts | 84 ++++++++++++++ .../{ => ui}/gallery/fullscreen.service.ts | 2 +- .../{ => ui}/gallery/gallery.component.css | 4 - .../{ => ui}/gallery/gallery.component.html | 12 +- .../app/{ => ui}/gallery/gallery.component.ts | 30 +++-- .../app/{ => ui}/gallery/gallery.service.ts | 18 +-- .../app/{ => ui}/gallery/grid/GridMedia.ts | 6 +- .../{ => ui}/gallery/grid/GridRowBuilder.ts | 4 +- .../gallery/grid/grid.gallery.component.css | 0 .../gallery/grid/grid.gallery.component.html | 0 .../gallery/grid/grid.gallery.component.ts | 16 +-- .../loading.photo.grid.gallery.component.css | 0 .../loading.photo.grid.gallery.component.html | 0 .../loading.photo.grid.gallery.component.ts | 0 .../photo/photo.grid.gallery.component.css | 0 .../photo/photo.grid.gallery.component.html | 0 .../photo/photo.grid.gallery.component.ts | 10 +- .../info-panel.lightbox.gallery.component.css | 0 ...info-panel.lightbox.gallery.component.html | 0 .../info-panel.lightbox.gallery.component.ts | 12 +- .../{ => ui}/gallery/lightbox/inputrange.css | 0 .../lightbox/lightbox.gallery.component.css | 0 .../lightbox/lightbox.gallery.component.html | 0 .../lightbox/lightbox.gallery.component.ts | 12 +- .../media.lightbox.gallery.component.css | 0 .../media.lightbox.gallery.component.html | 0 .../media/media.lightbox.gallery.component.ts | 4 +- .../lightbox.map.gallery.component.css | 0 .../lightbox.map.gallery.component.html | 0 .../lightbox.map.gallery.component.ts | 16 +-- .../gallery/map/map.gallery.component.css | 0 .../gallery/map/map.gallery.component.html | 0 .../gallery/map/map.gallery.component.ts | 6 +- .../app/{ => ui}/gallery/map/map.service.ts | 10 +- .../navigator/navigator.gallery.component.css | 0 .../navigator.gallery.component.html | 0 .../navigator/navigator.gallery.component.ts | 18 +-- .../app/{ => ui}/gallery/overlay.service.ts | 4 +- ...random-query-builder.gallery.component.css | 0 ...andom-query-builder.gallery.component.html | 0 .../random-query-builder.gallery.component.ts | 14 +-- .../gallery/search/autocomplete.service.ts | 4 +- .../search/search.gallery.component.css | 0 .../search/search.gallery.component.html | 0 .../search/search.gallery.component.ts | 8 +- .../app/{ => ui}/gallery/share.service.ts | 8 +- .../gallery/share/share.gallery.component.css | 0 .../share/share.gallery.component.html | 0 .../gallery/share/share.gallery.component.ts | 12 +- .../gallery/thumbnailLoader.service.ts | 85 +++++++-------- .../gallery/thumbnailManager.service.ts | 67 +++++++++++- .../{ => ui}/language/language.component.css | 0 .../{ => ui}/language/language.component.html | 0 .../{ => ui}/language/language.component.ts | 4 +- .../app/{ => ui}/login/login.component.css | 0 .../app/{ => ui}/login/login.component.html | 0 .../app/{ => ui}/login/login.component.ts | 10 +- .../_abstract/abstract.settings.component.css | 0 .../_abstract/abstract.settings.component.ts | 14 +-- .../_abstract/abstract.settings.service.ts | 0 .../basic/basic.settings.component.css | 0 .../basic/basic.settings.component.html | 0 .../basic/basic.settings.component.ts | 8 +- .../settings/basic/basic.settings.service.ts | 4 +- .../database/database.settings.component.css | 0 .../database/database.settings.component.html | 0 .../database/database.settings.component.ts | 10 +- .../database/database.settings.service.ts | 4 +- .../indexing/indexing.settings.component.css | 0 .../indexing/indexing.settings.component.html | 0 .../indexing/indexing.settings.component.ts | 14 +-- .../indexing/indexing.settings.service.ts | 10 +- .../settings/map/map.settings.component.css | 0 .../settings/map/map.settings.component.html | 0 .../settings/map/map.settings.component.ts | 10 +- .../settings/map/map.settings.service.ts | 4 +- .../metafiles/metafile.settings.component.css | 0 .../metafile.settings.component.html | 0 .../metafiles/metafile.settings.component.ts | 8 +- .../metafiles/metafile.settings.service.ts | 4 +- .../other/other.settings.component.css | 0 .../other/other.settings.component.html | 0 .../other/other.settings.component.ts | 12 +- .../settings/other/other.settings.service.ts | 4 +- .../random-photo.settings.component.css | 0 .../random-photo.settings.component.html | 0 .../random-photo.settings.component.ts | 8 +- .../random-photo.settings.service.ts | 6 +- .../search/search.settings.component.css | 0 .../search/search.settings.component.html | 0 .../search/search.settings.component.ts | 8 +- .../search/search.settings.service.ts | 6 +- .../app/{ => ui}/settings/settings.service.ts | 10 +- .../share/share.settings.component.css | 0 .../share/share.settings.component.html | 0 .../share/share.settings.component.ts | 8 +- .../settings/share/share.settings.service.ts | 6 +- .../thumbanil.settings.component.css | 0 .../thumbanil.settings.component.html | 0 .../thumbnail/thumbanil.settings.component.ts | 12 +- .../thumbnail/thumbanil.settings.service.ts | 6 +- .../usermanager.settings.component.css | 0 .../usermanager.settings.component.html | 0 .../usermanager.settings.component.ts | 12 +- .../usermanager.settings.service.ts | 6 +- .../video/video.settings.component.css | 0 .../video/video.settings.component.html | 0 .../video/video.settings.component.ts | 8 +- .../settings/video/video.settings.service.ts | 4 +- .../sharelogin/share-login.component.css | 0 .../sharelogin/share-login.component.html | 0 .../sharelogin/share-login.component.ts | 8 +- package.json | 4 +- 160 files changed, 760 insertions(+), 525 deletions(-) delete mode 100644 frontend/app/faces/face/face.component.ts delete mode 100644 frontend/app/faces/faces.component.ts delete mode 100644 frontend/app/gallery/directory/directory.gallery.component.ts rename frontend/app/{gallery => pipes}/FixOrientationPipe.ts (100%) rename frontend/app/{ => ui}/admin/admin.component.css (100%) rename frontend/app/{ => ui}/admin/admin.component.html (100%) rename frontend/app/{ => ui}/admin/admin.component.ts (75%) rename frontend/app/{ => ui}/duplicates/duplicates.component.css (100%) rename frontend/app/{ => ui}/duplicates/duplicates.component.html (100%) rename frontend/app/{ => ui}/duplicates/duplicates.component.ts (91%) rename frontend/app/{ => ui}/duplicates/duplicates.service.ts (76%) rename frontend/app/{ => ui}/duplicates/photo/photo.duplicates.component.css (100%) rename frontend/app/{ => ui}/duplicates/photo/photo.duplicates.component.html (100%) rename frontend/app/{ => ui}/duplicates/photo/photo.duplicates.component.ts (88%) rename frontend/app/{ => ui}/faces/face/face.component.css (100%) rename frontend/app/{ => ui}/faces/face/face.component.html (59%) create mode 100644 frontend/app/ui/faces/face/face.component.ts rename frontend/app/{ => ui}/faces/faces.component.css (100%) rename frontend/app/{ => ui}/faces/faces.component.html (64%) create mode 100644 frontend/app/ui/faces/faces.component.ts rename frontend/app/{ => ui}/faces/faces.service.ts (77%) rename frontend/app/{ => ui}/frame/frame.component.css (100%) rename frontend/app/{ => ui}/frame/frame.component.html (100%) rename frontend/app/{ => ui}/frame/frame.component.ts (75%) rename frontend/app/{ => ui}/gallery/Media.ts (91%) rename frontend/app/{ => ui}/gallery/MediaIcon.ts (88%) rename frontend/app/{ => ui}/gallery/cache.gallery.service.ts (93%) create mode 100644 frontend/app/ui/gallery/directories/directories.component.css create mode 100644 frontend/app/ui/gallery/directories/directories.component.html create mode 100644 frontend/app/ui/gallery/directories/directories.component.ts rename frontend/app/{gallery => ui/gallery/directories}/directory/directory.gallery.component.css (100%) rename frontend/app/{gallery => ui/gallery/directories}/directory/directory.gallery.component.html (65%) create mode 100644 frontend/app/ui/gallery/directories/directory/directory.gallery.component.ts rename frontend/app/{ => ui}/gallery/fullscreen.service.ts (96%) rename frontend/app/{ => ui}/gallery/gallery.component.css (94%) rename frontend/app/{ => ui}/gallery/gallery.component.html (87%) rename frontend/app/{ => ui}/gallery/gallery.component.ts (87%) rename frontend/app/{ => ui}/gallery/gallery.service.ts (91%) rename frontend/app/{ => ui}/gallery/grid/GridMedia.ts (75%) rename frontend/app/{ => ui}/gallery/grid/GridRowBuilder.ts (93%) rename frontend/app/{ => ui}/gallery/grid/grid.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/grid/grid.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/grid/grid.gallery.component.ts (95%) rename frontend/app/{ => ui}/gallery/grid/photo/loading/loading.photo.grid.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/grid/photo/loading/loading.photo.grid.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/grid/photo/loading/loading.photo.grid.gallery.component.ts (100%) rename frontend/app/{ => ui}/gallery/grid/photo/photo.grid.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/grid/photo/photo.grid.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/grid/photo/photo.grid.gallery.component.ts (93%) rename frontend/app/{ => ui}/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts (88%) rename frontend/app/{ => ui}/gallery/lightbox/inputrange.css (100%) rename frontend/app/{ => ui}/gallery/lightbox/lightbox.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/lightbox/lightbox.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/lightbox/lightbox.gallery.component.ts (98%) rename frontend/app/{ => ui}/gallery/lightbox/media/media.lightbox.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/lightbox/media/media.lightbox.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/lightbox/media/media.lightbox.gallery.component.ts (97%) rename frontend/app/{ => ui}/gallery/map/lightbox/lightbox.map.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/map/lightbox/lightbox.map.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/map/lightbox/lightbox.map.gallery.component.ts (93%) rename frontend/app/{ => ui}/gallery/map/map.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/map/map.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/map/map.gallery.component.ts (91%) rename frontend/app/{ => ui}/gallery/map/map.service.ts (88%) rename frontend/app/{ => ui}/gallery/navigator/navigator.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/navigator/navigator.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/navigator/navigator.gallery.component.ts (83%) rename frontend/app/{ => ui}/gallery/overlay.service.ts (92%) rename frontend/app/{ => ui}/gallery/random-query-builder/random-query-builder.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/random-query-builder/random-query-builder.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/random-query-builder/random-query-builder.gallery.component.ts (83%) rename frontend/app/{ => ui}/gallery/search/autocomplete.service.ts (81%) rename frontend/app/{ => ui}/gallery/search/search.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/search/search.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/search/search.gallery.component.ts (93%) rename frontend/app/{ => ui}/gallery/share.service.ts (91%) rename frontend/app/{ => ui}/gallery/share/share.gallery.component.css (100%) rename frontend/app/{ => ui}/gallery/share/share.gallery.component.html (100%) rename frontend/app/{ => ui}/gallery/share/share.gallery.component.ts (89%) rename frontend/app/{ => ui}/gallery/thumbnailLoader.service.ts (74%) rename frontend/app/{ => ui}/gallery/thumbnailManager.service.ts (78%) rename frontend/app/{ => ui}/language/language.component.css (100%) rename frontend/app/{ => ui}/language/language.component.html (100%) rename frontend/app/{ => ui}/language/language.component.ts (80%) rename frontend/app/{ => ui}/login/login.component.css (100%) rename frontend/app/{ => ui}/login/login.component.html (100%) rename frontend/app/{ => ui}/login/login.component.ts (73%) rename frontend/app/{ => ui}/settings/_abstract/abstract.settings.component.css (100%) rename frontend/app/{ => ui}/settings/_abstract/abstract.settings.component.ts (89%) rename frontend/app/{ => ui}/settings/_abstract/abstract.settings.service.ts (100%) rename frontend/app/{ => ui}/settings/basic/basic.settings.component.css (100%) rename frontend/app/{ => ui}/settings/basic/basic.settings.component.html (100%) rename frontend/app/{ => ui}/settings/basic/basic.settings.component.ts (86%) rename frontend/app/{ => ui}/settings/basic/basic.settings.service.ts (78%) rename frontend/app/{ => ui}/settings/database/database.settings.component.css (100%) rename frontend/app/{ => ui}/settings/database/database.settings.component.html (100%) rename frontend/app/{ => ui}/settings/database/database.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/database/database.settings.service.ts (78%) rename frontend/app/{ => ui}/settings/indexing/indexing.settings.component.css (100%) rename frontend/app/{ => ui}/settings/indexing/indexing.settings.component.html (100%) rename frontend/app/{ => ui}/settings/indexing/indexing.settings.component.ts (91%) rename frontend/app/{ => ui}/settings/indexing/indexing.settings.service.ts (77%) rename frontend/app/{ => ui}/settings/map/map.settings.component.css (100%) rename frontend/app/{ => ui}/settings/map/map.settings.component.html (100%) rename frontend/app/{ => ui}/settings/map/map.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/map/map.settings.service.ts (79%) rename frontend/app/{ => ui}/settings/metafiles/metafile.settings.component.css (100%) rename frontend/app/{ => ui}/settings/metafiles/metafile.settings.component.html (100%) rename frontend/app/{ => ui}/settings/metafiles/metafile.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/metafiles/metafile.settings.service.ts (82%) rename frontend/app/{ => ui}/settings/other/other.settings.component.css (100%) rename frontend/app/{ => ui}/settings/other/other.settings.component.html (100%) rename frontend/app/{ => ui}/settings/other/other.settings.component.ts (77%) rename frontend/app/{ => ui}/settings/other/other.settings.service.ts (78%) rename frontend/app/{ => ui}/settings/random-photo/random-photo.settings.component.css (100%) rename frontend/app/{ => ui}/settings/random-photo/random-photo.settings.component.html (100%) rename frontend/app/{ => ui}/settings/random-photo/random-photo.settings.component.ts (76%) rename frontend/app/{ => ui}/settings/random-photo/random-photo.settings.service.ts (77%) rename frontend/app/{ => ui}/settings/search/search.settings.component.css (100%) rename frontend/app/{ => ui}/settings/search/search.settings.component.html (100%) rename frontend/app/{ => ui}/settings/search/search.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/search/search.settings.service.ts (75%) rename frontend/app/{ => ui}/settings/settings.service.ts (89%) rename frontend/app/{ => ui}/settings/share/share.settings.component.css (100%) rename frontend/app/{ => ui}/settings/share/share.settings.component.html (100%) rename frontend/app/{ => ui}/settings/share/share.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/share/share.settings.service.ts (77%) rename frontend/app/{ => ui}/settings/thumbnail/thumbanil.settings.component.css (100%) rename frontend/app/{ => ui}/settings/thumbnail/thumbanil.settings.component.html (100%) rename frontend/app/{ => ui}/settings/thumbnail/thumbanil.settings.component.ts (83%) rename frontend/app/{ => ui}/settings/thumbnail/thumbanil.settings.service.ts (74%) rename frontend/app/{ => ui}/settings/usermanager/usermanager.settings.component.css (100%) rename frontend/app/{ => ui}/settings/usermanager/usermanager.settings.component.html (100%) rename frontend/app/{ => ui}/settings/usermanager/usermanager.settings.component.ts (90%) rename frontend/app/{ => ui}/settings/usermanager/usermanager.settings.service.ts (81%) rename frontend/app/{ => ui}/settings/video/video.settings.component.css (100%) rename frontend/app/{ => ui}/settings/video/video.settings.component.html (100%) rename frontend/app/{ => ui}/settings/video/video.settings.component.ts (75%) rename frontend/app/{ => ui}/settings/video/video.settings.service.ts (79%) rename frontend/app/{ => ui}/sharelogin/share-login.component.css (100%) rename frontend/app/{ => ui}/sharelogin/share-login.component.html (100%) rename frontend/app/{ => ui}/sharelogin/share-login.component.ts (75%) diff --git a/backend/middlewares/PersonMWs.ts b/backend/middlewares/PersonMWs.ts index 015b839d..0bbeb9cc 100644 --- a/backend/middlewares/PersonMWs.ts +++ b/backend/middlewares/PersonMWs.ts @@ -1,6 +1,8 @@ import {NextFunction, Request, Response} from 'express'; import {ErrorCodes, ErrorDTO} from '../../common/entities/Error'; import {ObjectManagers} from '../model/ObjectManagers'; +import {PersonDTO} from '../../common/entities/PersonDTO'; +import {PhotoDTO} from '../../common/entities/PhotoDTO'; const LOG_TAG = '[PersonMWs]'; @@ -9,8 +11,6 @@ export class PersonMWs { public static async listPersons(req: Request, res: Response, next: NextFunction) { - - try { req.resultPipe = await ObjectManagers.getInstance() .PersonManager.getAll(); @@ -23,6 +23,43 @@ export class PersonMWs { } + public static async addSamplePhotoForAll(req: Request, res: Response, next: NextFunction) { + if (!req.resultPipe) { + return next(); + } + try { + const persons = (req.resultPipe as PersonWithPhoto[]); + for (let i = 0; i < persons.length; i++) { + persons[i].samplePhoto = await ObjectManagers.getInstance() + .PersonManager.getSamplePhoto(persons[i].name); + } + req.resultPipe = persons; + return next(); + + } catch (err) { + return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during listing the directory', err)); + } + } + + + public static async removeSamplePhotoForAll(req: Request, res: Response, next: NextFunction) { + if (!req.resultPipe) { + return next(); + } + try { + const persons = (req.resultPipe as PersonWithPhoto[]); + for (let i = 0; i < persons.length; i++) { + delete persons[i].samplePhoto; + } + req.resultPipe = persons; + return next(); + + } catch (err) { + return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during listing the directory', err)); + } + } + + public static async getSamplePhoto(req: Request, res: Response, next: NextFunction) { if (!req.params.name) { return next(); @@ -44,3 +81,8 @@ export class PersonMWs { } } + + +export interface PersonWithPhoto extends PersonDTO { + samplePhoto: PhotoDTO; +} diff --git a/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.ts b/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.ts index 8d32dc36..fedec3e0 100644 --- a/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.ts +++ b/backend/middlewares/thumbnail/ThumbnailGeneratorMWs.ts @@ -14,6 +14,7 @@ import {RendererInput, ThumbnailSourceType, ThumbnailWorker} from '../../model/t import {MediaDTO} from '../../../common/entities/MediaDTO'; import {ITaskExecuter, TaskExecuter} from '../../model/threading/TaskExecuter'; import {FaceRegion, PhotoDTO} from '../../../common/entities/PhotoDTO'; +import {PersonWithPhoto} from '../PersonMWs'; export class ThumbnailGeneratorMWs { @@ -73,6 +74,39 @@ export class ThumbnailGeneratorMWs { } + + public static addThumbnailInfoForPersons(req: Request, res: Response, next: NextFunction) { + if (!req.resultPipe) { + return next(); + } + + try { + const size: number = Config.Client.Thumbnail.personThumbnailSize; + + const persons: PersonWithPhoto[] = req.resultPipe; + for (let i = 0; i < persons.length; i++) { + + // load parameters + const mediaPath = path.join(ProjectPath.ImageFolder, + persons[i].samplePhoto.directory.path, + persons[i].samplePhoto.directory.name, persons[i].samplePhoto.name); + + // generate thumbnail path + const thPath = path.join(ProjectPath.ThumbnailFolder, + ThumbnailGeneratorMWs.generatePersonThumbnailName(mediaPath, persons[i].samplePhoto.metadata.faces[0], size)); + + persons[i].readyThumbnail = fs.existsSync(thPath); + } + + } catch (error) { + return next(new ErrorDTO(ErrorCodes.SERVER_ERROR, 'error during postprocessing result (adding thumbnail info)', error.toString())); + + } + + return next(); + + } + public static async generatePersonThumbnail(req: Request, res: Response, next: NextFunction) { if (!req.resultPipe) { return next(); diff --git a/backend/model/sql/enitites/PersonEntry.ts b/backend/model/sql/enitites/PersonEntry.ts index 8fcc921b..7cd0f4ef 100644 --- a/backend/model/sql/enitites/PersonEntry.ts +++ b/backend/model/sql/enitites/PersonEntry.ts @@ -18,4 +18,7 @@ export class PersonEntry implements PersonDTO { @OneToMany(type => FaceRegionEntry, faceRegion => faceRegion.person) public faces: FaceRegionEntry[]; + + + readyThumbnail: boolean; } diff --git a/backend/routes/PersonRouter.ts b/backend/routes/PersonRouter.ts index 49161c63..5df5026e 100644 --- a/backend/routes/PersonRouter.ts +++ b/backend/routes/PersonRouter.ts @@ -15,19 +15,28 @@ export class PersonRouter { private static addPersons(app: Express) { app.get(['/api/person'], + // common part AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.User), VersionMWs.injectGalleryVersion, + + // specific part PersonMWs.listPersons, + PersonMWs.addSamplePhotoForAll, + ThumbnailGeneratorMWs.addThumbnailInfoForPersons, + PersonMWs.removeSamplePhotoForAll, RenderingMWs.renderResult ); } private static getPersonThumbnail(app: Express) { app.get(['/api/person/:name/thumbnail'], + // common part AuthenticationMWs.authenticate, AuthenticationMWs.authorise(UserRoles.User), VersionMWs.injectGalleryVersion, + + // specific part PersonMWs.getSamplePhoto, ThumbnailGeneratorMWs.generatePersonThumbnail, RenderingMWs.renderFile diff --git a/common/entities/PersonDTO.ts b/common/entities/PersonDTO.ts index 6bcb4f4d..736eedf2 100644 --- a/common/entities/PersonDTO.ts +++ b/common/entities/PersonDTO.ts @@ -2,5 +2,21 @@ export interface PersonDTO { id: number; name: string; count: number; + readyThumbnail: boolean; } + +export class Person implements PersonDTO { + count: number; + id: number; + name: string; + readyThumbnail: boolean; + + + constructor() { + } + + public static getThumbnailUrl(that: PersonDTO): string { + return '/api/person/' + that.name + '/thumbnail'; + } +} diff --git a/frontend/app/app.component.ts b/frontend/app/app.component.ts index ec674d86..d810dd00 100644 --- a/frontend/app/app.component.ts +++ b/frontend/app/app.component.ts @@ -4,7 +4,7 @@ import {UserDTO} from '../../common/entities/UserDTO'; import {Router} from '@angular/router'; import {Config} from '../../common/config/public/Config'; import {Title} from '@angular/platform-browser'; -import {ShareService} from './gallery/share.service'; +import {ShareService} from './ui/gallery/share.service'; import 'hammerjs'; import {Subscription} from 'rxjs'; diff --git a/frontend/app/app.module.ts b/frontend/app/app.module.ts index 681c60f3..3c9e7c7a 100644 --- a/frontend/app/app.module.ts +++ b/frontend/app/app.module.ts @@ -4,80 +4,81 @@ import {FormsModule} from '@angular/forms'; import {AppComponent} from './app.component'; import {appRoutes} from './app.routing'; import {UserService} from './model/network/user.service'; -import {GalleryService} from './gallery/gallery.service'; +import {GalleryService} from './ui/gallery/gallery.service'; import {NetworkService} from './model/network/network.service'; -import {GalleryCacheService} from './gallery/cache.gallery.service'; -import {FullScreenService} from './gallery/fullscreen.service'; +import {GalleryCacheService} from './ui/gallery/cache.gallery.service'; +import {FullScreenService} from './ui/gallery/fullscreen.service'; import {AuthenticationService} from './model/network/authentication.service'; -import {UserMangerSettingsComponent} from './settings/usermanager/usermanager.settings.component'; -import {FrameComponent} from './frame/frame.component'; +import {UserMangerSettingsComponent} from './ui/settings/usermanager/usermanager.settings.component'; +import {FrameComponent} from './ui/frame/frame.component'; import {YagaModule} from '@yaga/leaflet-ng2'; -import {GalleryLightboxMediaComponent} from './gallery/lightbox/media/media.lightbox.gallery.component'; -import {GalleryPhotoLoadingComponent} from './gallery/grid/photo/loading/loading.photo.grid.gallery.component'; -import {GalleryNavigatorComponent} from './gallery/navigator/navigator.gallery.component'; -import {GallerySearchComponent} from './gallery/search/search.gallery.component'; -import {GalleryLightboxComponent} from './gallery/lightbox/lightbox.gallery.component'; -import {GalleryDirectoryComponent} from './gallery/directory/directory.gallery.component'; -import {GalleryGridComponent} from './gallery/grid/grid.gallery.component'; -import {GalleryPhotoComponent} from './gallery/grid/photo/photo.grid.gallery.component'; -import {LoginComponent} from './login/login.component'; -import {AdminComponent} from './admin/admin.component'; -import {GalleryComponent} from './gallery/gallery.component'; +import {GalleryLightboxMediaComponent} from './ui/gallery/lightbox/media/media.lightbox.gallery.component'; +import {GalleryPhotoLoadingComponent} from './ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component'; +import {GalleryNavigatorComponent} from './ui/gallery/navigator/navigator.gallery.component'; +import {GallerySearchComponent} from './ui/gallery/search/search.gallery.component'; +import {GalleryLightboxComponent} from './ui/gallery/lightbox/lightbox.gallery.component'; +import {GalleryDirectoryComponent} from './ui/gallery/directories/directory/directory.gallery.component'; +import {GalleryGridComponent} from './ui/gallery/grid/grid.gallery.component'; +import {GalleryPhotoComponent} from './ui/gallery/grid/photo/photo.grid.gallery.component'; +import {LoginComponent} from './ui/login/login.component'; +import {AdminComponent} from './ui/admin/admin.component'; +import {GalleryComponent} from './ui/gallery/gallery.component'; import {StringifyRole} from './pipes/StringifyRolePipe'; -import {GalleryMapComponent} from './gallery/map/map.gallery.component'; -import {GalleryMapLightboxComponent} from './gallery/map/lightbox/lightbox.map.gallery.component'; -import {ThumbnailManagerService} from './gallery/thumbnailManager.service'; -import {OverlayService} from './gallery/overlay.service'; +import {GalleryMapComponent} from './ui/gallery/map/map.gallery.component'; +import {GalleryMapLightboxComponent} from './ui/gallery/map/lightbox/lightbox.map.gallery.component'; +import {ThumbnailManagerService} from './ui/gallery/thumbnailManager.service'; +import {OverlayService} from './ui/gallery/overlay.service'; import {SlimLoadingBarModule} from 'ng2-slim-loading-bar'; -import {GalleryShareComponent} from './gallery/share/share.gallery.component'; -import {ShareLoginComponent} from './sharelogin/share-login.component'; -import {ShareService} from './gallery/share.service'; +import {GalleryShareComponent} from './ui/gallery/share/share.gallery.component'; +import {ShareLoginComponent} from './ui/sharelogin/share-login.component'; +import {ShareService} from './ui/gallery/share.service'; import {ModalModule} from 'ngx-bootstrap/modal'; import {BsDatepickerModule} from 'ngx-bootstrap/datepicker'; -import {DatabaseSettingsComponent} from './settings/database/database.settings.component'; +import {DatabaseSettingsComponent} from './ui/settings/database/database.settings.component'; import {ToastrModule} from 'ngx-toastr'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {NotificationService} from './model/notification.service'; import {JwBootstrapSwitchNg2Module} from 'jw-bootstrap-switch-ng2'; import {ClipboardModule} from 'ngx-clipboard'; import {NavigationService} from './model/navigation.service'; -import {InfoPanelLightboxComponent} from './gallery/lightbox/infopanel/info-panel.lightbox.gallery.component'; -import {MapSettingsComponent} from './settings/map/map.settings.component'; +import {InfoPanelLightboxComponent} from './ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component'; +import {MapSettingsComponent} from './ui/settings/map/map.settings.component'; import {TooltipModule} from 'ngx-bootstrap/tooltip'; import {BsDropdownModule} from 'ngx-bootstrap/dropdown'; import {CollapseModule} from 'ngx-bootstrap/collapse'; import {PopoverModule} from 'ngx-bootstrap/popover'; -import {ThumbnailSettingsComponent} from './settings/thumbnail/thumbanil.settings.component'; -import {SearchSettingsComponent} from './settings/search/search.settings.component'; -import {SettingsService} from './settings/settings.service'; -import {ShareSettingsComponent} from './settings/share/share.settings.component'; -import {BasicSettingsComponent} from './settings/basic/basic.settings.component'; -import {OtherSettingsComponent} from './settings/other/other.settings.component'; +import {ThumbnailSettingsComponent} from './ui/settings/thumbnail/thumbanil.settings.component'; +import {SearchSettingsComponent} from './ui/settings/search/search.settings.component'; +import {SettingsService} from './ui/settings/settings.service'; +import {ShareSettingsComponent} from './ui/settings/share/share.settings.component'; +import {BasicSettingsComponent} from './ui/settings/basic/basic.settings.component'; +import {OtherSettingsComponent} from './ui/settings/other/other.settings.component'; import {HttpClientModule} from '@angular/common/http'; import {DefaultUrlSerializer, UrlSerializer, UrlTree} from '@angular/router'; -import {IndexingSettingsComponent} from './settings/indexing/indexing.settings.component'; -import {LanguageComponent} from './language/language.component'; +import {IndexingSettingsComponent} from './ui/settings/indexing/indexing.settings.component'; +import {LanguageComponent} from './ui/language/language.component'; import {I18n} from '@ngx-translate/i18n-polyfill'; import {QueryService} from './model/query.service'; import {IconizeSortingMethod} from './pipes/IconizeSortingMethod'; import {StringifySortingMethod} from './pipes/StringifySortingMethod'; -import {RandomQueryBuilderGalleryComponent} from './gallery/random-query-builder/random-query-builder.gallery.component'; -import {RandomPhotoSettingsComponent} from './settings/random-photo/random-photo.settings.component'; -import {FixOrientationPipe} from './gallery/FixOrientationPipe'; -import {VideoSettingsComponent} from './settings/video/video.settings.component'; +import {RandomQueryBuilderGalleryComponent} from './ui/gallery/random-query-builder/random-query-builder.gallery.component'; +import {RandomPhotoSettingsComponent} from './ui/settings/random-photo/random-photo.settings.component'; +import {FixOrientationPipe} from './pipes/FixOrientationPipe'; +import {VideoSettingsComponent} from './ui/settings/video/video.settings.component'; import {DurationPipe} from './pipes/DurationPipe'; -import {MapService} from './gallery/map/map.service'; -import {MetaFileSettingsComponent} from './settings/metafiles/metafile.settings.component'; -import {ThumbnailLoaderService} from './gallery/thumbnailLoader.service'; +import {MapService} from './ui/gallery/map/map.service'; +import {MetaFileSettingsComponent} from './ui/settings/metafiles/metafile.settings.component'; +import {ThumbnailLoaderService} from './ui/gallery/thumbnailLoader.service'; import {FileSizePipe} from './pipes/FileSizePipe'; -import {DuplicateService} from './duplicates/duplicates.service'; -import {DuplicateComponent} from './duplicates/duplicates.component'; -import {DuplicatesPhotoComponent} from './duplicates/photo/photo.duplicates.component'; +import {DuplicateService} from './ui/duplicates/duplicates.service'; +import {DuplicateComponent} from './ui/duplicates/duplicates.component'; +import {DuplicatesPhotoComponent} from './ui/duplicates/photo/photo.duplicates.component'; import {SeededRandomService} from './model/seededRandom.service'; -import {FacesComponent} from './faces/faces.component'; -import {FacesService} from './faces/faces.service'; -import {FaceComponent} from './faces/face/face.component'; +import {FacesComponent} from './ui/faces/faces.component'; +import {FacesService} from './ui/faces/faces.service'; +import {FaceComponent} from './ui/faces/face/face.component'; import {VersionService} from './model/version.service'; +import { DirectoriesComponent } from './ui/gallery/directories/directories.component'; @Injectable() @@ -111,6 +112,11 @@ declare const require: (path: string) => string; export function translationsFactory(locale: string) { locale = locale || 'en'; // default to english if no locale + + // default locale, nothing to translate + if (locale === 'en') { + return ''; + } return require(`raw-loader!../translate/messages.${locale}.xlf`); } @@ -179,7 +185,8 @@ export function translationsFactory(locale: string) { StringifySortingMethod, FixOrientationPipe, DurationPipe, - FileSizePipe + FileSizePipe, + DirectoriesComponent ], providers: [ {provide: UrlSerializer, useClass: CustomUrlSerializer}, diff --git a/frontend/app/app.routing.ts b/frontend/app/app.routing.ts index 7d5853ea..af600099 100644 --- a/frontend/app/app.routing.ts +++ b/frontend/app/app.routing.ts @@ -1,12 +1,12 @@ import {ModuleWithProviders} from '@angular/core'; import {RouterModule, Routes, UrlMatchResult, UrlSegment} from '@angular/router'; -import {LoginComponent} from './login/login.component'; -import {GalleryComponent} from './gallery/gallery.component'; -import {AdminComponent} from './admin/admin.component'; -import {ShareLoginComponent} from './sharelogin/share-login.component'; +import {LoginComponent} from './ui/login/login.component'; +import {GalleryComponent} from './ui/gallery/gallery.component'; +import {AdminComponent} from './ui/admin/admin.component'; +import {ShareLoginComponent} from './ui/sharelogin/share-login.component'; import {QueryParams} from '../../common/QueryParams'; -import {DuplicateComponent} from './duplicates/duplicates.component'; -import {FacesComponent} from './faces/faces.component'; +import {DuplicateComponent} from './ui/duplicates/duplicates.component'; +import {FacesComponent} from './ui/faces/faces.component'; export function galleryMatcherFunction( segments: UrlSegment[]): UrlMatchResult | null { diff --git a/frontend/app/faces/face/face.component.ts b/frontend/app/faces/face/face.component.ts deleted file mode 100644 index 2e82dd95..00000000 --- a/frontend/app/faces/face/face.component.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {RouterLink} from '@angular/router'; -import {PersonDTO} from '../../../../common/entities/PersonDTO'; -import {SearchTypes} from '../../../../common/entities/AutoCompleteItem'; -import {DomSanitizer} from '@angular/platform-browser'; - -@Component({ - selector: 'app-face', - templateUrl: './face.component.html', - styleUrls: ['./face.component.css'], - providers: [RouterLink], -}) -export class FaceComponent { - @Input() person: PersonDTO; - - SearchTypes = SearchTypes; - - constructor(private _sanitizer: DomSanitizer) { - - } - - getSanitizedThUrl() { - return this._sanitizer.bypassSecurityTrustStyle('url(' + - encodeURI('/api/person/' + this.person.name + '/thumbnail') - .replace(/\(/g, '%28') - .replace(/'/g, '%27') - .replace(/\)/g, '%29') + ')'); - } - -} - diff --git a/frontend/app/faces/faces.component.ts b/frontend/app/faces/faces.component.ts deleted file mode 100644 index 4870a19e..00000000 --- a/frontend/app/faces/faces.component.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Component} from '@angular/core'; -import {FacesService} from './faces.service'; -import {QueryService} from '../model/query.service'; - - -@Component({ - selector: 'app-faces', - templateUrl: './faces.component.html', - styleUrls: ['./faces.component.css'] -}) -export class FacesComponent { - - - constructor(public facesService: FacesService, - public queryService: QueryService) { - this.facesService.getPersons().catch(console.error); - } - - -} - diff --git a/frontend/app/gallery/directory/directory.gallery.component.ts b/frontend/app/gallery/directory/directory.gallery.component.ts deleted file mode 100644 index 061f06dd..00000000 --- a/frontend/app/gallery/directory/directory.gallery.component.ts +++ /dev/null @@ -1,79 +0,0 @@ -import {Component, ElementRef, Input, OnDestroy, OnInit, ViewChild} from '@angular/core'; -import {DomSanitizer} from '@angular/platform-browser'; -import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; -import {RouterLink} from '@angular/router'; -import {Utils} from '../../../../common/Utils'; -import {Media} from '../Media'; -import {Thumbnail, ThumbnailManagerService} from '../thumbnailManager.service'; -import {PageHelper} from '../../model/page.helper'; -import {QueryService} from '../../model/query.service'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; - -@Component({ - selector: 'app-gallery-directory', - templateUrl: './directory.gallery.component.html', - styleUrls: ['./directory.gallery.component.css'], - providers: [RouterLink], -}) -export class GalleryDirectoryComponent implements OnInit, OnDestroy { - @Input() directory: DirectoryDTO; - @ViewChild('dirContainer') container: ElementRef; - thumbnail: Thumbnail = null; - - constructor(private thumbnailService: ThumbnailManagerService, - private _sanitizer: DomSanitizer, - public queryService: QueryService) { - - } - - size: number = null; - - public get SamplePhoto(): MediaDTO { - if (this.directory.media.length > 0) { - return this.directory.media[0]; - } - return null; - } - - getSanitizedThUrl() { - return this._sanitizer.bypassSecurityTrustStyle('url(' + - encodeURI(this.thumbnail.Src) - .replace(/\(/g, '%28') - .replace(/'/g, '%27') - .replace(/\)/g, '%29') + ')'); - } - - // TODO: implement scroll - isInView(): boolean { - return document.body.scrollTop < this.container.nativeElement.offsetTop + this.container.nativeElement.clientHeight - && document.body.scrollTop + window.innerHeight > this.container.nativeElement.offsetTop; - } - - getDirectoryPath() { - return Utils.concatUrls(this.directory.path, this.directory.name); - } - - ngOnDestroy() { - if (this.thumbnail != null) { - this.thumbnail.destroy(); - } - } - - ngOnInit() { - if (this.directory.media.length > 0) { - this.thumbnail = this.thumbnailService.getThumbnail(new Media(this.SamplePhoto, this.calcSize(), this.calcSize())); - } - } - - calcSize() { - if (this.size == null || PageHelper.isScrollYVisible()) { - const size = 220 + 5; - const containerWidth = this.container.nativeElement.parentElement.parentElement.clientWidth; - this.size = containerWidth / Math.round((containerWidth / size)); - } - return Math.floor(this.size - 5); - } - -} - diff --git a/frontend/app/model/navigation.service.ts b/frontend/app/model/navigation.service.ts index 8d89cddb..50e60249 100644 --- a/frontend/app/model/navigation.service.ts +++ b/frontend/app/model/navigation.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; import {Router} from '@angular/router'; -import {ShareService} from '../gallery/share.service'; +import {ShareService} from '../ui/gallery/share.service'; @Injectable() export class NavigationService { diff --git a/frontend/app/model/network/autehentication.service.spec.ts b/frontend/app/model/network/autehentication.service.spec.ts index 5085d79c..a8b99de0 100644 --- a/frontend/app/model/network/autehentication.service.spec.ts +++ b/frontend/app/model/network/autehentication.service.spec.ts @@ -6,7 +6,7 @@ import {AuthenticationService} from './authentication.service'; import {NetworkService} from './network.service'; import {ErrorDTO} from '../../../../common/entities/Error'; import {VersionService} from '../version.service'; -import {ShareService} from '../../gallery/share.service'; +import {ShareService} from '../../ui/gallery/share.service'; class MockUserService { public login(credential: LoginCredential): Promise { diff --git a/frontend/app/model/network/authentication.service.ts b/frontend/app/model/network/authentication.service.ts index 3b5df278..ae73d101 100644 --- a/frontend/app/model/network/authentication.service.ts +++ b/frontend/app/model/network/authentication.service.ts @@ -8,7 +8,7 @@ import {Config} from '../../../../common/config/public/Config'; import {NetworkService} from './network.service'; import {ErrorCodes, ErrorDTO} from '../../../../common/entities/Error'; import {CookieNames} from '../../../../common/CookieNames'; -import {ShareService} from '../../gallery/share.service'; +import {ShareService} from '../../ui/gallery/share.service'; declare module ServerInject { export let user: UserDTO; diff --git a/frontend/app/model/network/network.service.ts b/frontend/app/model/network/network.service.ts index 1ddbd994..b97459b1 100644 --- a/frontend/app/model/network/network.service.ts +++ b/frontend/app/model/network/network.service.ts @@ -2,7 +2,6 @@ import {Injectable} from '@angular/core'; import {HttpClient, HttpResponse} from '@angular/common/http'; import {Message} from '../../../../common/entities/Message'; import {SlimLoadingBarService} from 'ng2-slim-loading-bar'; -import 'rxjs/Rx'; import {ErrorCodes, ErrorDTO} from '../../../../common/entities/Error'; import {Config} from '../../../../common/config/public/Config'; import {Utils} from '../../../../common/Utils'; diff --git a/frontend/app/model/network/user.service.spec.ts b/frontend/app/model/network/user.service.spec.ts index 54ab5690..128a749e 100644 --- a/frontend/app/model/network/user.service.spec.ts +++ b/frontend/app/model/network/user.service.spec.ts @@ -4,7 +4,7 @@ import {NetworkService} from './network.service'; import {UserService} from './user.service'; import {LoginCredential} from '../../../../common/entities/LoginCredential'; import {SlimLoadingBarService} from 'ng2-slim-loading-bar'; -import {ShareService} from '../../gallery/share.service'; +import {ShareService} from '../../ui/gallery/share.service'; import {VersionService} from '../version.service'; class MockShareService { diff --git a/frontend/app/model/network/user.service.ts b/frontend/app/model/network/user.service.ts index 4a5cdcec..72485fe2 100644 --- a/frontend/app/model/network/user.service.ts +++ b/frontend/app/model/network/user.service.ts @@ -3,7 +3,7 @@ import {LoginCredential} from '../../../../common/entities/LoginCredential'; import {NetworkService} from './network.service'; import {UserDTO} from '../../../../common/entities/UserDTO'; import {Config} from '../../../../common/config/public/Config'; -import {ShareService} from '../../gallery/share.service'; +import {ShareService} from '../../ui/gallery/share.service'; @Injectable() export class UserService { diff --git a/frontend/app/model/query.service.ts b/frontend/app/model/query.service.ts index 224a88b3..953791cb 100644 --- a/frontend/app/model/query.service.ts +++ b/frontend/app/model/query.service.ts @@ -1,9 +1,9 @@ import {Injectable} from '@angular/core'; -import {ShareService} from '../gallery/share.service'; +import {ShareService} from '../ui/gallery/share.service'; import {MediaDTO} from '../../../common/entities/MediaDTO'; import {QueryParams} from '../../../common/QueryParams'; import {Utils} from '../../../common/Utils'; -import {GalleryService} from '../gallery/gallery.service'; +import {GalleryService} from '../ui/gallery/gallery.service'; import {Config} from '../../../common/config/public/Config'; import {DirectoryDTO} from '../../../common/entities/DirectoryDTO'; diff --git a/frontend/app/gallery/FixOrientationPipe.ts b/frontend/app/pipes/FixOrientationPipe.ts similarity index 100% rename from frontend/app/gallery/FixOrientationPipe.ts rename to frontend/app/pipes/FixOrientationPipe.ts diff --git a/frontend/app/admin/admin.component.css b/frontend/app/ui/admin/admin.component.css similarity index 100% rename from frontend/app/admin/admin.component.css rename to frontend/app/ui/admin/admin.component.css diff --git a/frontend/app/admin/admin.component.html b/frontend/app/ui/admin/admin.component.html similarity index 100% rename from frontend/app/admin/admin.component.html rename to frontend/app/ui/admin/admin.component.html diff --git a/frontend/app/admin/admin.component.ts b/frontend/app/ui/admin/admin.component.ts similarity index 75% rename from frontend/app/admin/admin.component.ts rename to frontend/app/ui/admin/admin.component.ts index 814c981f..e8027705 100644 --- a/frontend/app/admin/admin.component.ts +++ b/frontend/app/ui/admin/admin.component.ts @@ -1,9 +1,9 @@ import {Component, OnInit} from '@angular/core'; -import {AuthenticationService} from '../model/network/authentication.service'; -import {UserRoles} from '../../../common/entities/UserDTO'; -import {NotificationService} from '../model/notification.service'; -import {NotificationType} from '../../../common/entities/NotificationDTO'; -import {NavigationService} from '../model/navigation.service'; +import {AuthenticationService} from '../../model/network/authentication.service'; +import {UserRoles} from '../../../../common/entities/UserDTO'; +import {NotificationService} from '../../model/notification.service'; +import {NotificationType} from '../../../../common/entities/NotificationDTO'; +import {NavigationService} from '../../model/navigation.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; @Component({ diff --git a/frontend/app/duplicates/duplicates.component.css b/frontend/app/ui/duplicates/duplicates.component.css similarity index 100% rename from frontend/app/duplicates/duplicates.component.css rename to frontend/app/ui/duplicates/duplicates.component.css diff --git a/frontend/app/duplicates/duplicates.component.html b/frontend/app/ui/duplicates/duplicates.component.html similarity index 100% rename from frontend/app/duplicates/duplicates.component.html rename to frontend/app/ui/duplicates/duplicates.component.html diff --git a/frontend/app/duplicates/duplicates.component.ts b/frontend/app/ui/duplicates/duplicates.component.ts similarity index 91% rename from frontend/app/duplicates/duplicates.component.ts rename to frontend/app/ui/duplicates/duplicates.component.ts index 8654f8f3..daf3f2ec 100644 --- a/frontend/app/duplicates/duplicates.component.ts +++ b/frontend/app/ui/duplicates/duplicates.component.ts @@ -1,12 +1,12 @@ import {Component, HostListener, OnDestroy} from '@angular/core'; import {DuplicateService} from './duplicates.service'; -import {Utils} from '../../../common/Utils'; -import {QueryService} from '../model/query.service'; -import {DuplicatesDTO} from '../../../common/entities/DuplicatesDTO'; -import {DirectoryDTO} from '../../../common/entities/DirectoryDTO'; +import {Utils} from '../../../../common/Utils'; +import {QueryService} from '../../model/query.service'; +import {DuplicatesDTO} from '../../../../common/entities/DuplicatesDTO'; +import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; import {Subscription} from 'rxjs'; -import {Config} from '../../../common/config/public/Config'; -import {PageHelper} from '../model/page.helper'; +import {Config} from '../../../../common/config/public/Config'; +import {PageHelper} from '../../model/page.helper'; interface GroupedDuplicate { name: string; diff --git a/frontend/app/duplicates/duplicates.service.ts b/frontend/app/ui/duplicates/duplicates.service.ts similarity index 76% rename from frontend/app/duplicates/duplicates.service.ts rename to frontend/app/ui/duplicates/duplicates.service.ts index 75436894..4a98dd42 100644 --- a/frontend/app/duplicates/duplicates.service.ts +++ b/frontend/app/ui/duplicates/duplicates.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../model/network/network.service'; -import {DuplicatesDTO} from '../../../common/entities/DuplicatesDTO'; +import {NetworkService} from '../../model/network/network.service'; +import {DuplicatesDTO} from '../../../../common/entities/DuplicatesDTO'; import {BehaviorSubject} from 'rxjs'; diff --git a/frontend/app/duplicates/photo/photo.duplicates.component.css b/frontend/app/ui/duplicates/photo/photo.duplicates.component.css similarity index 100% rename from frontend/app/duplicates/photo/photo.duplicates.component.css rename to frontend/app/ui/duplicates/photo/photo.duplicates.component.css diff --git a/frontend/app/duplicates/photo/photo.duplicates.component.html b/frontend/app/ui/duplicates/photo/photo.duplicates.component.html similarity index 100% rename from frontend/app/duplicates/photo/photo.duplicates.component.html rename to frontend/app/ui/duplicates/photo/photo.duplicates.component.html diff --git a/frontend/app/duplicates/photo/photo.duplicates.component.ts b/frontend/app/ui/duplicates/photo/photo.duplicates.component.ts similarity index 88% rename from frontend/app/duplicates/photo/photo.duplicates.component.ts rename to frontend/app/ui/duplicates/photo/photo.duplicates.component.ts index 6d0abe97..0e1e4a14 100644 --- a/frontend/app/duplicates/photo/photo.duplicates.component.ts +++ b/frontend/app/ui/duplicates/photo/photo.duplicates.component.ts @@ -1,8 +1,8 @@ import {Component, Input, OnDestroy, OnInit} from '@angular/core'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; +import {MediaDTO} from '../../../../../common/entities/MediaDTO'; import {Media} from '../../gallery/Media'; import {IconThumbnail, Thumbnail, ThumbnailManagerService} from '../../gallery/thumbnailManager.service'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; import {OrientationTypes} from 'ts-exif-parser'; import {MediaIcon} from '../../gallery/MediaIcon'; diff --git a/frontend/app/faces/face/face.component.css b/frontend/app/ui/faces/face/face.component.css similarity index 100% rename from frontend/app/faces/face/face.component.css rename to frontend/app/ui/faces/face/face.component.css diff --git a/frontend/app/faces/face/face.component.html b/frontend/app/ui/faces/face/face.component.html similarity index 59% rename from frontend/app/faces/face/face.component.html rename to frontend/app/ui/faces/face/face.component.html index f08b362f..dabf7ebc 100644 --- a/frontend/app/faces/face/face.component.html +++ b/frontend/app/ui/faces/face/face.component.html @@ -4,15 +4,20 @@
+ [style.width.px]="size" + [style.height.px]="size">
- +
+ + -
+
{{person.name}} ({{person.count}})
diff --git a/frontend/app/ui/faces/face/face.component.ts b/frontend/app/ui/faces/face/face.component.ts new file mode 100644 index 00000000..ca669085 --- /dev/null +++ b/frontend/app/ui/faces/face/face.component.ts @@ -0,0 +1,46 @@ +import {Component, Input, OnDestroy, OnInit} from '@angular/core'; +import {RouterLink} from '@angular/router'; +import {PersonDTO} from '../../../../../common/entities/PersonDTO'; +import {SearchTypes} from '../../../../../common/entities/AutoCompleteItem'; +import {DomSanitizer} from '@angular/platform-browser'; +import {PersonThumbnail, ThumbnailManagerService} from '../../gallery/thumbnailManager.service'; + +@Component({ + selector: 'app-face', + templateUrl: './face.component.html', + styleUrls: ['./face.component.css'], + providers: [RouterLink], +}) +export class FaceComponent implements OnInit, OnDestroy { + @Input() person: PersonDTO; + @Input() size: number; + + thumbnail: PersonThumbnail = null; + SearchTypes = SearchTypes; + + constructor(private thumbnailService: ThumbnailManagerService, + private _sanitizer: DomSanitizer) { + + } + + ngOnInit() { + this.thumbnail = this.thumbnailService.getPersonThumbnail(this.person); + + } + + getSanitizedThUrl() { + return this._sanitizer.bypassSecurityTrustStyle('url(' + + encodeURI(this.thumbnail.Src) + .replace(/\(/g, '%28') + .replace(/'/g, '%27') + .replace(/\)/g, '%29') + ')'); + } + + ngOnDestroy() { + if (this.thumbnail != null) { + this.thumbnail.destroy(); + } + } + +} + diff --git a/frontend/app/faces/faces.component.css b/frontend/app/ui/faces/faces.component.css similarity index 100% rename from frontend/app/faces/faces.component.css rename to frontend/app/ui/faces/faces.component.css diff --git a/frontend/app/faces/faces.component.html b/frontend/app/ui/faces/faces.component.html similarity index 64% rename from frontend/app/faces/faces.component.html rename to frontend/app/ui/faces/faces.component.html index 5958364c..3e213919 100644 --- a/frontend/app/faces/faces.component.html +++ b/frontend/app/ui/faces/faces.component.html @@ -2,6 +2,7 @@
+ [person]="person" + [size]="size">
diff --git a/frontend/app/ui/faces/faces.component.ts b/frontend/app/ui/faces/faces.component.ts new file mode 100644 index 00000000..3e7de06e --- /dev/null +++ b/frontend/app/ui/faces/faces.component.ts @@ -0,0 +1,36 @@ +import {Component, ElementRef} from '@angular/core'; +import {FacesService} from './faces.service'; +import {QueryService} from '../../model/query.service'; + + +@Component({ + selector: 'app-faces', + templateUrl: './faces.component.html', + styleUrls: ['./faces.component.css'] +}) +export class FacesComponent { + + + size: number; + + constructor(public facesService: FacesService, + public queryService: QueryService, + private container: ElementRef) { + this.facesService.getPersons().catch(console.error); + } + + + ngOnChanges() { + this.updateSize(); + } + + private updateSize() { + const size = 220 + 5; + const containerWidth = this.container.nativeElement.parentElement.clientWidth; + this.size = (containerWidth / Math.round((containerWidth / size))) - 5; + console.log(containerWidth, this.size); + } + + +} + diff --git a/frontend/app/faces/faces.service.ts b/frontend/app/ui/faces/faces.service.ts similarity index 77% rename from frontend/app/faces/faces.service.ts rename to frontend/app/ui/faces/faces.service.ts index ae303c5b..a4f66a72 100644 --- a/frontend/app/faces/faces.service.ts +++ b/frontend/app/ui/faces/faces.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../model/network/network.service'; +import {NetworkService} from '../../model/network/network.service'; import {BehaviorSubject} from 'rxjs'; -import {PersonDTO} from '../../../common/entities/PersonDTO'; +import {PersonDTO} from '../../../../common/entities/PersonDTO'; @Injectable() diff --git a/frontend/app/frame/frame.component.css b/frontend/app/ui/frame/frame.component.css similarity index 100% rename from frontend/app/frame/frame.component.css rename to frontend/app/ui/frame/frame.component.css diff --git a/frontend/app/frame/frame.component.html b/frontend/app/ui/frame/frame.component.html similarity index 100% rename from frontend/app/frame/frame.component.html rename to frontend/app/ui/frame/frame.component.html diff --git a/frontend/app/frame/frame.component.ts b/frontend/app/ui/frame/frame.component.ts similarity index 75% rename from frontend/app/frame/frame.component.ts rename to frontend/app/ui/frame/frame.component.ts index 67d71349..b0fb99a2 100644 --- a/frontend/app/frame/frame.component.ts +++ b/frontend/app/ui/frame/frame.component.ts @@ -1,11 +1,11 @@ import {Component, ViewEncapsulation} from '@angular/core'; import {RouterLink} from '@angular/router'; -import {AuthenticationService} from '../model/network/authentication.service'; -import {UserDTO, UserRoles} from '../../../common/entities/UserDTO'; -import {Config} from '../../../common/config/public/Config'; +import {AuthenticationService} from '../../model/network/authentication.service'; +import {UserDTO, UserRoles} from '../../../../common/entities/UserDTO'; +import {Config} from '../../../../common/config/public/Config'; import {BehaviorSubject} from 'rxjs'; -import {NotificationService} from '../model/notification.service'; -import {QueryService} from '../model/query.service'; +import {NotificationService} from '../../model/notification.service'; +import {QueryService} from '../../model/query.service'; @Component({ selector: 'app-frame', diff --git a/frontend/app/gallery/Media.ts b/frontend/app/ui/gallery/Media.ts similarity index 91% rename from frontend/app/gallery/Media.ts rename to frontend/app/ui/gallery/Media.ts index 9a66be11..e0cb7125 100644 --- a/frontend/app/gallery/Media.ts +++ b/frontend/app/ui/gallery/Media.ts @@ -1,7 +1,7 @@ -import {Utils} from '../../../common/Utils'; +import {Utils} from '../../../../common/Utils'; import {MediaIcon} from './MediaIcon'; -import {Config} from '../../../common/config/public/Config'; -import {MediaDTO} from '../../../common/entities/MediaDTO'; +import {Config} from '../../../../common/config/public/Config'; +import {MediaDTO} from '../../../../common/entities/MediaDTO'; export class Media extends MediaIcon { diff --git a/frontend/app/gallery/MediaIcon.ts b/frontend/app/ui/gallery/MediaIcon.ts similarity index 88% rename from frontend/app/gallery/MediaIcon.ts rename to frontend/app/ui/gallery/MediaIcon.ts index c3f81160..c0e6a219 100644 --- a/frontend/app/gallery/MediaIcon.ts +++ b/frontend/app/ui/gallery/MediaIcon.ts @@ -1,6 +1,6 @@ -import {Utils} from '../../../common/Utils'; -import {Config} from '../../../common/config/public/Config'; -import {MediaDTO} from '../../../common/entities/MediaDTO'; +import {Utils} from '../../../../common/Utils'; +import {Config} from '../../../../common/config/public/Config'; +import {MediaDTO} from '../../../../common/entities/MediaDTO'; export class MediaIcon { diff --git a/frontend/app/gallery/cache.gallery.service.ts b/frontend/app/ui/gallery/cache.gallery.service.ts similarity index 93% rename from frontend/app/gallery/cache.gallery.service.ts rename to frontend/app/ui/gallery/cache.gallery.service.ts index b52af3b7..c8055b0a 100644 --- a/frontend/app/gallery/cache.gallery.service.ts +++ b/frontend/app/ui/gallery/cache.gallery.service.ts @@ -1,12 +1,12 @@ import {Injectable} from '@angular/core'; -import {DirectoryDTO} from '../../../common/entities/DirectoryDTO'; -import {Utils} from '../../../common/Utils'; -import {Config} from '../../../common/config/public/Config'; -import {AutoCompleteItem, SearchTypes} from '../../../common/entities/AutoCompleteItem'; -import {SearchResultDTO} from '../../../common/entities/SearchResultDTO'; -import {MediaDTO} from '../../../common/entities/MediaDTO'; -import {SortingMethods} from '../../../common/entities/SortingMethods'; -import {VersionService} from '../model/version.service'; +import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {Utils} from '../../../../common/Utils'; +import {Config} from '../../../../common/config/public/Config'; +import {AutoCompleteItem, SearchTypes} from '../../../../common/entities/AutoCompleteItem'; +import {SearchResultDTO} from '../../../../common/entities/SearchResultDTO'; +import {MediaDTO} from '../../../../common/entities/MediaDTO'; +import {SortingMethods} from '../../../../common/entities/SortingMethods'; +import {VersionService} from '../../model/version.service'; interface CacheItem { timestamp: number; diff --git a/frontend/app/ui/gallery/directories/directories.component.css b/frontend/app/ui/gallery/directories/directories.component.css new file mode 100644 index 00000000..b57bcb14 --- /dev/null +++ b/frontend/app/ui/gallery/directories/directories.component.css @@ -0,0 +1,4 @@ +app-gallery-directory { + margin: 2px; + display: inline-block; +} diff --git a/frontend/app/ui/gallery/directories/directories.component.html b/frontend/app/ui/gallery/directories/directories.component.html new file mode 100644 index 00000000..aac58cc4 --- /dev/null +++ b/frontend/app/ui/gallery/directories/directories.component.html @@ -0,0 +1,4 @@ + + diff --git a/frontend/app/ui/gallery/directories/directories.component.ts b/frontend/app/ui/gallery/directories/directories.component.ts new file mode 100644 index 00000000..4da8d031 --- /dev/null +++ b/frontend/app/ui/gallery/directories/directories.component.ts @@ -0,0 +1,28 @@ +import {Component, ElementRef, Input, OnChanges, OnInit} from '@angular/core'; +import {DirectoryDTO} from '../../../../../common/entities/DirectoryDTO'; + +@Component({ + selector: 'app-gallery-directories', + templateUrl: './directories.component.html', + styleUrls: ['./directories.component.css'] +}) +export class DirectoriesComponent implements OnChanges { + + @Input() directories: DirectoryDTO[]; + size: number; + + constructor(private container: ElementRef) { + } + + ngOnChanges() { + this.updateSize(); + } + + private updateSize() { + const size = 220 + 5; + const containerWidth = this.container.nativeElement.parentElement.clientWidth; + this.size = (containerWidth / Math.round((containerWidth / size))) - 5; + console.log(containerWidth, this.size); + } + +} diff --git a/frontend/app/gallery/directory/directory.gallery.component.css b/frontend/app/ui/gallery/directories/directory/directory.gallery.component.css similarity index 100% rename from frontend/app/gallery/directory/directory.gallery.component.css rename to frontend/app/ui/gallery/directories/directory/directory.gallery.component.css diff --git a/frontend/app/gallery/directory/directory.gallery.component.html b/frontend/app/ui/gallery/directories/directory/directory.gallery.component.html similarity index 65% rename from frontend/app/gallery/directory/directory.gallery.component.html rename to frontend/app/ui/gallery/directories/directory/directory.gallery.component.html index 3b7c59a2..b44eeb68 100644 --- a/frontend/app/gallery/directory/directory.gallery.component.html +++ b/frontend/app/ui/gallery/directories/directory/directory.gallery.component.html @@ -1,13 +1,13 @@ -
-
+
@@ -16,7 +16,7 @@
-
+
{{directory.name}}
diff --git a/frontend/app/ui/gallery/directories/directory/directory.gallery.component.ts b/frontend/app/ui/gallery/directories/directory/directory.gallery.component.ts new file mode 100644 index 00000000..c4b1f2b8 --- /dev/null +++ b/frontend/app/ui/gallery/directories/directory/directory.gallery.component.ts @@ -0,0 +1,84 @@ +import {Component, Input, OnDestroy, OnInit} from '@angular/core'; +import {DomSanitizer} from '@angular/platform-browser'; +import {DirectoryDTO} from '../../../../../../common/entities/DirectoryDTO'; +import {RouterLink} from '@angular/router'; +import {Utils} from '../../../../../../common/Utils'; +import {Media} from '../../Media'; +import {Thumbnail, ThumbnailManagerService} from '../../thumbnailManager.service'; +import {QueryService} from '../../../../model/query.service'; +import {MediaDTO} from '../../../../../../common/entities/MediaDTO'; +import {PhotoDTO} from '../../../../../../common/entities/PhotoDTO'; +import {OrientationTypes} from 'ts-exif-parser'; + +@Component({ + selector: 'app-gallery-directory', + templateUrl: './directory.gallery.component.html', + styleUrls: ['./directory.gallery.component.css'], + providers: [RouterLink], +}) +export class GalleryDirectoryComponent implements OnInit, OnDestroy { + @Input() directory: DirectoryDTO; + @Input() size: number; +// @ViewChild('dirContainer') container: ElementRef; + thumbnail: Thumbnail = null; + + constructor(private thumbnailService: ThumbnailManagerService, + private _sanitizer: DomSanitizer, + public queryService: QueryService) { + + } + + public get SamplePhoto(): MediaDTO { + if (this.directory.media.length > 0) { + return this.directory.media[0]; + } + return null; + } + + public get Orientation(): OrientationTypes { + return (this.SamplePhoto && (this.SamplePhoto as PhotoDTO).metadata.orientation) + || OrientationTypes.TOP_LEFT; + } + + getSanitizedThUrl() { + return this._sanitizer.bypassSecurityTrustStyle('url(' + + encodeURI(this.thumbnail.Src) + .replace(/\(/g, '%28') + .replace(/'/g, '%27') + .replace(/\)/g, '%29') + ')'); + } + + // TODO: implement scroll + /* isInView(): boolean { + return document.body.scrollTop < this.container.nativeElement.offsetTop + this.container.nativeElement.clientHeight + && document.body.scrollTop + window.innerHeight > this.container.nativeElement.offsetTop; + }*/ + + getDirectoryPath() { + return Utils.concatUrls(this.directory.path, this.directory.name); + } + + ngOnDestroy() { + if (this.thumbnail != null) { + this.thumbnail.destroy(); + } + } + + ngOnInit() { + if (this.directory.media.length > 0) { + this.thumbnail = this.thumbnailService.getThumbnail(new Media(this.SamplePhoto, this.size, this.size)); + } + } + + /* + calcSize() { + if (this.size == null || PageHelper.isScrollYVisible()) { + const size = 220 + 5; + const containerWidth = this.container.nativeElement.parentElement.parentElement.clientWidth; + this.size = containerWidth / Math.round((containerWidth / size)); + } + return Math.floor(this.size - 5); + } + */ +} + diff --git a/frontend/app/gallery/fullscreen.service.ts b/frontend/app/ui/gallery/fullscreen.service.ts similarity index 96% rename from frontend/app/gallery/fullscreen.service.ts rename to frontend/app/ui/gallery/fullscreen.service.ts index b6c6f669..15a3de00 100644 --- a/frontend/app/gallery/fullscreen.service.ts +++ b/frontend/app/ui/gallery/fullscreen.service.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import {Event} from '../../../common/event/Event'; +import {Event} from '../../../../common/event/Event'; declare const document: { fullscreenElement: any; diff --git a/frontend/app/gallery/gallery.component.css b/frontend/app/ui/gallery/gallery.component.css similarity index 94% rename from frontend/app/gallery/gallery.component.css rename to frontend/app/ui/gallery/gallery.component.css index d7d16bb8..05cc7eab 100644 --- a/frontend/app/gallery/gallery.component.css +++ b/frontend/app/ui/gallery/gallery.component.css @@ -11,10 +11,6 @@ app-gallery-map { margin-left: 2px; } -app-gallery-directory { - margin: 2px; - display: inline-block; -} .spinner { margin-top: 50px; diff --git a/frontend/app/gallery/gallery.component.html b/frontend/app/ui/gallery/gallery.component.html similarity index 87% rename from frontend/app/gallery/gallery.component.html rename to frontend/app/ui/gallery/gallery.component.html index 31082bff..a971f0d4 100644 --- a/frontend/app/gallery/gallery.component.html +++ b/frontend/app/ui/gallery/gallery.component.html @@ -30,10 +30,8 @@
-
- -
+ + @@ -52,10 +50,8 @@ [photos]="_galleryService.content.value.searchResult.media" [metaFiles]="_galleryService.content.value.searchResult.metaFile"> -
- -
+ +
diff --git a/frontend/app/gallery/gallery.component.ts b/frontend/app/ui/gallery/gallery.component.ts similarity index 87% rename from frontend/app/gallery/gallery.component.ts rename to frontend/app/ui/gallery/gallery.component.ts index 4a0546f6..c6076f26 100644 --- a/frontend/app/gallery/gallery.component.ts +++ b/frontend/app/ui/gallery/gallery.component.ts @@ -1,22 +1,22 @@ import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core'; -import {AuthenticationService} from '../model/network/authentication.service'; +import {AuthenticationService} from '../../model/network/authentication.service'; import {ActivatedRoute, Params, Router} from '@angular/router'; import {GalleryService} from './gallery.service'; import {GalleryGridComponent} from './grid/grid.gallery.component'; -import {SearchTypes} from '../../../common/entities/AutoCompleteItem'; -import {Config} from '../../../common/config/public/Config'; -import {DirectoryDTO} from '../../../common/entities/DirectoryDTO'; -import {SearchResultDTO} from '../../../common/entities/SearchResultDTO'; +import {SearchTypes} from '../../../../common/entities/AutoCompleteItem'; +import {Config} from '../../../../common/config/public/Config'; +import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {SearchResultDTO} from '../../../../common/entities/SearchResultDTO'; import {ShareService} from './share.service'; -import {NavigationService} from '../model/navigation.service'; -import {UserRoles} from '../../../common/entities/UserDTO'; +import {NavigationService} from '../../model/navigation.service'; +import {UserRoles} from '../../../../common/entities/UserDTO'; import {interval, Observable, Subscription} from 'rxjs'; -import {ContentWrapper} from '../../../common/entities/ConentWrapper'; -import {PageHelper} from '../model/page.helper'; -import {SortingMethods} from '../../../common/entities/SortingMethods'; -import {PhotoDTO} from '../../../common/entities/PhotoDTO'; -import {QueryParams} from '../../../common/QueryParams'; -import {SeededRandomService} from '../model/seededRandom.service'; +import {ContentWrapper} from '../../../../common/entities/ConentWrapper'; +import {PageHelper} from '../../model/page.helper'; +import {SortingMethods} from '../../../../common/entities/SortingMethods'; +import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; +import {QueryParams} from '../../../../common/QueryParams'; +import {SeededRandomService} from '../../model/seededRandom.service'; @Component({ selector: 'app-gallery', @@ -142,10 +142,6 @@ export class GalleryComponent implements OnInit, OnDestroy { }; private onContentChange = (content: ContentWrapper) => { - const ascdirSorter = (a: DirectoryDTO, b: DirectoryDTO) => { - return a.name.localeCompare(b.name); - }; - const tmp = (content.searchResult || content.directory || { directories: [], media: [] diff --git a/frontend/app/gallery/gallery.service.ts b/frontend/app/ui/gallery/gallery.service.ts similarity index 91% rename from frontend/app/gallery/gallery.service.ts rename to frontend/app/ui/gallery/gallery.service.ts index 1ed773c7..9b411172 100644 --- a/frontend/app/gallery/gallery.service.ts +++ b/frontend/app/ui/gallery/gallery.service.ts @@ -1,16 +1,16 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../model/network/network.service'; -import {ContentWrapper} from '../../../common/entities/ConentWrapper'; -import {DirectoryDTO} from '../../../common/entities/DirectoryDTO'; -import {SearchTypes} from '../../../common/entities/AutoCompleteItem'; +import {NetworkService} from '../../model/network/network.service'; +import {ContentWrapper} from '../../../../common/entities/ConentWrapper'; +import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {SearchTypes} from '../../../../common/entities/AutoCompleteItem'; import {GalleryCacheService} from './cache.gallery.service'; import {BehaviorSubject} from 'rxjs'; -import {SharingDTO} from '../../../common/entities/SharingDTO'; -import {Config} from '../../../common/config/public/Config'; +import {SharingDTO} from '../../../../common/entities/SharingDTO'; +import {Config} from '../../../../common/config/public/Config'; import {ShareService} from './share.service'; -import {NavigationService} from '../model/navigation.service'; -import {SortingMethods} from '../../../common/entities/SortingMethods'; -import {QueryParams} from '../../../common/QueryParams'; +import {NavigationService} from '../../model/navigation.service'; +import {SortingMethods} from '../../../../common/entities/SortingMethods'; +import {QueryParams} from '../../../../common/QueryParams'; @Injectable() diff --git a/frontend/app/gallery/grid/GridMedia.ts b/frontend/app/ui/gallery/grid/GridMedia.ts similarity index 75% rename from frontend/app/gallery/grid/GridMedia.ts rename to frontend/app/ui/gallery/grid/GridMedia.ts index 94afea1f..03d82e27 100644 --- a/frontend/app/gallery/grid/GridMedia.ts +++ b/frontend/app/ui/gallery/grid/GridMedia.ts @@ -1,8 +1,8 @@ import {Media} from '../Media'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; +import {MediaDTO} from '../../../../../common/entities/MediaDTO'; import {OrientationTypes} from 'ts-exif-parser'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; -import {VideoDTO} from '../../../../common/entities/VideoDTO'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; +import {VideoDTO} from '../../../../../common/entities/VideoDTO'; export class GridMedia extends Media { diff --git a/frontend/app/gallery/grid/GridRowBuilder.ts b/frontend/app/ui/gallery/grid/GridRowBuilder.ts similarity index 93% rename from frontend/app/gallery/grid/GridRowBuilder.ts rename to frontend/app/ui/gallery/grid/GridRowBuilder.ts index 17b76f9d..6745afea 100644 --- a/frontend/app/gallery/grid/GridRowBuilder.ts +++ b/frontend/app/ui/gallery/grid/GridRowBuilder.ts @@ -1,5 +1,5 @@ -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; +import {MediaDTO} from '../../../../../common/entities/MediaDTO'; export class GridRowBuilder { diff --git a/frontend/app/gallery/grid/grid.gallery.component.css b/frontend/app/ui/gallery/grid/grid.gallery.component.css similarity index 100% rename from frontend/app/gallery/grid/grid.gallery.component.css rename to frontend/app/ui/gallery/grid/grid.gallery.component.css diff --git a/frontend/app/gallery/grid/grid.gallery.component.html b/frontend/app/ui/gallery/grid/grid.gallery.component.html similarity index 100% rename from frontend/app/gallery/grid/grid.gallery.component.html rename to frontend/app/ui/gallery/grid/grid.gallery.component.html diff --git a/frontend/app/gallery/grid/grid.gallery.component.ts b/frontend/app/ui/gallery/grid/grid.gallery.component.ts similarity index 95% rename from frontend/app/gallery/grid/grid.gallery.component.ts rename to frontend/app/ui/gallery/grid/grid.gallery.component.ts index e60f4189..da988307 100644 --- a/frontend/app/gallery/grid/grid.gallery.component.ts +++ b/frontend/app/ui/gallery/grid/grid.gallery.component.ts @@ -12,22 +12,22 @@ import { ViewChild, ViewChildren } from '@angular/core'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; import {GridRowBuilder} from './GridRowBuilder'; import {GalleryLightboxComponent} from '../lightbox/lightbox.gallery.component'; import {GridMedia} from './GridMedia'; import {GalleryPhotoComponent} from './photo/photo.grid.gallery.component'; import {OverlayService} from '../overlay.service'; -import {Config} from '../../../../common/config/public/Config'; -import {PageHelper} from '../../model/page.helper'; +import {Config} from '../../../../../common/config/public/Config'; +import {PageHelper} from '../../../model/page.helper'; import {Subscription} from 'rxjs'; import {ActivatedRoute, Params, Router} from '@angular/router'; -import {QueryService} from '../../model/query.service'; +import {QueryService} from '../../../model/query.service'; import {GalleryService} from '../gallery.service'; -import {SortingMethods} from '../../../../common/entities/SortingMethods'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; -import {QueryParams} from '../../../../common/QueryParams'; -import {SeededRandomService} from '../../model/seededRandom.service'; +import {SortingMethods} from '../../../../../common/entities/SortingMethods'; +import {MediaDTO} from '../../../../../common/entities/MediaDTO'; +import {QueryParams} from '../../../../../common/QueryParams'; +import {SeededRandomService} from '../../../model/seededRandom.service'; @Component({ selector: 'app-gallery-grid', diff --git a/frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.css b/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.css similarity index 100% rename from frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.css rename to frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.css diff --git a/frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.html b/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.html similarity index 100% rename from frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.html rename to frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.html diff --git a/frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.ts b/frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.ts similarity index 100% rename from frontend/app/gallery/grid/photo/loading/loading.photo.grid.gallery.component.ts rename to frontend/app/ui/gallery/grid/photo/loading/loading.photo.grid.gallery.component.ts diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.css b/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.css similarity index 100% rename from frontend/app/gallery/grid/photo/photo.grid.gallery.component.css rename to frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.css diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.html b/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.html similarity index 100% rename from frontend/app/gallery/grid/photo/photo.grid.gallery.component.html rename to frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.html diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts b/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.ts similarity index 93% rename from frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts rename to frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.ts index 2a1c3c6b..1fbfd135 100644 --- a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts +++ b/frontend/app/ui/gallery/grid/photo/photo.grid.gallery.component.ts @@ -1,12 +1,12 @@ import {Component, ElementRef, Input, OnDestroy, OnInit, ViewChild} from '@angular/core'; -import {Dimension, IRenderable} from '../../../model/IRenderable'; +import {Dimension, IRenderable} from '../../../../model/IRenderable'; import {GridMedia} from '../GridMedia'; -import {SearchTypes} from '../../../../../common/entities/AutoCompleteItem'; +import {SearchTypes} from '../../../../../../common/entities/AutoCompleteItem'; import {RouterLink} from '@angular/router'; import {Thumbnail, ThumbnailManagerService} from '../../thumbnailManager.service'; -import {Config} from '../../../../../common/config/public/Config'; -import {PageHelper} from '../../../model/page.helper'; -import {PhotoDTO, PhotoMetadata} from '../../../../../common/entities/PhotoDTO'; +import {Config} from '../../../../../../common/config/public/Config'; +import {PageHelper} from '../../../../model/page.helper'; +import {PhotoDTO, PhotoMetadata} from '../../../../../../common/entities/PhotoDTO'; @Component({ selector: 'app-gallery-grid-photo', diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css b/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css similarity index 100% rename from frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css rename to frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.css diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html b/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html similarity index 100% rename from frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html rename to frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.html diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts b/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts similarity index 88% rename from frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts rename to frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts index de58a2b2..ea4a1ce4 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts +++ b/frontend/app/ui/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts @@ -1,10 +1,10 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; -import {CameraMetadata, PhotoDTO, PositionMetaData} from '../../../../../common/entities/PhotoDTO'; -import {Config} from '../../../../../common/config/public/Config'; -import {MediaDTO} from '../../../../../common/entities/MediaDTO'; -import {VideoDTO, VideoMetadata} from '../../../../../common/entities/VideoDTO'; -import {Utils} from '../../../../../common/Utils'; -import {QueryService} from '../../../model/query.service'; +import {CameraMetadata, PhotoDTO, PositionMetaData} from '../../../../../../common/entities/PhotoDTO'; +import {Config} from '../../../../../../common/config/public/Config'; +import {MediaDTO} from '../../../../../../common/entities/MediaDTO'; +import {VideoDTO, VideoMetadata} from '../../../../../../common/entities/VideoDTO'; +import {Utils} from '../../../../../../common/Utils'; +import {QueryService} from '../../../../model/query.service'; import {MapService} from '../../map/map.service'; @Component({ diff --git a/frontend/app/gallery/lightbox/inputrange.css b/frontend/app/ui/gallery/lightbox/inputrange.css similarity index 100% rename from frontend/app/gallery/lightbox/inputrange.css rename to frontend/app/ui/gallery/lightbox/inputrange.css diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.css b/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.css similarity index 100% rename from frontend/app/gallery/lightbox/lightbox.gallery.component.css rename to frontend/app/ui/gallery/lightbox/lightbox.gallery.component.css diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.html b/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.html similarity index 100% rename from frontend/app/gallery/lightbox/lightbox.gallery.component.html rename to frontend/app/ui/gallery/lightbox/lightbox.gallery.component.html diff --git a/frontend/app/gallery/lightbox/lightbox.gallery.component.ts b/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.ts similarity index 98% rename from frontend/app/gallery/lightbox/lightbox.gallery.component.ts rename to frontend/app/ui/gallery/lightbox/lightbox.gallery.component.ts index ce1c285e..de3aea12 100644 --- a/frontend/app/gallery/lightbox/lightbox.gallery.component.ts +++ b/frontend/app/ui/gallery/lightbox/lightbox.gallery.component.ts @@ -9,7 +9,7 @@ import { ViewChild } from '@angular/core'; import {GalleryPhotoComponent} from '../grid/photo/photo.grid.gallery.component'; -import {Dimension} from '../../model/IRenderable'; +import {Dimension} from '../../../model/IRenderable'; import {FullScreenService} from '../fullscreen.service'; import {OverlayService} from '../overlay.service'; import {animate, AnimationBuilder, AnimationPlayer, style} from '@angular/animations'; @@ -17,12 +17,12 @@ import {GalleryLightboxMediaComponent} from './media/media.lightbox.gallery.comp import {Observable, Subscription, timer} from 'rxjs'; import {filter} from 'rxjs/operators'; import {ActivatedRoute, Params, Router} from '@angular/router'; -import {PageHelper} from '../../model/page.helper'; -import {QueryService} from '../../model/query.service'; -import {MediaDTO} from '../../../../common/entities/MediaDTO'; -import {QueryParams} from '../../../../common/QueryParams'; +import {PageHelper} from '../../../model/page.helper'; +import {QueryService} from '../../../model/query.service'; +import {MediaDTO} from '../../../../../common/entities/MediaDTO'; +import {QueryParams} from '../../../../../common/QueryParams'; import {GalleryService} from '../gallery.service'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; export enum LightboxStates { Open = 1, diff --git a/frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.css b/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.css similarity index 100% rename from frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.css rename to frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.css diff --git a/frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.html b/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.html similarity index 100% rename from frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.html rename to frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.html diff --git a/frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.ts b/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts similarity index 97% rename from frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.ts rename to frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts index 4e80567c..921d1e6d 100644 --- a/frontend/app/gallery/lightbox/media/media.lightbox.gallery.component.ts +++ b/frontend/app/ui/gallery/lightbox/media/media.lightbox.gallery.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, Input, Output, OnChanges, ViewChild} from '@angular/core'; import {GridMedia} from '../../grid/GridMedia'; -import {FixOrientationPipe} from '../../FixOrientationPipe'; -import {MediaDTO} from '../../../../../common/entities/MediaDTO'; +import {FixOrientationPipe} from '../../../../pipes/FixOrientationPipe'; +import {MediaDTO} from '../../../../../../common/entities/MediaDTO'; import {DomSanitizer, SafeStyle} from '@angular/platform-browser'; @Component({ diff --git a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.css b/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.css similarity index 100% rename from frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.css rename to frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.css diff --git a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html b/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.html similarity index 100% rename from frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html rename to frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.html diff --git a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.ts b/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.ts similarity index 93% rename from frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.ts rename to frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.ts index e78207c7..c879622d 100644 --- a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.ts +++ b/frontend/app/ui/gallery/map/lightbox/lightbox.map.gallery.component.ts @@ -1,20 +1,20 @@ import {Component, ElementRef, HostListener, Input, OnChanges, ViewChild, AfterViewInit} from '@angular/core'; -import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; -import {Dimension} from '../../../model/IRenderable'; +import {PhotoDTO} from '../../../../../../common/entities/PhotoDTO'; +import {Dimension} from '../../../../model/IRenderable'; import {FullScreenService} from '../../fullscreen.service'; import {IconThumbnail, Thumbnail, ThumbnailManagerService} from '../../thumbnailManager.service'; import {MediaIcon} from '../../MediaIcon'; import {Media} from '../../Media'; -import {PageHelper} from '../../../model/page.helper'; +import {PageHelper} from '../../../../model/page.helper'; import {OrientationTypes} from 'ts-exif-parser'; -import {MediaDTO} from '../../../../../common/entities/MediaDTO'; -import {FileDTO} from '../../../../../common/entities/FileDTO'; -import {Utils} from '../../../../../common/Utils'; -import {Config} from '../../../../../common/config/public/Config'; +import {MediaDTO} from '../../../../../../common/entities/MediaDTO'; +import {FileDTO} from '../../../../../../common/entities/FileDTO'; +import {Utils} from '../../../../../../common/Utils'; +import {Config} from '../../../../../../common/config/public/Config'; import {MapService} from '../map.service'; import {LatLng, Point} from 'leaflet'; import {MapComponent} from '@yaga/leaflet-ng2'; -import {FixOrientationPipe} from '../../FixOrientationPipe'; +import {FixOrientationPipe} from '../../../../pipes/FixOrientationPipe'; @Component({ selector: 'app-gallery-map-lightbox', diff --git a/frontend/app/gallery/map/map.gallery.component.css b/frontend/app/ui/gallery/map/map.gallery.component.css similarity index 100% rename from frontend/app/gallery/map/map.gallery.component.css rename to frontend/app/ui/gallery/map/map.gallery.component.css diff --git a/frontend/app/gallery/map/map.gallery.component.html b/frontend/app/ui/gallery/map/map.gallery.component.html similarity index 100% rename from frontend/app/gallery/map/map.gallery.component.html rename to frontend/app/ui/gallery/map/map.gallery.component.html diff --git a/frontend/app/gallery/map/map.gallery.component.ts b/frontend/app/ui/gallery/map/map.gallery.component.ts similarity index 91% rename from frontend/app/gallery/map/map.gallery.component.ts rename to frontend/app/ui/gallery/map/map.gallery.component.ts index c65c183f..cd4d59f0 100644 --- a/frontend/app/gallery/map/map.gallery.component.ts +++ b/frontend/app/ui/gallery/map/map.gallery.component.ts @@ -1,8 +1,8 @@ import {Component, ElementRef, Input, OnChanges, ViewChild, AfterViewInit} from '@angular/core'; -import {PhotoDTO} from '../../../../common/entities/PhotoDTO'; -import {Dimension, IRenderable} from '../../model/IRenderable'; +import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; +import {Dimension, IRenderable} from '../../../model/IRenderable'; import {GalleryMapLightboxComponent} from './lightbox/lightbox.map.gallery.component'; -import {FileDTO} from '../../../../common/entities/FileDTO'; +import {FileDTO} from '../../../../../common/entities/FileDTO'; import {MapService} from './map.service'; import {MapComponent} from '@yaga/leaflet-ng2'; diff --git a/frontend/app/gallery/map/map.service.ts b/frontend/app/ui/gallery/map/map.service.ts similarity index 88% rename from frontend/app/gallery/map/map.service.ts rename to frontend/app/ui/gallery/map/map.service.ts index 2a70878c..de96b1cd 100644 --- a/frontend/app/gallery/map/map.service.ts +++ b/frontend/app/ui/gallery/map/map.service.ts @@ -1,9 +1,9 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {FileDTO} from '../../../../common/entities/FileDTO'; -import {Utils} from '../../../../common/Utils'; -import {Config} from '../../../../common/config/public/Config'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {FileDTO} from '../../../../../common/entities/FileDTO'; +import {Utils} from '../../../../../common/Utils'; +import {Config} from '../../../../../common/config/public/Config'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; @Injectable() export class MapService { diff --git a/frontend/app/gallery/navigator/navigator.gallery.component.css b/frontend/app/ui/gallery/navigator/navigator.gallery.component.css similarity index 100% rename from frontend/app/gallery/navigator/navigator.gallery.component.css rename to frontend/app/ui/gallery/navigator/navigator.gallery.component.css diff --git a/frontend/app/gallery/navigator/navigator.gallery.component.html b/frontend/app/ui/gallery/navigator/navigator.gallery.component.html similarity index 100% rename from frontend/app/gallery/navigator/navigator.gallery.component.html rename to frontend/app/ui/gallery/navigator/navigator.gallery.component.html diff --git a/frontend/app/gallery/navigator/navigator.gallery.component.ts b/frontend/app/ui/gallery/navigator/navigator.gallery.component.ts similarity index 83% rename from frontend/app/gallery/navigator/navigator.gallery.component.ts rename to frontend/app/ui/gallery/navigator/navigator.gallery.component.ts index c3f938bd..e29cc0a3 100644 --- a/frontend/app/gallery/navigator/navigator.gallery.component.ts +++ b/frontend/app/ui/gallery/navigator/navigator.gallery.component.ts @@ -1,16 +1,16 @@ import {Component, HostListener, Input, OnChanges} from '@angular/core'; -import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {DirectoryDTO} from '../../../../../common/entities/DirectoryDTO'; import {Router, RouterLink} from '@angular/router'; -import {UserDTO} from '../../../../common/entities/UserDTO'; -import {AuthenticationService} from '../../model/network/authentication.service'; +import {UserDTO} from '../../../../../common/entities/UserDTO'; +import {AuthenticationService} from '../../../model/network/authentication.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {QueryService} from '../../model/query.service'; +import {QueryService} from '../../../model/query.service'; import {GalleryService} from '../gallery.service'; -import {Utils} from '../../../../common/Utils'; -import {SortingMethods} from '../../../../common/entities/SortingMethods'; -import {Config} from '../../../../common/config/public/Config'; -import {SearchResultDTO} from '../../../../common/entities/SearchResultDTO'; -import {SearchTypes} from '../../../../common/entities/AutoCompleteItem'; +import {Utils} from '../../../../../common/Utils'; +import {SortingMethods} from '../../../../../common/entities/SortingMethods'; +import {Config} from '../../../../../common/config/public/Config'; +import {SearchResultDTO} from '../../../../../common/entities/SearchResultDTO'; +import {SearchTypes} from '../../../../../common/entities/AutoCompleteItem'; @Component({ selector: 'app-gallery-navbar', diff --git a/frontend/app/gallery/overlay.service.ts b/frontend/app/ui/gallery/overlay.service.ts similarity index 92% rename from frontend/app/gallery/overlay.service.ts rename to frontend/app/ui/gallery/overlay.service.ts index 21e01011..5ba270b4 100644 --- a/frontend/app/gallery/overlay.service.ts +++ b/frontend/app/ui/gallery/overlay.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {Event} from '../../../common/event/Event'; -import {PageHelper} from '../model/page.helper'; +import {Event} from '../../../../common/event/Event'; +import {PageHelper} from '../../model/page.helper'; @Injectable() export class OverlayService { diff --git a/frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.css b/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.css similarity index 100% rename from frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.css rename to frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.css diff --git a/frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.html b/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html similarity index 100% rename from frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.html rename to frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.html diff --git a/frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.ts b/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts similarity index 83% rename from frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.ts rename to frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts index 6f4f9810..f3da7ea7 100644 --- a/frontend/app/gallery/random-query-builder/random-query-builder.gallery.component.ts +++ b/frontend/app/ui/gallery/random-query-builder/random-query-builder.gallery.component.ts @@ -1,15 +1,15 @@ import {Component, OnDestroy, OnInit, TemplateRef} from '@angular/core'; -import {Utils} from '../../../../common/Utils'; +import {Utils} from '../../../../../common/Utils'; import {GalleryService} from '../gallery.service'; -import {ContentWrapper} from '../../../../common/entities/ConentWrapper'; -import {Config} from '../../../../common/config/public/Config'; -import {NotificationService} from '../../model/notification.service'; -import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {ContentWrapper} from '../../../../../common/entities/ConentWrapper'; +import {Config} from '../../../../../common/config/public/Config'; +import {NotificationService} from '../../../model/notification.service'; +import {DirectoryDTO} from '../../../../../common/entities/DirectoryDTO'; import {I18n} from '@ngx-translate/i18n-polyfill'; import {BsModalService} from 'ngx-bootstrap/modal'; import {BsModalRef} from 'ngx-bootstrap/modal/bs-modal-ref.service'; -import {OrientationType, RandomQueryDTO} from '../../../../common/entities/RandomQueryDTO'; -import {NetworkService} from '../../model/network/network.service'; +import {OrientationType, RandomQueryDTO} from '../../../../../common/entities/RandomQueryDTO'; +import {NetworkService} from '../../../model/network/network.service'; import {Subscription} from 'rxjs'; diff --git a/frontend/app/gallery/search/autocomplete.service.ts b/frontend/app/ui/gallery/search/autocomplete.service.ts similarity index 81% rename from frontend/app/gallery/search/autocomplete.service.ts rename to frontend/app/ui/gallery/search/autocomplete.service.ts index 271cc515..b458d582 100644 --- a/frontend/app/gallery/search/autocomplete.service.ts +++ b/frontend/app/ui/gallery/search/autocomplete.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {AutoCompleteItem} from '../../../../common/entities/AutoCompleteItem'; +import {NetworkService} from '../../../model/network/network.service'; +import {AutoCompleteItem} from '../../../../../common/entities/AutoCompleteItem'; import {GalleryCacheService} from '../cache.gallery.service'; @Injectable() diff --git a/frontend/app/gallery/search/search.gallery.component.css b/frontend/app/ui/gallery/search/search.gallery.component.css similarity index 100% rename from frontend/app/gallery/search/search.gallery.component.css rename to frontend/app/ui/gallery/search/search.gallery.component.css diff --git a/frontend/app/gallery/search/search.gallery.component.html b/frontend/app/ui/gallery/search/search.gallery.component.html similarity index 100% rename from frontend/app/gallery/search/search.gallery.component.html rename to frontend/app/ui/gallery/search/search.gallery.component.html diff --git a/frontend/app/gallery/search/search.gallery.component.ts b/frontend/app/ui/gallery/search/search.gallery.component.ts similarity index 93% rename from frontend/app/gallery/search/search.gallery.component.ts rename to frontend/app/ui/gallery/search/search.gallery.component.ts index cc2645bf..6c6815e2 100644 --- a/frontend/app/gallery/search/search.gallery.component.ts +++ b/frontend/app/ui/gallery/search/search.gallery.component.ts @@ -1,12 +1,12 @@ import {Component, OnDestroy} from '@angular/core'; import {AutoCompleteService} from './autocomplete.service'; -import {AutoCompleteItem, SearchTypes} from '../../../../common/entities/AutoCompleteItem'; +import {AutoCompleteItem, SearchTypes} from '../../../../../common/entities/AutoCompleteItem'; import {ActivatedRoute, Params, RouterLink} from '@angular/router'; import {GalleryService} from '../gallery.service'; import {Subscription} from 'rxjs'; -import {Config} from '../../../../common/config/public/Config'; -import {NavigationService} from '../../model/navigation.service'; -import {QueryParams} from '../../../../common/QueryParams'; +import {Config} from '../../../../../common/config/public/Config'; +import {NavigationService} from '../../../model/navigation.service'; +import {QueryParams} from '../../../../../common/QueryParams'; @Component({ selector: 'app-gallery-search', diff --git a/frontend/app/gallery/share.service.ts b/frontend/app/ui/gallery/share.service.ts similarity index 91% rename from frontend/app/gallery/share.service.ts rename to frontend/app/ui/gallery/share.service.ts index 525de4a0..b252daa9 100644 --- a/frontend/app/gallery/share.service.ts +++ b/frontend/app/ui/gallery/share.service.ts @@ -1,10 +1,10 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../model/network/network.service'; -import {CreateSharingDTO, SharingDTO} from '../../../common/entities/SharingDTO'; +import {NetworkService} from '../../model/network/network.service'; +import {CreateSharingDTO, SharingDTO} from '../../../../common/entities/SharingDTO'; import {Router, RoutesRecognized} from '@angular/router'; import {BehaviorSubject, Observable} from 'rxjs'; -import {QueryParams} from '../../../common/QueryParams'; -import {UserDTO} from '../../../common/entities/UserDTO'; +import {QueryParams} from '../../../../common/QueryParams'; +import {UserDTO} from '../../../../common/entities/UserDTO'; @Injectable() export class ShareService { diff --git a/frontend/app/gallery/share/share.gallery.component.css b/frontend/app/ui/gallery/share/share.gallery.component.css similarity index 100% rename from frontend/app/gallery/share/share.gallery.component.css rename to frontend/app/ui/gallery/share/share.gallery.component.css diff --git a/frontend/app/gallery/share/share.gallery.component.html b/frontend/app/ui/gallery/share/share.gallery.component.html similarity index 100% rename from frontend/app/gallery/share/share.gallery.component.html rename to frontend/app/ui/gallery/share/share.gallery.component.html diff --git a/frontend/app/gallery/share/share.gallery.component.ts b/frontend/app/ui/gallery/share/share.gallery.component.ts similarity index 89% rename from frontend/app/gallery/share/share.gallery.component.ts rename to frontend/app/ui/gallery/share/share.gallery.component.ts index 94308b9f..384ddbe9 100644 --- a/frontend/app/gallery/share/share.gallery.component.ts +++ b/frontend/app/ui/gallery/share/share.gallery.component.ts @@ -1,12 +1,12 @@ import {Component, OnDestroy, OnInit, TemplateRef} from '@angular/core'; -import {Utils} from '../../../../common/Utils'; +import {Utils} from '../../../../../common/Utils'; import {ShareService} from '../share.service'; import {GalleryService} from '../gallery.service'; -import {ContentWrapper} from '../../../../common/entities/ConentWrapper'; -import {SharingDTO} from '../../../../common/entities/SharingDTO'; -import {Config} from '../../../../common/config/public/Config'; -import {NotificationService} from '../../model/notification.service'; -import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; +import {ContentWrapper} from '../../../../../common/entities/ConentWrapper'; +import {SharingDTO} from '../../../../../common/entities/SharingDTO'; +import {Config} from '../../../../../common/config/public/Config'; +import {NotificationService} from '../../../model/notification.service'; +import {DirectoryDTO} from '../../../../../common/entities/DirectoryDTO'; import {I18n} from '@ngx-translate/i18n-polyfill'; import {BsModalService} from 'ngx-bootstrap/modal'; import {BsModalRef} from 'ngx-bootstrap/modal/bs-modal-ref.service'; diff --git a/frontend/app/gallery/thumbnailLoader.service.ts b/frontend/app/ui/gallery/thumbnailLoader.service.ts similarity index 74% rename from frontend/app/gallery/thumbnailLoader.service.ts rename to frontend/app/ui/gallery/thumbnailLoader.service.ts index 1178504c..98f9c2f6 100644 --- a/frontend/app/gallery/thumbnailLoader.service.ts +++ b/frontend/app/ui/gallery/thumbnailLoader.service.ts @@ -2,9 +2,8 @@ import {Injectable} from '@angular/core'; import {GalleryCacheService} from './cache.gallery.service'; import {Media} from './Media'; import {MediaIcon} from './MediaIcon'; -import {PhotoDTO} from '../../../common/entities/PhotoDTO'; -import {Config} from '../../../common/config/public/Config'; -import {MediaDTO} from '../../../common/entities/MediaDTO'; +import {Config} from '../../../../common/config/public/Config'; +import {Person, PersonDTO} from '../../../../common/entities/PersonDTO'; export enum ThumbnailLoadingPriority { extraHigh = 4, high = 3, medium = 2, low = 1 @@ -36,7 +35,6 @@ export class ThumbnailLoaderService { const curImg = new Image(); curImg.onload = () => { task.onLoaded(); - this.galleryCacheService.mediaUpdated(task.media); task.taskEntities.forEach((te: ThumbnailTaskEntity) => te.listener.onLoad()); this.taskReady(task); @@ -74,73 +72,71 @@ export class ThumbnailLoaderService { } - loadIcon(photo: MediaIcon, priority: ThumbnailLoadingPriority, listener: ThumbnailLoadingListener): ThumbnailTaskEntity { - let thTask: ThumbnailTask = null; - // is image already qued? - for (let i = 0; i < this.que.length; i++) { - if (this.que[i].path === photo.getIconPath()) { - thTask = this.que[i]; - break; - } - } - if (thTask == null) { - thTask = { - media: photo.media, - inProgress: false, - taskEntities: [], - onLoaded: () => { - photo.iconLoaded(); - }, - path: photo.getIconPath() - }; - this.que.push(thTask); - } - - const thumbnailTaskEntity = {priority: priority, listener: listener, parentTask: thTask}; - thTask.taskEntities.push(thumbnailTaskEntity); - if (thTask.inProgress === true) { - listener.onStartedLoading(); - } + loadIcon(media: MediaIcon, priority: ThumbnailLoadingPriority, listener: ThumbnailLoadingListener): ThumbnailTaskEntity { - setTimeout(this.run, 0); - return thumbnailTaskEntity; + return this.load(media.getIconPath(), + () => { + media.iconLoaded(); + this.galleryCacheService.mediaUpdated(media.media); + }, + priority, + listener); } loadImage(media: Media, priority: ThumbnailLoadingPriority, listener: ThumbnailLoadingListener): ThumbnailTaskEntity { + return this.load(media.getThumbnailPath(), + () => { + media.thumbnailLoaded(); + this.galleryCacheService.mediaUpdated(media.media); + }, + priority, + listener); + } + + loadPersonThumbnail(person: PersonDTO, priority: ThumbnailLoadingPriority, listener: ThumbnailLoadingListener): ThumbnailTaskEntity { + + return this.load(Person.getThumbnailUrl(person), + () => { + }, + priority, + listener); + + } + + + private load(path: string, + onLoaded: () => void, + priority: ThumbnailLoadingPriority, + listener: ThumbnailLoadingListener): ThumbnailTaskEntity { let thTask: ThumbnailTask = null; - // is image already qued? + // is image already queued? for (let i = 0; i < this.que.length; i++) { - if (this.que[i].path === media.getThumbnailPath()) { + if (this.que[i].path === path) { thTask = this.que[i]; break; } } if (thTask == null) { thTask = { - media: media.media, inProgress: false, taskEntities: [], - onLoaded: () => { - media.thumbnailLoaded(); - }, - path: media.getThumbnailPath() + onLoaded: onLoaded, + path: path }; this.que.push(thTask); } const thumbnailTaskEntity = {priority: priority, listener: listener, parentTask: thTask}; - - // add to poolTask thTask.taskEntities.push(thumbnailTaskEntity); if (thTask.inProgress === true) { listener.onStartedLoading(); } + setTimeout(this.run, 0); return thumbnailTaskEntity; - } private getNextTask(): ThumbnailTask { @@ -194,10 +190,9 @@ export interface ThumbnailTaskEntity { } interface ThumbnailTask { - media: MediaDTO; inProgress: boolean; taskEntities: Array; path: string; - onLoaded: Function; + onLoaded: () => void; } diff --git a/frontend/app/gallery/thumbnailManager.service.ts b/frontend/app/ui/gallery/thumbnailManager.service.ts similarity index 78% rename from frontend/app/gallery/thumbnailManager.service.ts rename to frontend/app/ui/gallery/thumbnailManager.service.ts index e0dc15d8..a0d1f21e 100644 --- a/frontend/app/gallery/thumbnailManager.service.ts +++ b/frontend/app/ui/gallery/thumbnailManager.service.ts @@ -2,6 +2,7 @@ import {Injectable} from '@angular/core'; import {ThumbnailLoaderService, ThumbnailLoadingListener, ThumbnailLoadingPriority, ThumbnailTaskEntity} from './thumbnailLoader.service'; import {Media} from './Media'; import {MediaIcon} from './MediaIcon'; +import {Person, PersonDTO} from '../../../../common/entities/PersonDTO'; @Injectable() @@ -19,18 +20,22 @@ export class ThumbnailManagerService { return new Thumbnail(photo, this.thumbnailLoader, false); } - public getIcon(photo: MediaIcon) { return new IconThumbnail(photo, this.thumbnailLoader); } + + + public getPersonThumbnail(person: PersonDTO): PersonThumbnail { + return new PersonThumbnail(person, this.thumbnailLoader); + } } export abstract class ThumbnailBase { + public loading = false; protected available = false; protected src: string = null; - public loading = false; protected error = false; protected onLoad: Function = null; protected thumbnailTask: ThumbnailTaskEntity = null; @@ -71,6 +76,64 @@ export abstract class ThumbnailBase { } +export class PersonThumbnail extends ThumbnailBase { + + constructor(private person: PersonDTO, thumbnailService: ThumbnailLoaderService) { + super(thumbnailService); + this.src = ''; + this.error = false; + if (this.person.readyThumbnail) { + this.src = Person.getThumbnailUrl(person); + this.available = true; + if (this.onLoad) { + this.onLoad(); + } + return; + } + + setTimeout(() => { + + const listener: ThumbnailLoadingListener = { + onStartedLoading: () => { // onLoadStarted + this.loading = true; + }, + onLoad: () => {// onLoaded + this.src = Person.getThumbnailUrl(person); + if (this.onLoad) { + this.onLoad(); + } + this.available = true; + this.loading = false; + this.thumbnailTask = null; + }, + onError: () => {// onError + this.thumbnailTask = null; + this.loading = false; + this.error = true; + } + }; + this.thumbnailTask = this.thumbnailService.loadPersonThumbnail(person, ThumbnailLoadingPriority.high, listener); + + + }, 0); + + } + + set Visible(visible: boolean) { + if (!this.thumbnailTask) { + return; + } + if (visible === true) { + this.thumbnailTask.priority = ThumbnailLoadingPriority.high; + } else { + this.thumbnailTask.priority = ThumbnailLoadingPriority.medium; + } + } + + +} + + export class IconThumbnail extends ThumbnailBase { constructor(private media: MediaIcon, thumbnailService: ThumbnailLoaderService) { diff --git a/frontend/app/language/language.component.css b/frontend/app/ui/language/language.component.css similarity index 100% rename from frontend/app/language/language.component.css rename to frontend/app/ui/language/language.component.css diff --git a/frontend/app/language/language.component.html b/frontend/app/ui/language/language.component.html similarity index 100% rename from frontend/app/language/language.component.html rename to frontend/app/ui/language/language.component.html diff --git a/frontend/app/language/language.component.ts b/frontend/app/ui/language/language.component.ts similarity index 80% rename from frontend/app/language/language.component.ts rename to frontend/app/ui/language/language.component.ts index 7d5af419..26f624cc 100644 --- a/frontend/app/language/language.component.ts +++ b/frontend/app/ui/language/language.component.ts @@ -1,7 +1,7 @@ import {Component, Input} from '@angular/core'; -import {Config} from '../../../common/config/public/Config'; +import {Config} from '../../../../common/config/public/Config'; import {Cookie} from 'ng2-cookies'; -import {CookieNames} from '../../../common/CookieNames'; +import {CookieNames} from '../../../../common/CookieNames'; @Component({ selector: 'app-language', diff --git a/frontend/app/login/login.component.css b/frontend/app/ui/login/login.component.css similarity index 100% rename from frontend/app/login/login.component.css rename to frontend/app/ui/login/login.component.css diff --git a/frontend/app/login/login.component.html b/frontend/app/ui/login/login.component.html similarity index 100% rename from frontend/app/login/login.component.html rename to frontend/app/ui/login/login.component.html diff --git a/frontend/app/login/login.component.ts b/frontend/app/ui/login/login.component.ts similarity index 73% rename from frontend/app/login/login.component.ts rename to frontend/app/ui/login/login.component.ts index 70a1b3e2..138dcf48 100644 --- a/frontend/app/login/login.component.ts +++ b/frontend/app/ui/login/login.component.ts @@ -1,9 +1,9 @@ import {Component, OnInit} from '@angular/core'; -import {LoginCredential} from '../../../common/entities/LoginCredential'; -import {AuthenticationService} from '../model/network/authentication.service'; -import {ErrorCodes} from '../../../common/entities/Error'; -import {Config} from '../../../common/config/public/Config'; -import {NavigationService} from '../model/navigation.service'; +import {LoginCredential} from '../../../../common/entities/LoginCredential'; +import {AuthenticationService} from '../../model/network/authentication.service'; +import {ErrorCodes} from '../../../../common/entities/Error'; +import {Config} from '../../../../common/config/public/Config'; +import {NavigationService} from '../../model/navigation.service'; @Component({ selector: 'app-login', diff --git a/frontend/app/settings/_abstract/abstract.settings.component.css b/frontend/app/ui/settings/_abstract/abstract.settings.component.css similarity index 100% rename from frontend/app/settings/_abstract/abstract.settings.component.css rename to frontend/app/ui/settings/_abstract/abstract.settings.component.css diff --git a/frontend/app/settings/_abstract/abstract.settings.component.ts b/frontend/app/ui/settings/_abstract/abstract.settings.component.ts similarity index 89% rename from frontend/app/settings/_abstract/abstract.settings.component.ts rename to frontend/app/ui/settings/_abstract/abstract.settings.component.ts index 8de06ef5..fb254aed 100644 --- a/frontend/app/settings/_abstract/abstract.settings.component.ts +++ b/frontend/app/ui/settings/_abstract/abstract.settings.component.ts @@ -1,12 +1,12 @@ import {Input, OnChanges, OnDestroy, OnInit, Output, ViewChild} from '@angular/core'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {UserRoles} from '../../../../common/entities/UserDTO'; -import {Utils} from '../../../../common/Utils'; -import {ErrorDTO} from '../../../../common/entities/Error'; -import {NotificationService} from '../../model/notification.service'; -import {NavigationService} from '../../model/navigation.service'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {UserRoles} from '../../../../../common/entities/UserDTO'; +import {Utils} from '../../../../../common/Utils'; +import {ErrorDTO} from '../../../../../common/entities/Error'; +import {NotificationService} from '../../../model/notification.service'; +import {NavigationService} from '../../../model/navigation.service'; import {AbstractSettingsService} from './abstract.settings.service'; -import {IPrivateConfig} from '../../../../common/config/private/IPrivateConfig'; +import {IPrivateConfig} from '../../../../../common/config/private/IPrivateConfig'; import {I18n} from '@ngx-translate/i18n-polyfill'; import {Subscription} from 'rxjs'; diff --git a/frontend/app/settings/_abstract/abstract.settings.service.ts b/frontend/app/ui/settings/_abstract/abstract.settings.service.ts similarity index 100% rename from frontend/app/settings/_abstract/abstract.settings.service.ts rename to frontend/app/ui/settings/_abstract/abstract.settings.service.ts diff --git a/frontend/app/settings/basic/basic.settings.component.css b/frontend/app/ui/settings/basic/basic.settings.component.css similarity index 100% rename from frontend/app/settings/basic/basic.settings.component.css rename to frontend/app/ui/settings/basic/basic.settings.component.css diff --git a/frontend/app/settings/basic/basic.settings.component.html b/frontend/app/ui/settings/basic/basic.settings.component.html similarity index 100% rename from frontend/app/settings/basic/basic.settings.component.html rename to frontend/app/ui/settings/basic/basic.settings.component.html diff --git a/frontend/app/settings/basic/basic.settings.component.ts b/frontend/app/ui/settings/basic/basic.settings.component.ts similarity index 86% rename from frontend/app/settings/basic/basic.settings.component.ts rename to frontend/app/ui/settings/basic/basic.settings.component.ts index bdb60ad4..58b96214 100644 --- a/frontend/app/settings/basic/basic.settings.component.ts +++ b/frontend/app/ui/settings/basic/basic.settings.component.ts @@ -1,10 +1,10 @@ import {Component} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; import {BasicSettingsService} from './basic.settings.service'; -import {BasicConfigDTO} from '../../../../common/entities/settings/BasicConfigDTO'; +import {BasicConfigDTO} from '../../../../../common/entities/settings/BasicConfigDTO'; import {I18n} from '@ngx-translate/i18n-polyfill'; @Component({ diff --git a/frontend/app/settings/basic/basic.settings.service.ts b/frontend/app/ui/settings/basic/basic.settings.service.ts similarity index 78% rename from frontend/app/settings/basic/basic.settings.service.ts rename to frontend/app/ui/settings/basic/basic.settings.service.ts index d925b0fe..19b89454 100644 --- a/frontend/app/settings/basic/basic.settings.service.ts +++ b/frontend/app/ui/settings/basic/basic.settings.service.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; +import {NetworkService} from '../../../model/network/network.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; import {SettingsService} from '../settings.service'; -import {BasicConfigDTO} from '../../../../common/entities/settings/BasicConfigDTO'; +import {BasicConfigDTO} from '../../../../../common/entities/settings/BasicConfigDTO'; @Injectable() export class BasicSettingsService extends AbstractSettingsService { diff --git a/frontend/app/settings/database/database.settings.component.css b/frontend/app/ui/settings/database/database.settings.component.css similarity index 100% rename from frontend/app/settings/database/database.settings.component.css rename to frontend/app/ui/settings/database/database.settings.component.css diff --git a/frontend/app/settings/database/database.settings.component.html b/frontend/app/ui/settings/database/database.settings.component.html similarity index 100% rename from frontend/app/settings/database/database.settings.component.html rename to frontend/app/ui/settings/database/database.settings.component.html diff --git a/frontend/app/settings/database/database.settings.component.ts b/frontend/app/ui/settings/database/database.settings.component.ts similarity index 75% rename from frontend/app/settings/database/database.settings.component.ts rename to frontend/app/ui/settings/database/database.settings.component.ts index de03a22d..4a280ee8 100644 --- a/frontend/app/settings/database/database.settings.component.ts +++ b/frontend/app/ui/settings/database/database.settings.component.ts @@ -1,9 +1,9 @@ import {Component, OnInit} from '@angular/core'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {DataBaseConfig, DatabaseType} from '../../../../common/config/private/IPrivateConfig'; -import {Utils} from '../../../../common/Utils'; -import {NotificationService} from '../../model/notification.service'; -import {NavigationService} from '../../model/navigation.service'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {DataBaseConfig, DatabaseType} from '../../../../../common/config/private/IPrivateConfig'; +import {Utils} from '../../../../../common/Utils'; +import {NotificationService} from '../../../model/notification.service'; +import {NavigationService} from '../../../model/navigation.service'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; import {DatabaseSettingsService} from './database.settings.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/database/database.settings.service.ts b/frontend/app/ui/settings/database/database.settings.service.ts similarity index 78% rename from frontend/app/settings/database/database.settings.service.ts rename to frontend/app/ui/settings/database/database.settings.service.ts index f7e7de32..551c2e57 100644 --- a/frontend/app/settings/database/database.settings.service.ts +++ b/frontend/app/ui/settings/database/database.settings.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {DataBaseConfig} from '../../../../common/config/private/IPrivateConfig'; +import {NetworkService} from '../../../model/network/network.service'; +import {DataBaseConfig} from '../../../../../common/config/private/IPrivateConfig'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; import {SettingsService} from '../settings.service'; diff --git a/frontend/app/settings/indexing/indexing.settings.component.css b/frontend/app/ui/settings/indexing/indexing.settings.component.css similarity index 100% rename from frontend/app/settings/indexing/indexing.settings.component.css rename to frontend/app/ui/settings/indexing/indexing.settings.component.css diff --git a/frontend/app/settings/indexing/indexing.settings.component.html b/frontend/app/ui/settings/indexing/indexing.settings.component.html similarity index 100% rename from frontend/app/settings/indexing/indexing.settings.component.html rename to frontend/app/ui/settings/indexing/indexing.settings.component.html diff --git a/frontend/app/settings/indexing/indexing.settings.component.ts b/frontend/app/ui/settings/indexing/indexing.settings.component.ts similarity index 91% rename from frontend/app/settings/indexing/indexing.settings.component.ts rename to frontend/app/ui/settings/indexing/indexing.settings.component.ts index 6bae8fab..8b01574d 100644 --- a/frontend/app/settings/indexing/indexing.settings.component.ts +++ b/frontend/app/ui/settings/indexing/indexing.settings.component.ts @@ -1,15 +1,15 @@ import {Component, OnDestroy, OnInit} from '@angular/core'; import {IndexingSettingsService} from './indexing.settings.service'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ErrorDTO} from '../../../../common/entities/Error'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ErrorDTO} from '../../../../../common/entities/Error'; import {interval, Observable} from 'rxjs'; -import {IndexingConfig, ReIndexingSensitivity} from '../../../../common/config/private/IPrivateConfig'; +import {IndexingConfig, ReIndexingSensitivity} from '../../../../../common/config/private/IPrivateConfig'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {Utils} from '../../../../common/Utils'; +import {Utils} from '../../../../../common/Utils'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {StatisticDTO} from '../../../../common/entities/settings/StatisticDTO'; +import {StatisticDTO} from '../../../../../common/entities/settings/StatisticDTO'; @Component({ selector: 'app-settings-indexing', diff --git a/frontend/app/settings/indexing/indexing.settings.service.ts b/frontend/app/ui/settings/indexing/indexing.settings.service.ts similarity index 77% rename from frontend/app/settings/indexing/indexing.settings.service.ts rename to frontend/app/ui/settings/indexing/indexing.settings.service.ts index a43f9a64..177907d2 100644 --- a/frontend/app/settings/indexing/indexing.settings.service.ts +++ b/frontend/app/ui/settings/indexing/indexing.settings.service.ts @@ -1,12 +1,12 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; +import {NetworkService} from '../../../model/network/network.service'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; -import {DatabaseType, IndexingConfig} from '../../../../common/config/private/IPrivateConfig'; -import {IndexingProgressDTO} from '../../../../common/entities/settings/IndexingProgressDTO'; +import {DatabaseType, IndexingConfig} from '../../../../../common/config/private/IPrivateConfig'; +import {IndexingProgressDTO} from '../../../../../common/entities/settings/IndexingProgressDTO'; import {BehaviorSubject} from 'rxjs'; -import {IndexingDTO} from '../../../../common/entities/settings/IndexingDTO'; -import {StatisticDTO} from '../../../../common/entities/settings/StatisticDTO'; +import {IndexingDTO} from '../../../../../common/entities/settings/IndexingDTO'; +import {StatisticDTO} from '../../../../../common/entities/settings/StatisticDTO'; @Injectable() export class IndexingSettingsService extends AbstractSettingsService { diff --git a/frontend/app/settings/map/map.settings.component.css b/frontend/app/ui/settings/map/map.settings.component.css similarity index 100% rename from frontend/app/settings/map/map.settings.component.css rename to frontend/app/ui/settings/map/map.settings.component.css diff --git a/frontend/app/settings/map/map.settings.component.html b/frontend/app/ui/settings/map/map.settings.component.html similarity index 100% rename from frontend/app/settings/map/map.settings.component.html rename to frontend/app/ui/settings/map/map.settings.component.html diff --git a/frontend/app/settings/map/map.settings.component.ts b/frontend/app/ui/settings/map/map.settings.component.ts similarity index 75% rename from frontend/app/settings/map/map.settings.component.ts rename to frontend/app/ui/settings/map/map.settings.component.ts index 8469b349..2bc29c3b 100644 --- a/frontend/app/settings/map/map.settings.component.ts +++ b/frontend/app/ui/settings/map/map.settings.component.ts @@ -1,12 +1,12 @@ import {Component} from '@angular/core'; import {MapSettingsService} from './map.settings.service'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {Utils} from '../../../../common/Utils'; +import {Utils} from '../../../../../common/Utils'; @Component({ diff --git a/frontend/app/settings/map/map.settings.service.ts b/frontend/app/ui/settings/map/map.settings.service.ts similarity index 79% rename from frontend/app/settings/map/map.settings.service.ts rename to frontend/app/ui/settings/map/map.settings.service.ts index 74cf58cb..08af94be 100644 --- a/frontend/app/settings/map/map.settings.service.ts +++ b/frontend/app/ui/settings/map/map.settings.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/settings/metafiles/metafile.settings.component.css b/frontend/app/ui/settings/metafiles/metafile.settings.component.css similarity index 100% rename from frontend/app/settings/metafiles/metafile.settings.component.css rename to frontend/app/ui/settings/metafiles/metafile.settings.component.css diff --git a/frontend/app/settings/metafiles/metafile.settings.component.html b/frontend/app/ui/settings/metafiles/metafile.settings.component.html similarity index 100% rename from frontend/app/settings/metafiles/metafile.settings.component.html rename to frontend/app/ui/settings/metafiles/metafile.settings.component.html diff --git a/frontend/app/settings/metafiles/metafile.settings.component.ts b/frontend/app/ui/settings/metafiles/metafile.settings.component.ts similarity index 75% rename from frontend/app/settings/metafiles/metafile.settings.component.ts rename to frontend/app/ui/settings/metafiles/metafile.settings.component.ts index 351cfe67..1314af50 100644 --- a/frontend/app/settings/metafiles/metafile.settings.component.ts +++ b/frontend/app/ui/settings/metafiles/metafile.settings.component.ts @@ -1,10 +1,10 @@ import {Component} from '@angular/core'; import {MetaFileSettingsService} from './metafile.settings.service'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/metafiles/metafile.settings.service.ts b/frontend/app/ui/settings/metafiles/metafile.settings.service.ts similarity index 82% rename from frontend/app/settings/metafiles/metafile.settings.service.ts rename to frontend/app/ui/settings/metafiles/metafile.settings.service.ts index 78ae8969..cbfdca7b 100644 --- a/frontend/app/settings/metafiles/metafile.settings.service.ts +++ b/frontend/app/ui/settings/metafiles/metafile.settings.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/settings/other/other.settings.component.css b/frontend/app/ui/settings/other/other.settings.component.css similarity index 100% rename from frontend/app/settings/other/other.settings.component.css rename to frontend/app/ui/settings/other/other.settings.component.css diff --git a/frontend/app/settings/other/other.settings.component.html b/frontend/app/ui/settings/other/other.settings.component.html similarity index 100% rename from frontend/app/settings/other/other.settings.component.html rename to frontend/app/ui/settings/other/other.settings.component.html diff --git a/frontend/app/settings/other/other.settings.component.ts b/frontend/app/ui/settings/other/other.settings.component.ts similarity index 77% rename from frontend/app/settings/other/other.settings.component.ts rename to frontend/app/ui/settings/other/other.settings.component.ts index 8168f10b..a36e369c 100644 --- a/frontend/app/settings/other/other.settings.component.ts +++ b/frontend/app/ui/settings/other/other.settings.component.ts @@ -1,13 +1,13 @@ import {Component, OnChanges} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; import {OtherSettingsService} from './other.settings.service'; -import {OtherConfigDTO} from '../../../../common/entities/settings/OtherConfigDTO'; +import {OtherConfigDTO} from '../../../../../common/entities/settings/OtherConfigDTO'; import {I18n} from '@ngx-translate/i18n-polyfill'; -import {Utils} from '../../../../common/Utils'; -import {SortingMethods} from '../../../../common/entities/SortingMethods'; +import {Utils} from '../../../../../common/Utils'; +import {SortingMethods} from '../../../../../common/entities/SortingMethods'; @Component({ selector: 'app-settings-other', diff --git a/frontend/app/settings/other/other.settings.service.ts b/frontend/app/ui/settings/other/other.settings.service.ts similarity index 78% rename from frontend/app/settings/other/other.settings.service.ts rename to frontend/app/ui/settings/other/other.settings.service.ts index aa396cfb..da472bf2 100644 --- a/frontend/app/settings/other/other.settings.service.ts +++ b/frontend/app/ui/settings/other/other.settings.service.ts @@ -1,8 +1,8 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; +import {NetworkService} from '../../../model/network/network.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; import {SettingsService} from '../settings.service'; -import {OtherConfigDTO} from '../../../../common/entities/settings/OtherConfigDTO'; +import {OtherConfigDTO} from '../../../../../common/entities/settings/OtherConfigDTO'; @Injectable() export class OtherSettingsService extends AbstractSettingsService { diff --git a/frontend/app/settings/random-photo/random-photo.settings.component.css b/frontend/app/ui/settings/random-photo/random-photo.settings.component.css similarity index 100% rename from frontend/app/settings/random-photo/random-photo.settings.component.css rename to frontend/app/ui/settings/random-photo/random-photo.settings.component.css diff --git a/frontend/app/settings/random-photo/random-photo.settings.component.html b/frontend/app/ui/settings/random-photo/random-photo.settings.component.html similarity index 100% rename from frontend/app/settings/random-photo/random-photo.settings.component.html rename to frontend/app/ui/settings/random-photo/random-photo.settings.component.html diff --git a/frontend/app/settings/random-photo/random-photo.settings.component.ts b/frontend/app/ui/settings/random-photo/random-photo.settings.component.ts similarity index 76% rename from frontend/app/settings/random-photo/random-photo.settings.component.ts rename to frontend/app/ui/settings/random-photo/random-photo.settings.component.ts index c41d6dd0..f60d0eaa 100644 --- a/frontend/app/settings/random-photo/random-photo.settings.component.ts +++ b/frontend/app/ui/settings/random-photo/random-photo.settings.component.ts @@ -1,9 +1,9 @@ import {Component} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {RandomPhotoSettingsService} from './random-photo.settings.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/random-photo/random-photo.settings.service.ts b/frontend/app/ui/settings/random-photo/random-photo.settings.service.ts similarity index 77% rename from frontend/app/settings/random-photo/random-photo.settings.service.ts rename to frontend/app/ui/settings/random-photo/random-photo.settings.service.ts index b24dbd38..325cad04 100644 --- a/frontend/app/settings/random-photo/random-photo.settings.service.ts +++ b/frontend/app/ui/settings/random-photo/random-photo.settings.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {DatabaseType} from '../../../../common/config/private/IPrivateConfig'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {DatabaseType} from '../../../../../common/config/private/IPrivateConfig'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/settings/search/search.settings.component.css b/frontend/app/ui/settings/search/search.settings.component.css similarity index 100% rename from frontend/app/settings/search/search.settings.component.css rename to frontend/app/ui/settings/search/search.settings.component.css diff --git a/frontend/app/settings/search/search.settings.component.html b/frontend/app/ui/settings/search/search.settings.component.html similarity index 100% rename from frontend/app/settings/search/search.settings.component.html rename to frontend/app/ui/settings/search/search.settings.component.html diff --git a/frontend/app/settings/search/search.settings.component.ts b/frontend/app/ui/settings/search/search.settings.component.ts similarity index 75% rename from frontend/app/settings/search/search.settings.component.ts rename to frontend/app/ui/settings/search/search.settings.component.ts index 9ee42d2f..b32aae03 100644 --- a/frontend/app/settings/search/search.settings.component.ts +++ b/frontend/app/ui/settings/search/search.settings.component.ts @@ -1,9 +1,9 @@ import {Component} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SearchSettingsService} from './search.settings.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/search/search.settings.service.ts b/frontend/app/ui/settings/search/search.settings.service.ts similarity index 75% rename from frontend/app/settings/search/search.settings.service.ts rename to frontend/app/ui/settings/search/search.settings.service.ts index 0b5e4f5b..9d81017f 100644 --- a/frontend/app/settings/search/search.settings.service.ts +++ b/frontend/app/ui/settings/search/search.settings.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {DatabaseType} from '../../../../common/config/private/IPrivateConfig'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {DatabaseType} from '../../../../../common/config/private/IPrivateConfig'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/settings/settings.service.ts b/frontend/app/ui/settings/settings.service.ts similarity index 89% rename from frontend/app/settings/settings.service.ts rename to frontend/app/ui/settings/settings.service.ts index bce79598..1f15486e 100644 --- a/frontend/app/settings/settings.service.ts +++ b/frontend/app/ui/settings/settings.service.ts @@ -7,11 +7,11 @@ import { ReIndexingSensitivity, SQLLogLevel, ThumbnailProcessingLib -} from '../../../common/config/private/IPrivateConfig'; -import {NetworkService} from '../model/network/network.service'; -import {SortingMethods} from '../../../common/entities/SortingMethods'; -import {UserRoles} from '../../../common/entities/UserDTO'; -import {ClientConfig} from '../../../common/config/public/ConfigClass'; +} from '../../../../common/config/private/IPrivateConfig'; +import {NetworkService} from '../../model/network/network.service'; +import {SortingMethods} from '../../../../common/entities/SortingMethods'; +import {UserRoles} from '../../../../common/entities/UserDTO'; +import {ClientConfig} from '../../../../common/config/public/ConfigClass'; @Injectable() export class SettingsService { diff --git a/frontend/app/settings/share/share.settings.component.css b/frontend/app/ui/settings/share/share.settings.component.css similarity index 100% rename from frontend/app/settings/share/share.settings.component.css rename to frontend/app/ui/settings/share/share.settings.component.css diff --git a/frontend/app/settings/share/share.settings.component.html b/frontend/app/ui/settings/share/share.settings.component.html similarity index 100% rename from frontend/app/settings/share/share.settings.component.html rename to frontend/app/ui/settings/share/share.settings.component.html diff --git a/frontend/app/settings/share/share.settings.component.ts b/frontend/app/ui/settings/share/share.settings.component.ts similarity index 75% rename from frontend/app/settings/share/share.settings.component.ts rename to frontend/app/ui/settings/share/share.settings.component.ts index c27631aa..be39f350 100644 --- a/frontend/app/settings/share/share.settings.component.ts +++ b/frontend/app/ui/settings/share/share.settings.component.ts @@ -1,9 +1,9 @@ import {Component} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {ShareSettingsService} from './share.settings.service'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/share/share.settings.service.ts b/frontend/app/ui/settings/share/share.settings.service.ts similarity index 77% rename from frontend/app/settings/share/share.settings.service.ts rename to frontend/app/ui/settings/share/share.settings.service.ts index 338c267a..5713c96d 100644 --- a/frontend/app/settings/share/share.settings.service.ts +++ b/frontend/app/ui/settings/share/share.settings.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {DatabaseType} from '../../../../common/config/private/IPrivateConfig'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {DatabaseType} from '../../../../../common/config/private/IPrivateConfig'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/settings/thumbnail/thumbanil.settings.component.css b/frontend/app/ui/settings/thumbnail/thumbanil.settings.component.css similarity index 100% rename from frontend/app/settings/thumbnail/thumbanil.settings.component.css rename to frontend/app/ui/settings/thumbnail/thumbanil.settings.component.css diff --git a/frontend/app/settings/thumbnail/thumbanil.settings.component.html b/frontend/app/ui/settings/thumbnail/thumbanil.settings.component.html similarity index 100% rename from frontend/app/settings/thumbnail/thumbanil.settings.component.html rename to frontend/app/ui/settings/thumbnail/thumbanil.settings.component.html diff --git a/frontend/app/settings/thumbnail/thumbanil.settings.component.ts b/frontend/app/ui/settings/thumbnail/thumbanil.settings.component.ts similarity index 83% rename from frontend/app/settings/thumbnail/thumbanil.settings.component.ts rename to frontend/app/ui/settings/thumbnail/thumbanil.settings.component.ts index e17e79d5..7cb05595 100644 --- a/frontend/app/settings/thumbnail/thumbanil.settings.component.ts +++ b/frontend/app/ui/settings/thumbnail/thumbanil.settings.component.ts @@ -1,12 +1,12 @@ import {Component, OnInit} from '@angular/core'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ThumbnailConfig, ThumbnailProcessingLib} from '../../../../common/config/private/IPrivateConfig'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ThumbnailConfig, ThumbnailProcessingLib} from '../../../../../common/config/private/IPrivateConfig'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {ThumbnailSettingsService} from './thumbanil.settings.service'; -import {Utils} from '../../../../common/Utils'; +import {Utils} from '../../../../../common/Utils'; import {I18n} from '@ngx-translate/i18n-polyfill'; @Component({ diff --git a/frontend/app/settings/thumbnail/thumbanil.settings.service.ts b/frontend/app/ui/settings/thumbnail/thumbanil.settings.service.ts similarity index 74% rename from frontend/app/settings/thumbnail/thumbanil.settings.service.ts rename to frontend/app/ui/settings/thumbnail/thumbanil.settings.service.ts index af8a0639..d6276918 100644 --- a/frontend/app/settings/thumbnail/thumbanil.settings.service.ts +++ b/frontend/app/ui/settings/thumbnail/thumbanil.settings.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; -import {ThumbnailConfig} from '../../../../common/config/private/IPrivateConfig'; +import {NetworkService} from '../../../model/network/network.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; +import {ThumbnailConfig} from '../../../../../common/config/private/IPrivateConfig'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; import {SettingsService} from '../settings.service'; diff --git a/frontend/app/settings/usermanager/usermanager.settings.component.css b/frontend/app/ui/settings/usermanager/usermanager.settings.component.css similarity index 100% rename from frontend/app/settings/usermanager/usermanager.settings.component.css rename to frontend/app/ui/settings/usermanager/usermanager.settings.component.css diff --git a/frontend/app/settings/usermanager/usermanager.settings.component.html b/frontend/app/ui/settings/usermanager/usermanager.settings.component.html similarity index 100% rename from frontend/app/settings/usermanager/usermanager.settings.component.html rename to frontend/app/ui/settings/usermanager/usermanager.settings.component.html diff --git a/frontend/app/settings/usermanager/usermanager.settings.component.ts b/frontend/app/ui/settings/usermanager/usermanager.settings.component.ts similarity index 90% rename from frontend/app/settings/usermanager/usermanager.settings.component.ts rename to frontend/app/ui/settings/usermanager/usermanager.settings.component.ts index a4ce0d22..de44b4f3 100644 --- a/frontend/app/settings/usermanager/usermanager.settings.component.ts +++ b/frontend/app/ui/settings/usermanager/usermanager.settings.component.ts @@ -1,12 +1,12 @@ import {Component, OnInit, ViewChild} from '@angular/core'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {UserDTO, UserRoles} from '../../../../common/entities/UserDTO'; -import {Utils} from '../../../../common/Utils'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {UserDTO, UserRoles} from '../../../../../common/entities/UserDTO'; +import {Utils} from '../../../../../common/Utils'; import {UserManagerSettingsService} from './usermanager.settings.service'; import {ModalDirective} from 'ngx-bootstrap/modal'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ErrorCodes, ErrorDTO} from '../../../../common/entities/Error'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ErrorCodes, ErrorDTO} from '../../../../../common/entities/Error'; import {I18n} from '@ngx-translate/i18n-polyfill'; @Component({ diff --git a/frontend/app/settings/usermanager/usermanager.settings.service.ts b/frontend/app/ui/settings/usermanager/usermanager.settings.service.ts similarity index 81% rename from frontend/app/settings/usermanager/usermanager.settings.service.ts rename to frontend/app/ui/settings/usermanager/usermanager.settings.service.ts index 2ae3b6d2..75a41128 100644 --- a/frontend/app/settings/usermanager/usermanager.settings.service.ts +++ b/frontend/app/ui/settings/usermanager/usermanager.settings.service.ts @@ -1,7 +1,7 @@ import {Injectable} from '@angular/core'; -import {UserDTO} from '../../../../common/entities/UserDTO'; -import {NetworkService} from '../../model/network/network.service'; -import {IPrivateConfig} from '../../../../common/config/private/IPrivateConfig'; +import {UserDTO} from '../../../../../common/entities/UserDTO'; +import {NetworkService} from '../../../model/network/network.service'; +import {IPrivateConfig} from '../../../../../common/config/private/IPrivateConfig'; @Injectable() export class UserManagerSettingsService { diff --git a/frontend/app/settings/video/video.settings.component.css b/frontend/app/ui/settings/video/video.settings.component.css similarity index 100% rename from frontend/app/settings/video/video.settings.component.css rename to frontend/app/ui/settings/video/video.settings.component.css diff --git a/frontend/app/settings/video/video.settings.component.html b/frontend/app/ui/settings/video/video.settings.component.html similarity index 100% rename from frontend/app/settings/video/video.settings.component.html rename to frontend/app/ui/settings/video/video.settings.component.html diff --git a/frontend/app/settings/video/video.settings.component.ts b/frontend/app/ui/settings/video/video.settings.component.ts similarity index 75% rename from frontend/app/settings/video/video.settings.component.ts rename to frontend/app/ui/settings/video/video.settings.component.ts index 3906e504..428ff11e 100644 --- a/frontend/app/settings/video/video.settings.component.ts +++ b/frontend/app/ui/settings/video/video.settings.component.ts @@ -1,10 +1,10 @@ import {Component} from '@angular/core'; import {VideoSettingsService} from './video.settings.service'; import {SettingsComponent} from '../_abstract/abstract.settings.component'; -import {AuthenticationService} from '../../model/network/authentication.service'; -import {NavigationService} from '../../model/navigation.service'; -import {NotificationService} from '../../model/notification.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {AuthenticationService} from '../../../model/network/authentication.service'; +import {NavigationService} from '../../../model/navigation.service'; +import {NotificationService} from '../../../model/notification.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {I18n} from '@ngx-translate/i18n-polyfill'; diff --git a/frontend/app/settings/video/video.settings.service.ts b/frontend/app/ui/settings/video/video.settings.service.ts similarity index 79% rename from frontend/app/settings/video/video.settings.service.ts rename to frontend/app/ui/settings/video/video.settings.service.ts index 0b6d73a7..a055f1fa 100644 --- a/frontend/app/settings/video/video.settings.service.ts +++ b/frontend/app/ui/settings/video/video.settings.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; -import {NetworkService} from '../../model/network/network.service'; -import {ClientConfig} from '../../../../common/config/public/ConfigClass'; +import {NetworkService} from '../../../model/network/network.service'; +import {ClientConfig} from '../../../../../common/config/public/ConfigClass'; import {SettingsService} from '../settings.service'; import {AbstractSettingsService} from '../_abstract/abstract.settings.service'; diff --git a/frontend/app/sharelogin/share-login.component.css b/frontend/app/ui/sharelogin/share-login.component.css similarity index 100% rename from frontend/app/sharelogin/share-login.component.css rename to frontend/app/ui/sharelogin/share-login.component.css diff --git a/frontend/app/sharelogin/share-login.component.html b/frontend/app/ui/sharelogin/share-login.component.html similarity index 100% rename from frontend/app/sharelogin/share-login.component.html rename to frontend/app/ui/sharelogin/share-login.component.html diff --git a/frontend/app/sharelogin/share-login.component.ts b/frontend/app/ui/sharelogin/share-login.component.ts similarity index 75% rename from frontend/app/sharelogin/share-login.component.ts rename to frontend/app/ui/sharelogin/share-login.component.ts index 3ec16860..a5d22b70 100644 --- a/frontend/app/sharelogin/share-login.component.ts +++ b/frontend/app/ui/sharelogin/share-login.component.ts @@ -1,8 +1,8 @@ import {Component, OnInit} from '@angular/core'; -import {AuthenticationService} from '../model/network/authentication.service'; -import {ErrorCodes} from '../../../common/entities/Error'; -import {Config} from '../../../common/config/public/Config'; -import {NavigationService} from '../model/navigation.service'; +import {AuthenticationService} from '../../model/network/authentication.service'; +import {ErrorCodes} from '../../../../common/entities/Error'; +import {Config} from '../../../../common/config/public/Config'; +import {NavigationService} from '../../model/navigation.service'; @Component({ selector: 'app-share-login', diff --git a/package.json b/package.json index cd46f050..45f08532 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "test": "ng test && mocha --recursive test/backend/unit && mocha --recursive test/backend/integration && mocha --recursive test/common/unit ", "start": "node ./backend/index", "run-dev": "ng build --aot --watch --output-path=./dist --i18n-locale en --i18n-file frontend/translate/messages.en.xlf --i18n-missing-translation warning", + "build-stats": "ng build --aot --prod --stats-json --output-path=./dist --i18n-locale en --i18n-file frontend/translate/messages.en.xlf --i18n-missing-translation warning", "update-translation": "gulp update-translation", "add-translation": "gulp add-translation" }, @@ -123,7 +124,8 @@ "zone.js": "0.8.29" }, "//": [ - "TODO: remove terser version lock once webpack is fixed" + "TODO: remove terser version lock once webpack is fixed", + "TODO: check i18n-pollify once angular 8 is out" ], "resolutions": { "natives": "1.1.3"