From 0b5d3b86c43e8d53c76562763659e0e3e5831563 Mon Sep 17 00:00:00 2001 From: Patrik Braun Date: Fri, 21 Jul 2017 19:33:24 +0200 Subject: [PATCH] removing todo-s minor bug fix --- common/config/public/ConfigClass.ts | 4 +++- frontend/app/gallery/gallery.service.ts | 2 +- frontend/app/gallery/grid/grid.gallery.component.ts | 2 -- .../infopanel/info-panel.lightbox.gallery.component.ts | 3 +-- frontend/app/model/network/network.service.ts | 2 -- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/common/config/public/ConfigClass.ts b/common/config/public/ConfigClass.ts index f1d6ff11..9d68ceca 100644 --- a/common/config/public/ConfigClass.ts +++ b/common/config/public/ConfigClass.ts @@ -3,6 +3,7 @@ export module ClientConfig { enabled: boolean instantSearchEnabled: boolean autocompleteEnabled: boolean + InstantSearchTimeout: number; } export interface SharingConfig { @@ -48,7 +49,8 @@ export class PublicConfigClass { Search: { enabled: true, instantSearchEnabled: true, - autocompleteEnabled: true + autocompleteEnabled: true, + InstantSearchTimeout: 3000 }, Sharing: { enabled: true, diff --git a/frontend/app/gallery/gallery.service.ts b/frontend/app/gallery/gallery.service.ts index d884258b..40d53d01 100644 --- a/frontend/app/gallery/gallery.service.ts +++ b/frontend/app/gallery/gallery.service.ts @@ -104,7 +104,7 @@ export class GalleryService { this.searchId = setTimeout(() => { this.search(text); this.searchId = null; - }, 3000); //TODO: set timeout to config + }, Config.Client.Search.InstantSearchTimeout); //TODO: set timeout to config const cw = await this.networkService.getJson("/instant-search/" + text); this.content.next(cw); diff --git a/frontend/app/gallery/grid/grid.gallery.component.ts b/frontend/app/gallery/grid/grid.gallery.component.ts index 04aecccd..80c2032a 100644 --- a/frontend/app/gallery/grid/grid.gallery.component.ts +++ b/frontend/app/gallery/grid/grid.gallery.component.ts @@ -87,8 +87,6 @@ export class GalleryGridComponent implements OnChanges, AfterViewInit, OnDestroy ngAfterViewInit() { this.lightbox.setGridPhotoQL(this.gridPhotoQL); - //TODO: implement scroll detection - this.updateContainerWidth(); this.sortPhotos(); diff --git a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts index b4d3445c..2fdc905f 100644 --- a/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts +++ b/frontend/app/gallery/lightbox/infopanel/info-panel.lightbox.gallery.component.ts @@ -48,8 +48,7 @@ export class InfoPanelLightboxComponent { getTime() { const date = new Date(this.photo.metadata.creationDate); - //TODO: pad with zeros - return date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + return date.toTimeString().split(' ')[0]; } getDay() { diff --git a/frontend/app/model/network/network.service.ts b/frontend/app/model/network/network.service.ts index 9fdddad9..178d661c 100644 --- a/frontend/app/model/network/network.service.ts +++ b/frontend/app/model/network/network.service.ts @@ -21,7 +21,6 @@ export class NetworkService { let headers = new Headers({'Content-Type': 'application/json'}); let options = new RequestOptions({headers: headers}); - //TODO handle long loading time this.slimLoadingBarService.visible = true; this.slimLoadingBarService.start(() => { this.slimLoadingBarService.visible = false; @@ -94,7 +93,6 @@ export class NetworkService { } return Promise.reject(error); } - // TODO: in a real world app do something better // instead of just logging it to the console console.error(error); return Promise.reject(error.message || error || 'Server error');