Merged in CST-13397-fix-ssr-issue (pull request #1285)

fix ssr issue

Approved-by: Stefano Maffei
This commit is contained in:
Francesco Molinaro
2024-01-29 08:40:57 +00:00
committed by Stefano Maffei
2 changed files with 12 additions and 13 deletions

View File

@@ -16,7 +16,6 @@
<div> <div>
<ds-themed-search <ds-themed-search
#searchComponent
[configuration]="selectedSearchConfig$ | async" [configuration]="selectedSearchConfig$ | async"
[showViewModes]="false" [showViewModes]="false"
[searchEnabled]="false" [searchEnabled]="false"

View File

@@ -3,7 +3,7 @@ import {
Component, Component,
Inject, Inject,
Input, Input,
OnInit, ViewChild OnInit
} from '@angular/core'; } from '@angular/core';
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component'; import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
import { Context } from '../../../../core/shared/context.model'; import { Context } from '../../../../core/shared/context.model';
@@ -12,7 +12,6 @@ import { Observable } from 'rxjs';
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router'; import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
import { ViewMode } from '../../../../core/shared/view-mode.model'; import { ViewMode } from '../../../../core/shared/view-mode.model';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { ThemedSearchComponent } from '../../../../shared/search/themed-search.component';
@Component({ @Component({
selector: 'ds-admin-notify-logs-result', selector: 'ds-admin-notify-logs-result',
@@ -29,8 +28,6 @@ export class AdminNotifyLogsResultComponent implements OnInit {
@Input() @Input()
defaultConfiguration: string; defaultConfiguration: string;
@ViewChild('searchComponent') searchComponent: ThemedSearchComponent;
public selectedSearchConfig$: Observable<string>; public selectedSearchConfig$: Observable<string>;
public isInbound$: Observable<boolean>; public isInbound$: Observable<boolean>;
@@ -50,15 +47,18 @@ export class AdminNotifyLogsResultComponent implements OnInit {
); );
} }
/**
* Reset route state to default configuration
*/
public resetDefaultConfiguration() { public resetDefaultConfiguration() {
// we prevent cache use on reset so that the result are rendered properly //Idle navigation to trigger rendering of result on same page
this.searchComponent.useCachedVersionIfAvailable = false; this.router.navigateByUrl('/', { skipLocationChange: true }).then(() => {
this.router.navigate([this.getResolvedUrl(this.route.snapshot)], { this.router.navigate([this.getResolvedUrl(this.route.snapshot)], {
queryParams: { queryParams: {
configuration: this.defaultConfiguration, configuration: this.defaultConfiguration,
view: ViewMode.Table, view: ViewMode.Table,
}, },
});
}); });
} }