[Trunk | Monitor Dashboard] : monitor.component: Add checks for description & loading & no indicators case.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@58690 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b2253b7d5a
commit
2fc7648980
|
@ -65,8 +65,8 @@
|
||||||
[activeItem]="activeCategory?activeCategory.alias:null"
|
[activeItem]="activeCategory?activeCategory.alias:null"
|
||||||
[activeSubItem]="activeSubCategory?activeSubCategory.alias:null" [showHeader]=false
|
[activeSubItem]="activeSubCategory?activeSubCategory.alias:null" [showHeader]=false
|
||||||
></dashboard-sidebar>
|
></dashboard-sidebar>
|
||||||
<div *ngIf="activeSubCategory"
|
<!-- *ngIf="activeSubCategory"-->
|
||||||
id="page_content">
|
<div id="page_content">
|
||||||
<div id="page_content_inner">
|
<div id="page_content_inner">
|
||||||
<!-- <div>
|
<!-- <div>
|
||||||
Filters
|
Filters
|
||||||
|
@ -79,7 +79,30 @@
|
||||||
[(ngModel)]="endYear">
|
[(ngModel)]="endYear">
|
||||||
<button class="uk-button uk-button-primary" (click)="setIndicators()">Apply</button>
|
<button class="uk-button uk-button-primary" (click)="setIndicators()">Apply</button>
|
||||||
</div>-->
|
</div>-->
|
||||||
<div *ngIf="activeSubCategory.numbers.length == 0 && activeSubCategory.charts.length == 0">
|
<div
|
||||||
|
*ngIf="(activeSubCategory && (activeSubCategory.charts.length == 0 ||
|
||||||
|
(activeSubCategory.charts.length == 1 && activeSubCategory.charts[0].indicators.length == 0)))
|
||||||
|
&& ((activeSubCategory &&
|
||||||
|
activeSubCategory.description &&
|
||||||
|
activeSubCategory.description.length > 0) ||
|
||||||
|
(activeCategory && activeCategory.description && activeCategory.description.length > 0) ||
|
||||||
|
(activeTopic && activeTopic.description && activeTopic.description.length > 0))"
|
||||||
|
class="">
|
||||||
|
<div class="">
|
||||||
|
<div class="uk-h5">
|
||||||
|
{{activeSubCategory && activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description
|
||||||
|
: (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description :
|
||||||
|
(activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="!loading &&
|
||||||
|
(!activeSubCategory ||
|
||||||
|
(
|
||||||
|
(activeSubCategory.numbers.length == 0 || (activeSubCategory.numbers.length == 1 && activeSubCategory.numbers[0].indicators.length == 0))
|
||||||
|
&&
|
||||||
|
(activeSubCategory.charts.length == 0 || (activeSubCategory.charts.length == 1 && activeSubCategory.charts[0].indicators.length == 0))
|
||||||
|
))">
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="uk-h3">
|
<div class="uk-h3">
|
||||||
No indicators available yet. Stay tuned!
|
No indicators available yet. Stay tuned!
|
||||||
|
@ -107,23 +130,6 @@
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
*ngIf="(activeSubCategory && (activeSubCategory.charts.length == 0 ||
|
|
||||||
(activeSubCategory.charts.length == 1 && activeSubCategory.charts[0].indicators.length == 0)))
|
|
||||||
&& ((activeSubCategory &&
|
|
||||||
activeSubCategory.description &&
|
|
||||||
activeSubCategory.description.length > 0) ||
|
|
||||||
(activeCategory && activeCategory.description && activeCategory.description.length > 0) ||
|
|
||||||
(activeTopic && activeTopic.description && activeTopic.description.length > 0))"
|
|
||||||
class="">
|
|
||||||
<div class="">
|
|
||||||
<div class="uk-h5">
|
|
||||||
{{activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description
|
|
||||||
: (activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description :
|
|
||||||
(activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="activeSubCategory"
|
<div *ngIf="activeSubCategory"
|
||||||
>
|
>
|
||||||
<div *ngFor="let chart of activeSubCategory.charts; let i = index;" class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
|
<div *ngFor="let chart of activeSubCategory.charts; let i = index;" class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "
|
||||||
|
|
|
@ -88,9 +88,9 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
||||||
let subscription: Subscription;
|
let subscription: Subscription;
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.buildMenu();
|
|
||||||
|
|
||||||
this.route.params.subscribe(params => {
|
this.route.params.subscribe(params => {
|
||||||
|
this.loading = true;
|
||||||
if (subscription) {
|
if (subscription) {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,8 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
||||||
this.route.queryParams.subscribe(params => {
|
this.route.queryParams.subscribe(params => {
|
||||||
this.isViewPublic = (params['view'] == 'public');
|
this.isViewPublic = (params['view'] == 'public');
|
||||||
});
|
});
|
||||||
|
this.buildMenu();
|
||||||
|
|
||||||
if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) {
|
if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) {
|
||||||
this.status = this.errorCodes.LOADING;
|
this.status = this.errorCodes.LOADING;
|
||||||
this.numberResults = new Map<string, number>();
|
this.numberResults = new Map<string, number>();
|
||||||
|
@ -293,6 +295,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
|
||||||
items.push(new MenuItem('noCategories', 'No categories available yet', "", "", false, [], [], {}));
|
items.push(new MenuItem('noCategories', 'No categories available yet', "", "", false, [], [], {}));
|
||||||
}
|
}
|
||||||
this.sideBarItems = items;
|
this.sideBarItems = items;
|
||||||
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private setIndicators() {
|
private setIndicators() {
|
||||||
|
|
Loading…
Reference in New Issue