Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/common/MvPublicationsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@
<a class="text-link" :href="`${appBaseUrl}/publication-identifiers/${pub.dbName}/${encodeURIComponent(pub.identifier)}`">{{
pub.identifier
}}</a>
<template v-if="pub.url">
<template v-if="getPublicationUrl(pub)">
<span class="text-border">&middot;</span>
<a class="text-link" :href="pub.url" rel="noopener noreferrer" target="_blank">View article on the web</a>
<a
class="text-link"
:href="getPublicationUrl(pub)!"
rel="noopener noreferrer"
target="_blank"
>
View article on the web
</a>
</template>
</div>
</div>
Expand All @@ -25,6 +32,7 @@ import {defineComponent, type PropType} from 'vue'

import config from '@/config'
import {components} from '@/schema/openapi'
import {getPublicationUrl} from '@/lib/publication'

type PublicationIdentifier = components['schemas']['PublicationIdentifier']

Expand All @@ -40,6 +48,10 @@ export default defineComponent({
appBaseUrl(): string {
return config.appBaseUrl
}
},

methods: {
getPublicationUrl
}
})
</script>
8 changes: 5 additions & 3 deletions src/components/screens/PublicationIdentifierView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
{{ item.publicationYear }} · <span class="italic">{{ item.publicationJournal }}</span>
</span>
<a
v-if="item.url"
v-if="getPublicationUrl(item)"
class="inline-flex items-center gap-1 text-link no-underline"
:href="item.url"
:href="getPublicationUrl(item)!"
rel="noopener noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -88,6 +88,7 @@ import MvLayout from '@/components/layout/MvLayout.vue'
import MvPageHeader from '@/components/layout/MvPageHeader.vue'
import useItem from '@/composition/item.ts'
import MvLoader from '@/components/common/MvLoader.vue'
import {getPublicationUrl} from '@/lib/publication'

type ShortScoreSet = components['schemas']['ShortScoreSet']
type PublicationIdentifier = components['schemas']['PublicationIdentifier']
Expand All @@ -106,7 +107,8 @@ export default defineComponent({
setup(props) {
useHead({title: 'Publication details'})
return {
...useItem<PublicationIdentifier>({itemTypeName: props.name})
...useItem<PublicationIdentifier>({itemTypeName: props.name}),
getPublicationUrl
}
},

Expand Down
Loading
Loading