[Monitor Dashboard]: Change monitor route to / and / to admin

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57707 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2019-11-27 10:51:21 +00:00
parent bd82b388ef
commit ba4dee6d5f
5 changed files with 12 additions and 37 deletions

View File

@ -7,11 +7,6 @@ import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/env
import {OpenaireErrorPageComponent} from './error/errorPage.component';
const routes: Routes = [
{
path: 'monitor',
loadChildren: './monitor/monitor.module#MonitorModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
},
{
path: 'reload',
loadChildren: './reload/libReload.module#LibReloadModule',
@ -29,15 +24,20 @@ const routes: Routes = [
data: {hasSidebar: false}
},
{
path: ':stakeholder',
path: 'admin/:stakeholder',
loadChildren: './home/home.module#HomeModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
},
{
path: ':stakeholder/:topic',
path: 'admin/:stakeholder/:topic',
loadChildren: './topic/topic.module#TopicModule',
resolve: {envSpecific: EnvironmentSpecificResolver}
},
{
path: '',
loadChildren: './monitor/monitor.module#MonitorModule',
resolve: {envSpecific: EnvironmentSpecificResolver},
},
{
path: '**',
pathMatch: 'full',

View File

@ -1,5 +1,5 @@
import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
import {ActivatedRoute, NavigationEnd, RouteConfigLoadEnd, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
@ -70,7 +70,6 @@ export class AppComponent implements OnInit, OnDestroy {
}));
this.subscriptions.push(this.layoutService.hasHeader.subscribe(hasHeader => {
this.hasHeader = hasHeader;
console.log(this.hasHeader);
this.cdr.detectChanges();
}));
}

View File

@ -1,22 +0,0 @@
import {Directive, HostListener, Input} from "@angular/core";
@Directive({
selector: '[focus-directive]',
})
export class FocusDirective {
@Input('formInput') formControl: any;
constructor() { }
@HostListener
('focus', ['$event.target'])
onFocus(target) {
this.formControl.markAsTouched({onlySelf: true});
}
@HostListener('blur', ['$event.target'])
onBlur(target) {
this.formControl.markAsUntouched({onlySelf: true});
}
}

View File

@ -1,6 +1,5 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FocusDirective} from "./focus.directive";
import {InputComponent} from "./input.component";
import {SharedModule} from "../../../shared/shared.module";
import {MatFormFieldModule} from "@angular/material/form-field";
@ -19,7 +18,6 @@ import {MatSelectModule} from "@angular/material/select";
InputComponent
],
declarations: [
FocusDirective,
InputComponent
]
})

View File

@ -1,4 +1,4 @@
import {AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router';
import {DomSanitizer, Meta, Title} from '@angular/platform-browser';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
@ -179,13 +179,13 @@ export class MonitorComponent implements OnInit, OnDestroy {
category.subCategories.forEach(subCategory => {
if (subCategory.alias != null && subCategory.isPublic && subCategory.isActive) {
subItems.push(new Item(subCategory.name, (
'/monitor/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias + '/' + subCategory.alias),
this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias + '/' + subCategory.alias),
null, null, false));
}
});
const open = this.activeCategory.alias === category.alias;
items.push(new Item(category.name, (
'/monitor/' + this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias),
this.stakeholder.alias + '/' + this.activeTopic.alias + '/' + category.alias),
subItems, null, open));
}
});
@ -246,7 +246,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
}
public navigateTo(stakeholder: string, topic: string, category: string = null, subcategory: string = null) {
let url = '/monitor/' + stakeholder + '/' + topic + ((category) ? ('/'
let url = stakeholder + '/' + topic + ((category) ? ('/'
+ category) : '') + ((subcategory) ? ('/' + subcategory) : '');
return this._router.navigate([url]);
}