Merged in CST-13383-breadcrumb-bug (pull request #1277)

CST-13383 breadcrumb bug

Approved-by: Stefano Maffei
This commit is contained in:
Francesco Molinaro
2024-01-26 13:31:26 +00:00
committed by Stefano Maffei
4 changed files with 26 additions and 24 deletions

View File

@@ -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,49 +18,42 @@ 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',
showBreadcrumbsFluid: false
},
},
{
path: 'inbound',
component: AdminNotifyIncomingComponent,
canActivate: [SiteAdministratorGuard],
resolve: {
breadcrumb: I18nBreadcrumbResolver,
},
component: AdminNotifyIncomingComponent,
canActivate: [SiteAdministratorGuard],
data: {
title: 'admin.notify.dashboard.page.title',
breadcrumbKey: 'admin.notify.dashboard',
showBreadcrumbsFluid: false
},
},
{
path: 'outbound',
component: AdminNotifyOutgoingComponent,
canActivate: [SiteAdministratorGuard],
resolve: {
breadcrumb: I18nBreadcrumbResolver,
},
component: AdminNotifyOutgoingComponent,
canActivate: [SiteAdministratorGuard],
data: {
title: 'admin.notify.dashboard.page.title',
breadcrumbKey: 'admin.notify.dashboard',
showBreadcrumbsFluid: false
},
}
])
],
providers: [
I18nBreadcrumbResolver,
I18nBreadcrumbsService,
]
})
/**
* Routing module for the Notifications section of the admin sidebar

View File

@@ -14,8 +14,9 @@
</div>
<div >
<div>
<ds-themed-search
#searchComponent
[configuration]="selectedSearchConfig$ | async"
[showViewModes]="false"
[searchEnabled]="false"

View File

@@ -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,

View File

@@ -54,7 +54,6 @@ export function getTabulatableObjectsComponent(types: (string | GenericConstruct
let currentBestMatch: MatchRelevancy = null;
for (const type of types) {
const typeMap = map.get(PaginatedList<typeof type>);
console.log(typeMap, 'd3ewfde');
if (hasValue(typeMap)) {
const match = getMatch(typeMap, [viewMode, context, theme], [DEFAULT_VIEW_MODE, DEFAULT_CONTEXT, DEFAULT_THEME]);