From 9ee588df827e7ad3e73f75b7a6364fc5870541a5 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 19 Oct 2021 15:30:17 +0300 Subject: [PATCH] Change description overlay. Fix a bug in case of more than one sections has no indicators. Make numbers with fixed width --- src/app/monitor/monitor.component.html | 26 ++---- src/app/monitor/monitor.component.ts | 60 ++++++------ src/app/openaireLibrary | 2 +- src/app/topic/indicators.component.html | 119 +++++++++++++----------- src/app/topic/indicators.component.ts | 10 -- src/assets/common-assets | 2 +- src/assets/dashboard-theme | 2 +- 7 files changed, 105 insertions(+), 116 deletions(-) diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 6f5b9ac..cbdcff3 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -91,11 +91,8 @@
-
0) || (activeCategory && activeCategory.description && activeCategory.description.length > 0) || (activeTopic && activeTopic.description && activeTopic.description.length > 0))" class="uk-text-center"> @@ -104,15 +101,12 @@ : (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description : (activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}}
-
+ ((activeSubCategory.numbers.length == 0 || countSectionsWithIndicatorsToShow(activeSubCategory.numbers) == 0) && + (activeSubCategory.charts.length == 0 || countSectionsWithIndicatorsToShow(activeSubCategory.charts) == 0)) + || !activeTopic || !activeCategory || !activeSubCategory)" [ngIfElse]="content">

No indicators available yet. Stay tuned! @@ -126,9 +120,8 @@

{{number.title}}
-
-
+
@@ -202,7 +195,7 @@
-
+

{{indicator.description}} @@ -231,8 +224,7 @@

- Send us your feedback. + Send us your feedback.
diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index a5587b2..caa749b 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -12,7 +12,7 @@ import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service"; import { Category, Indicator, - IndicatorPath, IndicatorSize, + IndicatorPath, IndicatorSize, Section, Stakeholder, SubCategory, Topic, @@ -77,6 +77,7 @@ export class MonitorComponent implements OnInit, OnDestroy { privateStakeholder = false; public keyword: FormControl; public statsUpdateDate: Date; + constructor( private route: ActivatedRoute, private _router: Router, @@ -170,7 +171,7 @@ export class MonitorComponent implements OnInit, OnDestroy { this.seoService.createLinkForCanonicalURL(url, false); this._meta.updateTag({content: url}, "property='og:url'"); this.description = "Monitor Dashboard | " + this.stakeholder.name; - this.title = "Monitor Dashboard | " + this.stakeholder.name; + this.title = "Monitor Dashboard | " + this.stakeholder.name; this._meta.updateTag({content: this.description}, "name='description'"); this._meta.updateTag({content: this.description}, "property='og:description'"); this._meta.updateTag({content: this.title}, "property='og:title'"); @@ -184,7 +185,7 @@ export class MonitorComponent implements OnInit, OnDestroy { this.subscriptions.push(this._piwikService.trackView(this.properties, this.title, this.piwikSiteId).subscribe()); } })); - + } if (this.isPublicOrIsMember(stakeholder.visibility)) { //this.getDivContents(); @@ -198,7 +199,7 @@ export class MonitorComponent implements OnInit, OnDestroy { subscription.unsubscribe(); } } - }else{ + } else { this.navigateToError(); if (subscription) { subscription.unsubscribe(); @@ -410,7 +411,7 @@ export class MonitorComponent implements OnInit, OnDestroy { private getfl0() { if (this.queryParams["relfundinglevel0_id"] && this.filters.length > 0) { - let value = StringUtils.URIDecode(StringUtils.unquote(this.queryParams["relfundinglevel0_id"] )); + let value = StringUtils.URIDecode(StringUtils.unquote(this.queryParams["relfundinglevel0_id"])); return value.split("::")[value.split("::").length - 1]; } return null; @@ -418,7 +419,7 @@ export class MonitorComponent implements OnInit, OnDestroy { private getCoFunded() { if (this.queryParams["co-funded"] && this.filters.length > 0) { - return this.queryParams["co-funded"] && StringUtils.URIDecode(StringUtils.unquote(this.queryParams["co-funded"] )) == "co-funded-results"; + return this.queryParams["co-funded"] && StringUtils.URIDecode(StringUtils.unquote(this.queryParams["co-funded"])) == "co-funded-results"; } return false; } @@ -534,41 +535,36 @@ export class MonitorComponent implements OnInit, OnDestroy { return counter; } - public countIndicatorsToShow(indicators: Indicator[]): number { + public countSectionsWithIndicatorsToShow(sections: Section[]):number { let counter = 0; - for (let i of indicators) { - if (this.isPublicOrIsMember(i.visibility)) { - counter++; - } - } + sections.forEach(section => { + section.indicators.forEach(indicator => { + if (this.isPublicOrIsMember(indicator.visibility)) { + counter++; + } + }); + }); return counter; } - /* - Feedback mail - */ - public get mailText() { + public countIndicatorsToShow(indicators: Indicator[]): number { + let counter = 0; + indicators.forEach(indicator => { + if (this.isPublicOrIsMember(indicator.visibility)) { + counter++; + } + }); + return counter; + } + + public get feedback() { return "mailto:" + this.properties.feedbackmail + "?subject=%5BOpenAIRE%20Monitor%5D%20" + (this.stakeholder ? this.stakeholder.name : "") + "%20dashboard%20feedback" } - mailMe() { - window.location.href = this.mailText; - } - - public getNumberClassBySize(size: IndicatorSize) { - if(size === 'small') { - return 'uk-width-1-4@xl uk-width-1-3@l uk-width-1-2@m uk-width-1-1'; - } else if(size === 'medium') { - return 'uk-width-1-3@l uk-width-1-2@m uk-width-1-1'; - } else { - return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1'; - } - } - public getChartClassBySize(size: IndicatorSize) { - if(size === 'small') { + if (size === 'small') { return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1'; - } else if(size === 'medium') { + } else if (size === 'medium') { return 'uk-width-1-2@l uk-width-1-1'; } else { return 'uk-width-1-1'; diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 6405188..5c7430a 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 64051887ce031b36d74349496912e5c337801c15 +Subproject commit 5c7430ae7cde032c1b6b4d9bd990f761cd6b73e3 diff --git a/src/app/topic/indicators.component.html b/src/app/topic/indicators.component.html index dbae836..c02cecf 100644 --- a/src/app/topic/indicators.component.html +++ b/src/app/topic/indicators.component.html @@ -43,69 +43,76 @@
-
- -
- -
- +
-
-
-
- {{indicator.name ? indicator.name : 'No title available'}} +
+
+ {{indicator.name ? indicator.name : 'No title available'}} +
+

