1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fixing atocomplete/ "." searching error, by disabling it.

This commit is contained in:
Patrik J. Braun 2021-04-19 15:01:28 +02:00
parent 7340246d2d
commit 6810c7a24a
4 changed files with 21 additions and 13 deletions

View File

@ -93,6 +93,18 @@
"replace": "src/frontend/environments/environment.ts", "replace": "src/frontend/environments/environment.ts",
"with": "src/frontend/environments/environment.prod.ts" "with": "src/frontend/environments/environment.prod.ts"
} }
],
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
] ]
} }
} }

View File

@ -9,7 +9,7 @@ import {Subscription} from 'rxjs';
import {ActivatedRoute, Params, Router} from '@angular/router'; import {ActivatedRoute, Params, Router} from '@angular/router';
import {PageHelper} from '../../../model/page.helper'; import {PageHelper} from '../../../model/page.helper';
import {QueryService} from '../../../model/query.service'; import {QueryService} from '../../../model/query.service';
import {MediaBaseDTO, MediaDTO} from '../../../../../common/entities/MediaDTO'; import {MediaBaseDTO} from '../../../../../common/entities/MediaDTO';
import {QueryParams} from '../../../../../common/QueryParams'; import {QueryParams} from '../../../../../common/QueryParams';
import {GalleryService} from '../gallery.service'; import {GalleryService} from '../gallery.service';
import {PhotoDTO} from '../../../../../common/entities/PhotoDTO'; import {PhotoDTO} from '../../../../../common/entities/PhotoDTO';
@ -157,7 +157,7 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
} }
} }
//noinspection JSUnusedGlobalSymbols
@HostListener('window:resize', ['$event']) @HostListener('window:resize', ['$event'])
onResize(): void { onResize(): void {
this.updatePhotoFrameDim(); this.updatePhotoFrameDim();
@ -340,11 +340,14 @@ export class GalleryLightboxComponent implements OnDestroy, OnInit {
this.photoFrameDim.width = Math.max(window.innerWidth - this.infoPanelWidth, 0); this.photoFrameDim.width = Math.max(window.innerWidth - this.infoPanelWidth, 0);
this.photoFrameDim.height = window.innerHeight; this.photoFrameDim.height = window.innerHeight;
this.photoFrameDim.aspect = Math.round(this.photoFrameDim.width / this.photoFrameDim.height * 100) / 100; this.photoFrameDim.aspect = Math.round(this.photoFrameDim.width / this.photoFrameDim.height * 100) / 100;
} };
private navigateToPhoto(photoIndex: number): void { private navigateToPhoto(photoIndex: number): void {
this.router.navigate([], this.router.navigate([],
{queryParams: this.queryService.getParams(this.gridPhotoQL.toArray()[photoIndex].gridMedia.media)}).catch(console.error); {
queryParams:
this.queryService.getParams(this.gridPhotoQL.toArray()[photoIndex].gridMedia.media)
}).catch(console.error);
} }
private showPhoto(photoIndex: number, resize: boolean = true): void { private showPhoto(photoIndex: number, resize: boolean = true): void {

View File

@ -56,7 +56,7 @@ export class AutoCompleteService {
const type = this.getTypeFromPrefix(text.current); const type = this.getTypeFromPrefix(text.current);
const searchText = this.getPrefixLessSearchText(text.current); const searchText = this.getPrefixLessSearchText(text.current);
if (searchText === '') { if (searchText === '' || searchText === '.') {
return items; return items;
} }
this.typedAutoComplete(searchText, text.current, type, items); this.typedAutoComplete(searchText, text.current, type, items);

View File

@ -1,11 +1,8 @@
import {Component, ElementRef, EventEmitter, forwardRef, OnDestroy, Output, ViewChild} from '@angular/core'; import {Component, ElementRef, EventEmitter, forwardRef, OnDestroy, Output, ViewChild} from '@angular/core';
import {ActivatedRoute, Router, RouterLink} from '@angular/router'; import {Router, RouterLink} from '@angular/router';
import {BehaviorSubject, Subscription} from 'rxjs'; import {BehaviorSubject, Subscription} from 'rxjs';
import {AutoCompleteService, RenderableAutoCompleteItem} from '../autocomplete.service'; import {AutoCompleteService, RenderableAutoCompleteItem} from '../autocomplete.service';
import {MetadataSearchQueryTypes, SearchQueryTypes} from '../../../../../../common/entities/SearchQueryDTO'; import {MetadataSearchQueryTypes, SearchQueryTypes} from '../../../../../../common/entities/SearchQueryDTO';
import {SearchQueryParserService} from '../search-query-parser.service';
import {GalleryService} from '../../gallery.service';
import {NavigationService} from '../../../../model/navigation.service';
import {Config} from '../../../../../../common/config/public/Config'; import {Config} from '../../../../../../common/config/public/Config';
import {ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator} from '@angular/forms'; import {ControlValueAccessor, FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, ValidationErrors, Validator} from '@angular/forms';
@ -47,10 +44,6 @@ export class GallerySearchFieldComponent implements ControlValueAccessor, Valida
private autoCompleteItems: BehaviorSubject<RenderableAutoCompleteItem[]>; private autoCompleteItems: BehaviorSubject<RenderableAutoCompleteItem[]>;
constructor(private autoCompleteService: AutoCompleteService, constructor(private autoCompleteService: AutoCompleteService,
private searchQueryParserService: SearchQueryParserService,
private galleryService: GalleryService,
private navigationService: NavigationService,
private route: ActivatedRoute,
public router: Router) { public router: Router) {
this.SearchQueryTypes = SearchQueryTypes; this.SearchQueryTypes = SearchQueryTypes;