mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
add navigation with new config, add custom filter
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { AdminNotifyMetricsRow } from './admin-notify-metrics.model';
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { ViewMode } from "../../../core/shared/view-mode.model";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-metrics',
|
||||
@@ -10,7 +12,23 @@ export class AdminNotifyMetricsComponent {
|
||||
@Input()
|
||||
boxesConfig: AdminNotifyMetricsRow[];
|
||||
|
||||
public navigateToSelectedSearchConfig($event: string) {
|
||||
console.log($event);
|
||||
private incomingConfiguration = 'NOTIFY.incoming';
|
||||
private inboundPath = '/inbound';
|
||||
private outboundPath = '/outbound';
|
||||
|
||||
constructor(private router: Router) {
|
||||
}
|
||||
|
||||
|
||||
public navigateToSelectedSearchConfig(searchConfig: string) {
|
||||
const isIncomingConfig = searchConfig.startsWith(this.incomingConfiguration);
|
||||
const selectedPath = isIncomingConfig ? this.inboundPath : this.outboundPath;
|
||||
|
||||
this.router.navigate([`${this.router.url}${selectedPath}`], {
|
||||
queryParams: {
|
||||
configuration: searchConfig,
|
||||
view: ViewMode.Table
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user