+ {{numberResults.get(i + '-' + j) | number}} + -- +

+
-

- {{numberResults.get(i + '-' + j) | number}} - -- -

- -
-
-

+

+
+

{{indicator.description}} -
- +
+ {{indicator.additionalDescription}} -

+

+
+
-
+
-
+
Create a new number Indicator -
+
- +
@@ -165,9 +172,11 @@
-
- +
+ -
-
+
+

{{indicator.description}} @@ -251,7 +261,6 @@

-
-
-
+
-->
@@ -293,7 +302,7 @@
@@ -555,8 +564,10 @@ Are you sure you want to proceed? --> - + diff --git a/src/app/topic/indicators.component.ts b/src/app/topic/indicators.component.ts index 5c5ec86..1a501be 100644 --- a/src/app/topic/indicators.component.ts +++ b/src/app/topic/indicators.component.ts @@ -436,16 +436,6 @@ export class IndicatorsComponent implements OnInit, OnDestroy, OnChanges, AfterV return this.chartIndicatorFb.get('indicatorPaths') as FormArray; } - public getNumberClassBySize(size: IndicatorSize) { - if (size === 'small') { - return 'uk-width-1-4@xl uk-width-1-3@l uk-width-1-2@m uk-width-1-1'; - } else if (size === 'medium') { - return 'uk-width-1-3@l uk-width-1-2@m uk-width-1-1'; - } else { - return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1'; - } - } - public getChartClassBySize(size: IndicatorSize) { if (size === 'small') { return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1'; diff --git a/src/assets/common-assets b/src/assets/common-assets index 3637903..443ef4d 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 363790356aeb20339fab6d36516864ab44931dd7 +Subproject commit 443ef4d544d370c698ed0856481b71e489a044d8 diff --git a/src/assets/dashboard-theme b/src/assets/dashboard-theme index 72f3272..8f65666 160000 --- a/src/assets/dashboard-theme +++ b/src/assets/dashboard-theme @@ -1 +1 @@ -Subproject commit 72f3272e41d93e82042a293e8e85493fe8cfe6c2 +Subproject commit 8f656664973f82d9f6f0228968a77643964da805