diff --git a/components/Header/Header.vue b/components/Header/Header.vue
index a6a394c..f149ce3 100644
--- a/components/Header/Header.vue
+++ b/components/Header/Header.vue
@@ -103,7 +103,7 @@ const links = [
{
title: 'data',
displayTitle: 'Data & Models',
- href: '/data'
+ href: '/data?type=dataset'
},
{
title: 'apps',
diff --git a/pages/about/index.vue b/pages/about/index.vue
index ac1707d..097cae6 100644
--- a/pages/about/index.vue
+++ b/pages/about/index.vue
@@ -73,6 +73,21 @@ import marked from '@/mixins/marked'
import { getPreviousDate } from '@/utils/common'
import { pathOr } from 'ramda'
+const months = [
+ 'January',
+ 'Febuary',
+ 'March',
+ 'April',
+ 'May',
+ 'June',
+ 'July',
+ 'August',
+ 'September',
+ 'October',
+ 'November',
+ 'December'
+]
+
export default {
name: 'AboutPage',
@@ -118,6 +133,7 @@ export default {
const currentYear = new Date().getFullYear()
// we use last months date to get the metrics bc the metrics for the current month aren't published until the end of the month
const lastMonthsDate = getPreviousDate(currentMonth, currentYear)
+ let dateUsed = lastMonthsDate
return Promise.all([
/**
* Page data
@@ -143,6 +159,7 @@ export default {
})
.catch(() => {
const monthBeforeLastDate = getPreviousDate(lastMonthsDate.month, lastMonthsDate.year)
+ dateUsed = monthBeforeLastDate
return $axios
.get(config.public.METRICS_URL + `/pennsieve?year=${monthBeforeLastDate.year}&month=${monthBeforeLastDate.month}`)
.then(({ data }) => {
@@ -191,11 +208,11 @@ export default {
metricsItems: [{
title: 'Total Downloads',
data: totalDownloads.toString(),
- subData: `(${metrics.downloadsLastMonth} last month)`
+ subData: `(${metrics.downloadsLastMonth} in ${months[dateUsed.month - 1]})`
}, {
title: 'Dataset Contributors',
data: metrics.totalContributors?.toString(),
- subData: `(${metrics.newContributors} new in the last month)`
+ subData: `(${metrics.newContributors} new in ${months[dateUsed.month - 1]})`
}]
}))
},
diff --git a/pages/about/metrics/index.vue b/pages/about/metrics/index.vue
index 90dee1c..7d54e44 100644
--- a/pages/about/metrics/index.vue
+++ b/pages/about/metrics/index.vue
@@ -42,7 +42,7 @@
v-else
:metrics-data="metricsData"
/>
-
+
Last metrics update: {{ monthLastUpdate.toLocaleString('default', { month: 'long' }) }} {{ monthLastUpdate.getFullYear() }}
diff --git a/pages/about/projects/index.vue b/pages/about/projects/index.vue
index 3eb6fe9..1beb03d 100644
--- a/pages/about/projects/index.vue
+++ b/pages/about/projects/index.vue
@@ -268,10 +268,11 @@ export default {
watch: {
'$route.query.consortiaType': {
- handler: async function () {
- if (!this.$route.query.consortiaType) {
+ handler: function () {
+ // Added route name check bc clicking on Data & Models header link was causing this to still fire after navigating to the data page
+ if (!this.$route.query.consortiaType && this.$route.name == 'about-projects') {
this.$router.push({
- query: { consortiaType: this.consortiaType['id'] }
+ query: {consortiaType: this.consortiaType['id'] }
})
} else {
this.searchData = {
diff --git a/pages/data/index.vue b/pages/data/index.vue
index 49f79a6..1353c67 100644
--- a/pages/data/index.vue
+++ b/pages/data/index.vue
@@ -166,7 +166,11 @@ export default {
const route = useRoute()
if (route.query.type == 'projects') {
const focusQuery = route.query.selectedProjectsAnatomicalFocusIds
- await navigateTo(`/about/projects?consortiaType=SPARC&selectedProjectsAnatomicalFocusIds=${focusQuery}`)
+ let newPath = '/about/projects?consortiaType=SPARC'
+ if (focusQuery) {
+ newPath += `&selectedProjectsAnatomicalFocusIds=${focusQuery}`
+ }
+ return navigateTo(newPath)
}
const { $algoliaClient } = useNuxtApp()
const algoliaSortOptions = [
diff --git a/tests/cypress/e2e/homepage.cy.js b/tests/cypress/e2e/homepage.cy.js
index 7582259..e50b241 100644
--- a/tests/cypress/e2e/homepage.cy.js
+++ b/tests/cypress/e2e/homepage.cy.js
@@ -12,7 +12,7 @@ describe('Homepage', { testIsolation: false }, function () {
it('Navigation Bar', function () {
// Check for navigation bar
- cy.get('.mobile-navigation > :nth-child(1) > :nth-child(1) > a').should('contain', 'Data & Models').and('have.attr', 'href', '/data')
+ cy.get('.mobile-navigation > :nth-child(1) > :nth-child(1) > a').should('contain', 'Data & Models').and('have.attr', 'href', '/data?type=dataset')
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(2) > a').should('contain', 'SPARC Apps').and('have.attr', 'href', '/apps')
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(3) > a').should('contain', 'Tools & Resources').and('have.attr', 'href', '/tools-and-resources')
cy.get('.mobile-navigation > :nth-child(1) > :nth-child(4) > a').should('contain', 'News & Events').and('have.attr', 'href', '/news-and-events')