Skip to content

Commit

Permalink
Merge pull request #198 from nih-sparc/sparc-app-2-hotfixes
Browse files Browse the repository at this point in the history
updated portal notification id and fixed homepage news nuxt error
  • Loading branch information
egauzens authored Sep 7, 2024
2 parents c644f2e + 5974012 commit 4fed6e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions components/HomepageNews/HomepageNews.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import { pathOr } from 'ramda'
import SparcCard from '@/components/SparcCard/SparcCard.vue'
import MarkedMixin from '@/mixins/marked'
import FormatDate from '@/mixins/format-date'
import { isInternalLink } from '@/mixins/marked/index'
import { isAnchor } from '@/mixins/marked/index'
export default {
name: 'HomepageNews',
components: {
Expand Down Expand Up @@ -129,7 +129,7 @@ export default {
}
},
methods: {
isInternalLink,
isAnchor,
async fetchBitlyLinks() {
this.upcomingNews.forEach(async item => {
const url = pathOr("", ['fields', 'url'], item)
Expand All @@ -143,17 +143,22 @@ export default {
}
})
const newUrl = response.data.long_url
this.itemIsInternalLink.push(isInternalLink(newUrl))
this.itemIsInternalLink.push(this.isInternalLink(newUrl))
} catch {
console.log("Error retreiving bitly link destination url")
this.itemIsInternalLink.push(isInternalLink(url))
this.itemIsInternalLink.push(this.isInternalLink(url))
}
}
else {
this.itemIsInternalLink.push(isInternalLink(url))
this.itemIsInternalLink.push(this.isInternalLink(url))
}
})
},
isInternalLink(str){
return isAnchor(str)
? true
: str.includes(this.$config.public.ROOT_URL) || str.includes("sparc.science") || str.startsWith('/')
},
/**
* Get image source
* @param {Object} item
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default defineNuxtConfig({
CTF_CDA_ACCESS_TOKEN: process.env.CTF_CDA_ACCESS_TOKEN,
CTF_API_HOST: process.env.CTF_API_HOST || 'preview.contentful.com',
ctf_home_page_id: '4qJ9WUWXg09FAUvCnbGxBY',
ctf_portal_notification_entry_id: 'XiVlrkTXeKxTyN1Q2oY2Q',
ctf_portal_notification_entry_id: '5S8eazBlD1Y47pTO1EQfQ3',
ctf_contact_us_form_options_id: '79rwRA0rUqUj6rc913BFsz',
ctf_project_id: 'sparcAward',
ctf_about_page_id: '4VOSvJtgtFv1PS2lklMcnS',
Expand Down

0 comments on commit 4fed6e9

Please sign in to comment.