mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
fix issue with breadcrumb
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||
import {
|
||||
SiteAdministratorGuard
|
||||
@@ -19,11 +18,11 @@ import {
|
||||
{
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
path: '',
|
||||
component: AdminNotifyDashboardComponent,
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyDashboardComponent,
|
||||
pathMatch: 'full',
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
@@ -31,11 +30,11 @@ import {
|
||||
},
|
||||
{
|
||||
path: 'inbound',
|
||||
component: AdminNotifyIncomingComponent,
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyIncomingComponent,
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
@@ -43,11 +42,11 @@ import {
|
||||
},
|
||||
{
|
||||
path: 'outbound',
|
||||
component: AdminNotifyOutgoingComponent,
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
component: AdminNotifyOutgoingComponent,
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
data: {
|
||||
title: 'admin.notify.dashboard.page.title',
|
||||
breadcrumbKey: 'admin.notify.dashboard',
|
||||
@@ -55,10 +54,6 @@ import {
|
||||
}
|
||||
])
|
||||
],
|
||||
providers: [
|
||||
I18nBreadcrumbResolver,
|
||||
I18nBreadcrumbsService,
|
||||
]
|
||||
})
|
||||
/**
|
||||
* Routing module for the Notifications section of the admin sidebar
|
||||
|
@@ -14,8 +14,9 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div >
|
||||
<div>
|
||||
<ds-themed-search
|
||||
#searchComponent
|
||||
[configuration]="selectedSearchConfig$ | async"
|
||||
[showViewModes]="false"
|
||||
[searchEnabled]="false"
|
||||
|
@@ -1,4 +1,10 @@
|
||||
import { Component, Inject, Input, OnInit } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
Inject,
|
||||
Input,
|
||||
OnInit, ViewChild
|
||||
} from '@angular/core';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
||||
@@ -6,6 +12,7 @@ import { Observable } from 'rxjs';
|
||||
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ThemedSearchComponent } from '../../../../shared/search/themed-search.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-logs-result',
|
||||
@@ -17,33 +24,36 @@ import { map } from 'rxjs/operators';
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AdminNotifyLogsResultComponent implements OnInit{
|
||||
export class AdminNotifyLogsResultComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
defaultConfiguration: string;
|
||||
|
||||
@ViewChild('searchComponent') searchComponent: ThemedSearchComponent;
|
||||
|
||||
|
||||
public selectedSearchConfig$: Observable<string>;
|
||||
public isInbound$: Observable<boolean>;
|
||||
|
||||
protected readonly context = Context.CoarNotify;
|
||||
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute) {
|
||||
private route: ActivatedRoute,
|
||||
protected cdRef: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// override the route reuse strategy to prevent issue on result loading
|
||||
this.router.routeReuseStrategy.shouldReuseRoute = () => {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.selectedSearchConfig$ = this.searchConfigService.getCurrentConfiguration(this.defaultConfiguration);
|
||||
this.isInbound$ = this.selectedSearchConfig$.pipe(
|
||||
map(config => config.startsWith('NOTIFY.incoming'))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public resetDefaultConfiguration() {
|
||||
// we prevent cache use on reset so that the result are rendered properly
|
||||
this.searchComponent.useCachedVersionIfAvailable = false;
|
||||
this.router.navigate([this.getResolvedUrl(this.route.snapshot)], {
|
||||
queryParams: {
|
||||
configuration: this.defaultConfiguration,
|
||||
|
Reference in New Issue
Block a user