diff --git a/backend/middlewares/GalleryMWs.ts b/backend/middlewares/GalleryMWs.ts index ad4ee213..cf91c504 100644 --- a/backend/middlewares/GalleryMWs.ts +++ b/backend/middlewares/GalleryMWs.ts @@ -72,7 +72,6 @@ export class GalleryMWs { } let type:SearchTypes; - console.log() if (req.query.type) { type = parseInt(req.query.type); } diff --git a/backend/routes/GalleryRouter.ts b/backend/routes/GalleryRouter.ts index 5aa578d6..97f09042 100644 --- a/backend/routes/GalleryRouter.ts +++ b/backend/routes/GalleryRouter.ts @@ -44,15 +44,15 @@ export class GalleryRouter { }; private addSearch() { - this.app.get("/api/gallery/search/:text", - // AuthenticationMWs.authenticate, + this.app.get("/api/search/:text", + AuthenticationMWs.authenticate, GalleryMWs.search, RenderingMWs.renderResult ); }; private addInstantSearch() { - this.app.get("/api/gallery/instant-search/:text", + this.app.get("/api/instant-search/:text", AuthenticationMWs.authenticate, GalleryMWs.instantSearch, RenderingMWs.renderResult @@ -60,7 +60,7 @@ export class GalleryRouter { }; private addAutoComplete() { - this.app.get("/api/gallery/autocomplete/:text", + this.app.get("/api/autocomplete/:text", AuthenticationMWs.authenticate, GalleryMWs.autocomplete, RenderingMWs.renderResult diff --git a/frontend/app/gallery/gallery.service.ts b/frontend/app/gallery/gallery.service.ts index 7c546b6a..c6bf4747 100644 --- a/frontend/app/gallery/gallery.service.ts +++ b/frontend/app/gallery/gallery.service.ts @@ -40,7 +40,7 @@ export class GalleryService { return Promise.resolve(new Message(null, null)); } - let queryString = "/gallery/search/" + text; + let queryString = "/search/" + text; if (type) { queryString += "?type=" + type; } @@ -72,7 +72,7 @@ export class GalleryService { this.searchId = null; }, 3000); //TODO: set timeout to config - return this._networkService.getJson("/gallery/instant-search/" + text).then( + return this._networkService.getJson("/instant-search/" + text).then( (message:Message) => { if (!message.error && message.result) { this.content = message.result; diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.html b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.html index 570120f1..b65f5f0e 100644 --- a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.html +++ b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.html @@ -5,16 +5,21 @@
- - {{getPositionText()}} - +
diff --git a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts index 53b8e428..ea3c77d2 100644 --- a/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts +++ b/frontend/app/gallery/grid/photo/photo.grid.gallery.component.ts @@ -5,6 +5,7 @@ import {IRenderable, Dimension} from "../../../model/IRenderable"; import {GridPhoto} from "../GridPhoto"; import {SearchTypes} from "../../../../../common/entities/AutoCompleteItem"; import {RouterLink} from "@angular/router-deprecated"; +import {Config} from "../../../config/Config"; @Component({ selector: 'gallery-grid-photo', @@ -22,9 +23,11 @@ export class GalleryPhotoComponent implements IRenderable { background: "" }; SearchTypes:any = []; + searchEnabled:boolean = true; constructor() { this.SearchTypes = SearchTypes; + this.searchEnabled = Config.Client.Search.searchEnabled; } getPositionText():string { diff --git a/frontend/app/gallery/search/autocomplete.service.ts b/frontend/app/gallery/search/autocomplete.service.ts index 0ba34b7d..b2ce3300 100644 --- a/frontend/app/gallery/search/autocomplete.service.ts +++ b/frontend/app/gallery/search/autocomplete.service.ts @@ -13,7 +13,7 @@ export class AutoCompleteService { } public autoComplete(text:string):Promise >> { - return this._networkService.getJson("/gallery/autocomplete/" + text); + return this._networkService.getJson("/autocomplete/" + text); }