diff --git a/angular/src/app/landing/data-files/data-files.component.html b/angular/src/app/landing/data-files/data-files.component.html index 3b72e22c1..f76718478 100644 --- a/angular/src/app/landing/data-files/data-files.component.html +++ b/angular/src/app/landing/data-files/data-files.component.html @@ -22,7 +22,7 @@ -
+
Files = 0) { + let keyw = this.keywords[i].trim().toLowerCase(); + if (keyw.indexOf(keyword) >= 0) { this.suggestedKeywords.push(this.shortenKeyword(keyw)); this.suggestedKeywordsLkup[this.shortenKeyword(keyw)] = keyw; } @@ -597,8 +597,8 @@ export class FiltersComponent implements OnInit { // Handle selected keyword: update suggested keywords lookup. Lookup array must cover all selected keywords. this.selectedKeywords.forEach(kw => { for (let i = 0; i < this.keywords.length; i++) { - let keyw = this.keywords[i].trim(); - if (keyw.toLowerCase().indexOf(kw.toLowerCase()) >= 0) { + let keyw = this.keywords[i].trim().toLowerCase(); + if (keyw.indexOf(kw.toLowerCase()) >= 0) { this.suggestedKeywordsLkup[this.shortenKeyword(keyw)] = keyw; } } diff --git a/angular/src/app/landing/landingbody.component.html b/angular/src/app/landing/landingbody.component.html index 4454fdc54..19e87bf80 100644 --- a/angular/src/app/landing/landingbody.component.html +++ b/angular/src/app/landing/landingbody.component.html @@ -7,7 +7,7 @@
- + diff --git a/angular/src/app/landing/landingpage.component.ts b/angular/src/app/landing/landingpage.component.ts index 9ae90cb12..ebbdf357b 100644 --- a/angular/src/app/landing/landingpage.component.ts +++ b/angular/src/app/landing/landingpage.component.ts @@ -332,20 +332,25 @@ export class LandingPageComponent implements OnInit, AfterViewInit { if(hasFile){ //Now check if there is any metrics data this.metricsData.totalDatasetDownload = this.recordLevelMetrics.DataSetMetrics[0] != undefined? this.recordLevelMetrics.DataSetMetrics[0].record_download : 0; - + this.metricsData.totalDownloadSize = this.recordLevelMetrics.DataSetMetrics[0] != undefined? this.recordLevelMetrics.DataSetMetrics[0].total_size : 0; this.metricsData.totalUsers = this.recordLevelMetrics.DataSetMetrics[0] != undefined? this.recordLevelMetrics.DataSetMetrics[0].number_users : 0; - this.metricsData.totalUsers = this.metricsData.totalUsers == undefined? 0 : this.metricsData.totalUsers; + this.metricsData.totalUsers = this.metricsData.totalUsers == undefined? 0 : this.metricsData.totalUsers; } + + this.metricsData.dataReady = true; } }, (err) => { console.error("Failed to retrieve dataset metrics: ", err); this.metricsData.hasCurrentMetrics = false; this.showMetrics = true; + this.metricsData.dataReady = true; }); + }else{ + this.metricsData.dataReady = true; } this.showMetrics = true; } @@ -354,6 +359,7 @@ export class LandingPageComponent implements OnInit, AfterViewInit { console.error("Failed to retrieve file metrics: ", err); this.metricsData.hasCurrentMetrics = false; this.showMetrics = true; + this.metricsData.dataReady = true; // ready to display message }); } diff --git a/angular/src/app/landing/metrics-data.ts b/angular/src/app/landing/metrics-data.ts index cd06a87cc..d7d109442 100644 --- a/angular/src/app/landing/metrics-data.ts +++ b/angular/src/app/landing/metrics-data.ts @@ -4,17 +4,20 @@ export class MetricsData { totalUsers: number; totalDownloadSize: number; url: string; + dataReady: boolean; constructor(hasCurrentMetrics:boolean = false, totalDatasetDownload:number = 0, totalUsers:number = 0, totalDownloadSize:number = 0, - url:string = ""){ + url:string = "", + dataReady: boolean = false){ this.hasCurrentMetrics = hasCurrentMetrics; this.totalDatasetDownload = totalDatasetDownload; this.totalUsers = totalUsers; this.totalDownloadSize = totalDownloadSize; this.url = url; + this.dataReady = dataReady; } } \ No newline at end of file diff --git a/angular/src/app/landing/metricsinfo/metricsinfo.component.css b/angular/src/app/landing/metricsinfo/metricsinfo.component.css index 8f4f7fe58..d34cb97f9 100644 --- a/angular/src/app/landing/metricsinfo/metricsinfo.component.css +++ b/angular/src/app/landing/metricsinfo/metricsinfo.component.css @@ -3,7 +3,6 @@ color: white; width: 100%; height: 2em; - /* margin-top: 1em; */ border-radius: 3px; font-weight: bold; padding: .2em .7em; @@ -18,3 +17,8 @@ ul { margin-left: 15px; padding: 0; } + +.metrics-spinner { + position: relative; + width: 100%; +} \ No newline at end of file diff --git a/angular/src/app/landing/metricsinfo/metricsinfo.component.html b/angular/src/app/landing/metricsinfo/metricsinfo.component.html index e30e2a579..2d9736ea9 100644 --- a/angular/src/app/landing/metricsinfo/metricsinfo.component.html +++ b/angular/src/app/landing/metricsinfo/metricsinfo.component.html @@ -1,28 +1,32 @@
- Dataset Metrics + Dataset Metrics + +
-
-
    -
  • - {{metricsData.totalDatasetDownload}} dataset downloads -
  • -
  • - {{totalUsers}} -
  • -
  • - {{totalDownloadSize}} downloaded -
  • -
-
- More... +
+
+
    +
  • + {{metricsData.totalDatasetDownload}} dataset downloads +
  • +
  • + {{totalUsers}} +
  • +
  • + {{totalDownloadSize}} downloaded +
  • +
+
+ More... +
+ + Metrics not available +
- - Metrics not available -
diff --git a/angular/src/app/landing/resultlist/resultlist.component.html b/angular/src/app/landing/resultlist/resultlist.component.html index f5a803af3..e1b3ae7a1 100644 --- a/angular/src/app/landing/resultlist/resultlist.component.html +++ b/angular/src/app/landing/resultlist/resultlist.component.html @@ -1,6 +1,6 @@
-
+
@@ -118,7 +118,7 @@
-
- Loading search result... +
+
\ No newline at end of file diff --git a/angular/src/app/landing/resultlist/resultlist.component.ts b/angular/src/app/landing/resultlist/resultlist.component.ts index e0f9c1465..66ed6794d 100644 --- a/angular/src/app/landing/resultlist/resultlist.component.ts +++ b/angular/src/app/landing/resultlist/resultlist.component.ts @@ -428,7 +428,7 @@ export class ResultlistComponent implements OnInit { object["keyword"].forEach((keyword) => { //Loop through each search keyword from keyword filter filter.split("=")[1].split(",").forEach(kw => { - if(keyword.includes(kw)){ + if(keyword.toLowerCase().includes(kw)){ object.active = true; } }) diff --git a/angular/src/app/landing/sections/resourceidentity.component.html b/angular/src/app/landing/sections/resourceidentity.component.html index 81facdf32..d2677ba30 100644 --- a/angular/src/app/landing/sections/resourceidentity.component.html +++ b/angular/src/app/landing/sections/resourceidentity.component.html @@ -47,6 +47,7 @@