Skip to content

Commit

Permalink
Merge pull request #90 from nih-sparc/update-metrics-page-to-not-brea…
Browse files Browse the repository at this point in the history
…k-app-when-metrics-are-not-published

Update metrics pages to handle incomplete data
  • Loading branch information
egauzens authored May 2, 2024
2 parents d61b8ac + b0e54ab commit 870b26c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/Metrics/ScientificContribution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default {
'rgba(131, 0, 191, .5)',
],
borderColor: 'rgba(131, 0, 191, .5)',
data: contribution.dataChartData.total
data: contribution.dataChartData?.total
},
]
},
Expand Down
8 changes: 4 additions & 4 deletions components/Metrics/UserBehaviors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
'rgba(131, 0, 191, .5)',
],
borderColor: 'rgba(131, 0, 191, .5)',
data: behaviors.pageViewsData.lastMonth
data: behaviors.pageViewsData?.lastMonth
},
{
label: 'Last Quarter',
Expand All @@ -80,7 +80,7 @@ export default {
'rgba(188, 0, 252, .25)',
],
borderColor: 'rgba(188, 0, 252, .25)',
data: behaviors.pageViewsData.last3Months
data: behaviors.pageViewsData?.last3Months
}
]
}
Expand All @@ -94,7 +94,7 @@ export default {
'rgba(131, 0, 191, .5)',
],
borderColor: 'rgba(131, 0, 191, .5)',
data: behaviors.usersData.lastMonth
data: behaviors.usersData?.lastMonth
},
{
label: 'Last Quarter',
Expand All @@ -103,7 +103,7 @@ export default {
'rgba(188, 0, 252, .25)',
],
borderColor: 'rgba(188, 0, 252, .25)',
data: behaviors.usersData.last3Months
data: behaviors.usersData?.last3Months
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion pages/about/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default {
subData: `(${metrics.downloadsLastMonth} last month)`
}, {
title: 'Dataset Contributors',
data: metrics.totalContributors.toString(),
data: metrics.totalContributors?.toString(),
subData: `(${metrics.newContributors} new in the last month)`
}]
}))
Expand Down

0 comments on commit 870b26c

Please sign in to comment.