Skip to content

Commit

Permalink
Handled missing pdrid in metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanlin2018 committed Feb 27, 2024
1 parent a9a4da3 commit 908355a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion angular/src/app/landing/landingpage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class LandingPageComponent implements OnInit, AfterViewInit {

if(hasFile){
for(let metrics of this.recordLevelMetrics.DataSetMetrics) {
if((!this.pdrid || metrics["pdrid"].toLowerCase() == 'nan' || metrics["pdrid"].trim() == this.pdrid) && metrics["last_time_logged"]){
if((!this.pdrid || !metrics["pdrid"] || metrics["pdrid"].toLowerCase() == 'nan' || metrics["pdrid"].trim() == this.pdrid) && metrics["last_time_logged"]){
//Now check if there is any metrics data
this.metricsData.totalDatasetDownload = metrics != undefined? metrics.record_download : 0;

Expand Down
2 changes: 1 addition & 1 deletion angular/src/app/metrics/metrics.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class MetricsComponent implements OnInit {
// this.recordLevelTotalDownloads = this.recordLevelData.DataSetMetrics[0].success_get;

for(let metrics of this.recordLevelData.DataSetMetrics) {
if((!this.pdrid || metrics["pdrid"].toLowerCase() == 'nan' || metrics["pdrid"].trim() == this.pdrid) && metrics["last_time_logged"]){
if((!this.pdrid || !metrics["pdrid"] || metrics["pdrid"].toLowerCase() == 'nan' || metrics["pdrid"].trim() == this.pdrid) && metrics["last_time_logged"]){
this.firstTimeLogged = this.datePipe.transform(metrics.first_time_logged, "MMM d, y");
this.recordLevelTotalDownloads = metrics.success_get;
this.totalDatasetDownloads = metrics.record_download;
Expand Down

0 comments on commit 908355a

Please sign in to comment.