[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:
Konstantina Galouni 2020-05-13 10:00:12 +00:00
parent b2253b7d5a
commit 2fc7648980
2 changed files with 31 additions and 22 deletions

View File

@ -65,8 +65,8 @@
[activeItem]="activeCategory?activeCategory.alias:null"
[activeSubItem]="activeSubCategory?activeSubCategory.alias:null" [showHeader]=false
></dashboard-sidebar>
<div *ngIf="activeSubCategory"
id="page_content">
<!-- *ngIf="activeSubCategory"-->
<div id="page_content">
<div id="page_content_inner">
<!-- <div>
Filters
@ -79,7 +79,30 @@
[(ngModel)]="endYear">
<button class="uk-button uk-button-primary" (click)="setIndicators()">Apply</button>
</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="uk-h3">
No indicators available yet. Stay tuned!
@ -107,23 +130,6 @@
</ng-template>
</ng-template>
</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 *ngFor="let chart of activeSubCategory.charts; let i = index;" class="uk-grid uk-grid-medium uk-margin-bottom uk-flex uk-flex-bottom "

View File

@ -55,7 +55,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
fundingL0;
startYear;
endYear;
public keyword: FormControl;
constructor(
@ -88,9 +88,9 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
let subscription: Subscription;
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
this.buildMenu();
this.route.params.subscribe(params => {
this.loading = true;
if (subscription) {
subscription.unsubscribe();
}
@ -99,6 +99,8 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent
this.route.queryParams.subscribe(params => {
this.isViewPublic = (params['view'] == 'public');
});
this.buildMenu();
if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) {
this.status = this.errorCodes.LOADING;
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, [], [], {}));
}
this.sideBarItems = items;
this.loading = false;
}
private setIndicators() {