This commit is contained in:
Michael Spalti
2023-01-20 11:52:17 -08:00
parent 549735795b
commit 00bf90d8ea
2 changed files with 6 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { filter, map, take } from 'rxjs/operators'; import { filter, map, take } from 'rxjs/operators';
import { RouteService } from '../../core/services/route.service'; import { RouteService } from '../../core/services/route.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@@ -17,7 +17,7 @@ import { isNotEmpty } from '../empty.util';
/** /**
* Component to add back to result list button to item. * Component to add back to result list button to item.
*/ */
export class ResultsBackButtonComponent { export class ResultsBackButtonComponent implements OnInit {
/** /**
* Page number of the previous page * Page number of the previous page
@@ -61,10 +61,9 @@ export class ResultsBackButtonComponent {
this.buttonLabel = this.translateService.get('search.browse.item-back'); this.buttonLabel = this.translateService.get('search.browse.item-back');
} }
if(this.alwaysShowButton) { if (this.alwaysShowButton) {
this.showBackButton = true; this.showBackButton = true;
} } else {
else {
// Show the back button when the previous route was a search or browse list. // Show the back button when the previous route was a search or browse list.
// Include the button for admin search results and MyDspace. // Include the button for admin search results and MyDspace.
this.routeService.getPreviousUrl().pipe( this.routeService.getPreviousUrl().pipe(
@@ -90,7 +89,7 @@ export class ResultsBackButtonComponent {
take(1) take(1)
).subscribe( ).subscribe(
(url => { (url => {
this.router.navigateByUrl(url) this.router.navigateByUrl(url);
}) })
); );
} }

View File

@@ -1,8 +1,6 @@
import { Component, Input } from '@angular/core'; import { Component } from '@angular/core';
import { ThemedComponent } from '../theme-support/themed.component'; import { ThemedComponent } from '../theme-support/themed.component';
import { ResultsBackButtonComponent } from './results-back-button.component'; import { ResultsBackButtonComponent } from './results-back-button.component';
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
import { BehaviorSubject } from 'rxjs';
@Component({ @Component({
selector: 'ds-themed-results-back-button', selector: 'ds-themed-results-back-button',