From c97a3cc96d9580ce9d3489780ada33a10b274648 Mon Sep 17 00:00:00 2001 From: Jens Vannerum Date: Mon, 16 Dec 2024 10:01:47 +0100 Subject: [PATCH] revert (maybe) unneeded --- .../browse-by-date/browse-by-date.component.ts | 12 +++++------- .../browse-by-metadata.component.ts | 11 +++++------ .../browse-by-page/browse-by-page.component.ts | 7 +++---- .../browse-by-switcher.component.ts | 6 +++--- .../browse-by-title/browse-by-title.component.ts | 12 +++++------- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/app/browse-by/browse-by-date/browse-by-date.component.ts b/src/app/browse-by/browse-by-date/browse-by-date.component.ts index 64b9a36bc26..f6d72bff34b 100644 --- a/src/app/browse-by/browse-by-date/browse-by-date.component.ts +++ b/src/app/browse-by/browse-by-date/browse-by-date.component.ts @@ -102,8 +102,6 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements } ngOnInit(): void { - console.log('BrowseByDateComponent ngOnInit called'); - const sortConfig = new SortOptions('default', SortDirection.ASC); this.startsWithType = StartsWithType.date; // include the thumbnail configuration in browse search options @@ -113,11 +111,11 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements this.subs.push( observableCombineLatest( [ this.route.params, - this.route.queryParams.pipe(take(1), tap((x) => console.log('BrowseByDateComponent this.route.queryParams', x))), - this.scope$.pipe(tap((x) => console.log('BrowseByDateComponent this.scope$', x))), - this.route.data.pipe(tap((x) => console.log('BrowseByDateComponent this.route.data', x))), - this.currentPagination$.pipe(tap((x) => console.log('BrowseByDateComponent this.currentPagination$', x))), - this.currentSort$.pipe(tap((x) => console.log('BrowseByDateComponent this.currentSort$', x))), + this.route.queryParams.pipe(take(1)), + this.scope$, + this.route.data, + this.currentPagination$, + this.currentSort$, ]).pipe( map(([routeParams, queryParams, scope, data, currentPage, currentSort]) => { return [Object.assign({}, routeParams, queryParams, data), scope, currentPage, currentSort]; diff --git a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts index d7856ac43f4..48416d68948 100644 --- a/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts +++ b/src/app/browse-by/browse-by-metadata/browse-by-metadata.component.ts @@ -210,7 +210,6 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { ngOnInit(): void { - console.log('BrowseByMetadataComponent ngOnInit called'); const sortConfig = new SortOptions('default', SortDirection.ASC); this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig)); @@ -218,11 +217,11 @@ export class BrowseByMetadataComponent implements OnInit, OnChanges, OnDestroy { this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( observableCombineLatest( - [ this.route.params.pipe(take(1), tap((x) => console.log('BrowseByMetadataComponent this.route.params', x))), - this.route.queryParams.pipe(tap((x) => console.log('BrowseByMetadataComponent this.route.queryParams', x))), - this.scope$.pipe(tap((x) => console.log('BrowseByMetadataComponent this.route.queryParams', x))), - this.currentPagination$.pipe(tap((x) => console.log('BrowseByMetadataComponent this.route.queryParams', x))), - this.currentSort$.pipe(tap((x) => console.log('BrowseByMetadataComponent this.route.queryParams', x))), + [ this.route.params.pipe(take(1)), + this.route.queryParams, + this.scope$, + this.currentPagination$, + this.currentSort$, ]).pipe( map(([routeParams, queryParams, scope, currentPage, currentSort]) => { return [Object.assign({}, routeParams, queryParams), scope, currentPage, currentSort]; diff --git a/src/app/browse-by/browse-by-page/browse-by-page.component.ts b/src/app/browse-by/browse-by-page/browse-by-page.component.ts index e5b101fe520..1a204264d15 100644 --- a/src/app/browse-by/browse-by-page/browse-by-page.component.ts +++ b/src/app/browse-by/browse-by-page/browse-by-page.component.ts @@ -5,7 +5,7 @@ import { } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; -import { map, tap, distinctUntilChanged } from 'rxjs/operators'; +import { map } from 'rxjs/operators'; import { BrowseDefinition } from '../../core/shared/browse-definition.model'; import { BrowseByDataType } from '../browse-by-switcher/browse-by-data-type'; @@ -23,7 +23,7 @@ import { BrowseBySwitcherComponent } from '../browse-by-switcher/browse-by-switc }) export class BrowseByPageComponent implements OnInit { - browseByType$: Observable<{type: BrowseByDataType }>; + browseByType$: Observable; constructor( protected route: ActivatedRoute, @@ -35,8 +35,7 @@ export class BrowseByPageComponent implements OnInit { */ ngOnInit(): void { this.browseByType$ = this.route.data.pipe( - map((data: { browseDefinition: BrowseDefinition }) => ({ type: data.browseDefinition.getRenderType() })), - tap((x) => console.log('BrowseByPageComponent browseByType$ =', x)), + map((data: { browseDefinition: BrowseDefinition }) => data.browseDefinition.getRenderType()), ); } diff --git a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts index cacda24066b..c1e3dae79f0 100644 --- a/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts +++ b/src/app/browse-by/browse-by-switcher/browse-by-switcher.component.ts @@ -4,7 +4,7 @@ import { } from '@angular/common'; import { Component, - Input, SimpleChanges, + Input, } from '@angular/core'; import { Context } from '../../core/shared/context.model'; @@ -24,7 +24,7 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent< @Input() context: Context; - @Input() browseByType: { type: BrowseByDataType }; + @Input() browseByType: BrowseByDataType; @Input() displayTitle: boolean; @@ -43,7 +43,7 @@ export class BrowseBySwitcherComponent extends AbstractComponentLoaderComponent< ]; public getComponent(): GenericConstructor { - return getComponentByBrowseByType(this.browseByType.type, this.context, this.themeService.getThemeName()); + return getComponentByBrowseByType(this.browseByType, this.context, this.themeService.getThemeName()); } } diff --git a/src/app/browse-by/browse-by-title/browse-by-title.component.ts b/src/app/browse-by/browse-by-title/browse-by-title.component.ts index bc365779b12..a353a99b178 100644 --- a/src/app/browse-by/browse-by-title/browse-by-title.component.ts +++ b/src/app/browse-by/browse-by-title/browse-by-title.component.ts @@ -57,7 +57,6 @@ import { export class BrowseByTitleComponent extends BrowseByMetadataComponent implements OnInit { ngOnInit(): void { - console.log('BrowseByTitleComponent ngOnInit called'); const sortConfig = new SortOptions('dc.title', SortDirection.ASC); // include the thumbnail configuration in browse search options this.updatePage(getBrowseSearchOptions(this.defaultBrowseId, this.paginationConfig, sortConfig, this.fetchThumbnails)); @@ -65,14 +64,13 @@ export class BrowseByTitleComponent extends BrowseByMetadataComponent implements this.currentSort$ = this.paginationService.getCurrentSort(this.paginationConfig.id, sortConfig); this.subs.push( observableCombineLatest( - [ this.route.params.pipe(take(1), tap((x) => console.log('BrowseByTitleComponent this.route.params', x))), - this.route.queryParams.pipe(tap((x) => console.log('BrowseByTitleComponent this.route.queryParams', x))), - this.scope$.pipe(tap((x) => console.log('BrowseByTitleComponent this.route.queryParams', x))), - this.currentPagination$.pipe(tap((x) => console.log('BrowseByTitleComponent this.route.queryParams', x))), - this.currentSort$.pipe(tap((x) => console.log('BrowseByTitleComponent this.route.queryParams', x))), + [ this.route.params.pipe(take(1)), + this.route.queryParams, + this.scope$, + this.currentPagination$, + this.currentSort$, ]).pipe( map(([routeParams, queryParams, scope, currentPage, currentSort]) => { - console.log('BrowseByTitleComponent', [routeParams, queryParams, scope, currentPage, currentSort]); return [Object.assign({}, routeParams, queryParams), scope, currentPage, currentSort]; }), ).subscribe(([params, scope, currentPage, currentSort]: [Params, string, PaginationComponentOptions, SortOptions]) => {