mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
fix issue with breadcrumb
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
|
||||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||||
import {
|
import {
|
||||||
SiteAdministratorGuard
|
SiteAdministratorGuard
|
||||||
@@ -19,11 +18,11 @@ import {
|
|||||||
{
|
{
|
||||||
canActivate: [SiteAdministratorGuard],
|
canActivate: [SiteAdministratorGuard],
|
||||||
path: '',
|
path: '',
|
||||||
component: AdminNotifyDashboardComponent,
|
|
||||||
pathMatch: 'full',
|
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
|
component: AdminNotifyDashboardComponent,
|
||||||
|
pathMatch: 'full',
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notify.dashboard.page.title',
|
title: 'admin.notify.dashboard.page.title',
|
||||||
breadcrumbKey: 'admin.notify.dashboard',
|
breadcrumbKey: 'admin.notify.dashboard',
|
||||||
@@ -31,11 +30,11 @@ import {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'inbound',
|
path: 'inbound',
|
||||||
component: AdminNotifyIncomingComponent,
|
|
||||||
canActivate: [SiteAdministratorGuard],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
|
component: AdminNotifyIncomingComponent,
|
||||||
|
canActivate: [SiteAdministratorGuard],
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notify.dashboard.page.title',
|
title: 'admin.notify.dashboard.page.title',
|
||||||
breadcrumbKey: 'admin.notify.dashboard',
|
breadcrumbKey: 'admin.notify.dashboard',
|
||||||
@@ -43,11 +42,11 @@ import {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'outbound',
|
path: 'outbound',
|
||||||
component: AdminNotifyOutgoingComponent,
|
|
||||||
canActivate: [SiteAdministratorGuard],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
|
component: AdminNotifyOutgoingComponent,
|
||||||
|
canActivate: [SiteAdministratorGuard],
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notify.dashboard.page.title',
|
title: 'admin.notify.dashboard.page.title',
|
||||||
breadcrumbKey: 'admin.notify.dashboard',
|
breadcrumbKey: 'admin.notify.dashboard',
|
||||||
@@ -55,10 +54,6 @@ import {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
providers: [
|
|
||||||
I18nBreadcrumbResolver,
|
|
||||||
I18nBreadcrumbsService,
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* Routing module for the Notifications section of the admin sidebar
|
* Routing module for the Notifications section of the admin sidebar
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div >
|
<div>
|
||||||
<ds-themed-search
|
<ds-themed-search
|
||||||
|
#searchComponent
|
||||||
[configuration]="selectedSearchConfig$ | async"
|
[configuration]="selectedSearchConfig$ | async"
|
||||||
[showViewModes]="false"
|
[showViewModes]="false"
|
||||||
[searchEnabled]="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 { 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';
|
||||||
import { SearchConfigurationService } from '../../../../core/shared/search/search-configuration.service';
|
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 { 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',
|
||||||
@@ -17,33 +24,36 @@ import { map } from 'rxjs/operators';
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AdminNotifyLogsResultComponent implements OnInit{
|
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>;
|
||||||
|
|
||||||
protected readonly context = Context.CoarNotify;
|
protected readonly context = Context.CoarNotify;
|
||||||
|
|
||||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
constructor(@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute) {
|
private route: ActivatedRoute,
|
||||||
|
protected cdRef: ChangeDetectorRef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
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.selectedSearchConfig$ = this.searchConfigService.getCurrentConfiguration(this.defaultConfiguration);
|
||||||
this.isInbound$ = this.selectedSearchConfig$.pipe(
|
this.isInbound$ = this.selectedSearchConfig$.pipe(
|
||||||
map(config => config.startsWith('NOTIFY.incoming'))
|
map(config => config.startsWith('NOTIFY.incoming'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public resetDefaultConfiguration() {
|
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)], {
|
this.router.navigate([this.getResolvedUrl(this.route.snapshot)], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
configuration: this.defaultConfiguration,
|
configuration: this.defaultConfiguration,
|
||||||
|
Reference in New Issue
Block a user