[Monitor Dashboard]: Add hasSidebar default true and if false is needed, should added on the route config
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57606 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
5b6685649c
commit
eccebdba62
|
@ -22,7 +22,12 @@ const routes: Routes = [
|
|||
loadChildren: './login/libUser.module#LibUserModule',
|
||||
resolve: {envSpecific: EnvironmentSpecificResolver}
|
||||
},
|
||||
{path: 'error', component: OpenaireErrorPageComponent, resolve: {envSpecific: EnvironmentSpecificResolver}},
|
||||
{
|
||||
path: 'error',
|
||||
component: OpenaireErrorPageComponent,
|
||||
resolve: {envSpecific: EnvironmentSpecificResolver},
|
||||
data: {hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder',
|
||||
loadChildren: './home/home.module#HomeModule',
|
||||
|
@ -37,7 +42,8 @@ const routes: Routes = [
|
|||
path: '**',
|
||||
pathMatch: 'full',
|
||||
component: OpenaireErrorPageComponent,
|
||||
resolve: {envSpecific: EnvironmentSpecificResolver}
|
||||
resolve: {envSpecific: EnvironmentSpecificResolver},
|
||||
data: {hasSidebar: false}
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.service";
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-error',
|
||||
|
@ -7,15 +6,7 @@ import {SideBarService} from "../library/sharedComponents/sidebar/sideBar.servic
|
|||
<error></error>
|
||||
`
|
||||
})
|
||||
export class OpenaireErrorPageComponent implements OnInit, OnDestroy{
|
||||
export class OpenaireErrorPageComponent {
|
||||
|
||||
constructor(private sidebarService: SideBarService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.sidebarService.setHasSidebar(false);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.sidebarService.setHasSidebar(true);
|
||||
}
|
||||
constructor() {}
|
||||
}
|
||||
|
|
|
@ -128,12 +128,6 @@ export class HomeComponent implements OnInit, OnDestroy {
|
|||
this.deleteTopicModal.open();
|
||||
}
|
||||
|
||||
public navigateTo(alias: string) {
|
||||
this.router.navigate(['./' + alias], {
|
||||
relativeTo: this.route
|
||||
});
|
||||
}
|
||||
|
||||
private save(message: string, element) {
|
||||
this.stakeholderService.saveStakeholder(this.properties.monitorServiceAPIURL, this.stakeholder).subscribe(stakeholder => {
|
||||
this.stakeholderService.setStakeholder(stakeholder);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {BehaviorSubject, Observable} from "rxjs";
|
||||
import {ActivationStart, Router} from "@angular/router";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -17,7 +18,20 @@ export class SideBarService {
|
|||
*/
|
||||
private hasSidebarSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
|
||||
|
||||
constructor() {}
|
||||
constructor(private router: Router) {
|
||||
this.router.events.subscribe(event => {
|
||||
if (event instanceof ActivationStart) {
|
||||
let data = event.snapshot.data;
|
||||
if (this.hasSidebarSubject.value === true &&
|
||||
data['hasSidebar'] !== undefined &&
|
||||
data['hasSidebar'] === false) {
|
||||
this.setHasSidebar(false);
|
||||
} else if (this.hasSidebarSubject.value === false) {
|
||||
this.setHasSidebar(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get open(): boolean {
|
||||
return this.openSubject.getValue();
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
</span>
|
||||
<i class="md-icon material-icons">more_vert</i>
|
||||
</div>
|
||||
<div class="uk-text-bold">{{indicator.name}}</div>
|
||||
<div class="md-card-toolbar-heading-text">{{indicator.name}}</div>
|
||||
</div>
|
||||
<div *ngIf="grid" class="md-card-content">
|
||||
<div class="uk-flex uk-flex-center" uk-grid>
|
||||
|
|
|
@ -72,7 +72,7 @@ export class TopicComponent implements OnInit, OnDestroy {
|
|||
if(this.topicIndex === -1) {
|
||||
this.navigateToError();
|
||||
} else {
|
||||
this.title.setTitle(stakeholder.index_name);
|
||||
this.title.setTitle(stakeholder.index_shortName + ' | ' + this.stakeholder.topics[this.topicIndex].name);
|
||||
this.toggle = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue