Skip to content

Commit

Permalink
add url formatter in PersonDataView to create http link
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucaterre committed Apr 26, 2024
1 parent 1c99839 commit ba93ec0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ VUE_APP_APP_URL=http://localhost:9091

# SERVICES
# - DB Person
VUE_APP_DB_ADMIN=https://dev.chartes.psl.eu/endp-person/admin
VUE_APP_DB_API=https://dev.chartes.psl.eu/endp-person/api
VUE_APP_DB_SHOW=https://dev.chartes.psl.eu/endp-person/endp-person
VUE_APP_DB_ADMIN=https://endp.chartes.psl.eu/endp-person/admin
VUE_APP_DB_API=https://endp.chartes.psl.eu/endp-person/api
VUE_APP_DB_SHOW=https://endp.chartes.psl.eu/endp-person/endp-person

# - NoSketch (Indexation Engine)
VUE_APP_NOSKETCH_APP=https://nosketch-engine.lamop.fr/
Expand Down
5 changes: 4 additions & 1 deletion src/views/PersonDataView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<ul>
<li v-for="link in kb_urls" :key="link">
<span><img class="logo__kb_icon" :src="mapping_kb_icons[link['type']]"></span>
<a :href="link['url']" alt="{{link['type']}}" target="_blank">{{ link['url'] }}</a>
<a :href="formatlinks(link['url'])" alt="{{link['type']}}" target="_blank">{{ formatlinks(link['url']) }}</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -139,6 +139,9 @@ export default {
const month = this.$store.state.months.find(m => m.iso_code === monthCode)?.name || '';
return `${day ? `${day} ` : ''}${month} ${year}`;
},
formatlinks(link) {
return !link.startsWith('http') ? `https://${link}` : link;
},
async fetchPersonData() {
try {
const metaData = await this.fetchData(`/persons/person/${this.reference_id}`);
Expand Down

0 comments on commit ba93ec0

Please sign in to comment.