Skip to content

Commit

Permalink
fix: orcid unauthenticated brand guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentauger committed Nov 29, 2024
1 parent fd56844 commit 4e07c1e
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ OHDEAR_ENABLED=false
OHDEAR_URL=""

ORCID_USE_SANDBOX=false
ORCID_REDIRECT_URI="${FRONTEND_URL}api/orcid/redirect"
ORCID_REDIRECT_URI="${FRONTEND_URL}api/orcid/callback"
ORCID_CLIENT_ID=""
ORCID_CLIENT_SECRET=""

Expand Down
5 changes: 5 additions & 0 deletions public/assets/orcid/orcid.logo.unauth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions resources/src/components/OrcidAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<script setup lang="ts"></script>
<script setup lang="ts">
const { unauthenticated = false } = defineProps<{
unauthenticated?: boolean
}>()
const svgLink = computed(() => {
return unauthenticated
? 'img:/assets/orcid/orcid.logo.unauth.svg'
: 'img:/assets/orcid/orcid.logo.icon.svg'
})
</script>

<template>
<q-avatar icon="img:/assets/orcid/orcid.logo.icon.svg" aria-label="ORCID iD logo" />
<q-avatar :icon="svgLink" aria-label="ORCID iD logo" />
</template>

<style scoped></style>
14 changes: 12 additions & 2 deletions resources/src/components/OrcidIcon.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<script setup lang="ts"></script>
<script setup lang="ts">
const { unauthenticated = false } = defineProps<{
unauthenticated?: boolean
}>()
const svgLink = computed(() => {
return unauthenticated
? 'img:/assets/orcid/orcid.logo.unauth.svg'
: 'img:/assets/orcid/orcid.logo.icon.svg'
})
</script>

<template>
<q-icon
name="img:/assets/orcid/orcid.logo.icon.svg"
:name="svgLink"
size="16px"
alt="ORCID iD logo"
/>
Expand Down
3 changes: 2 additions & 1 deletion resources/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@
"select-file": "Select or drop file here",
"optional": "Optional",
"cant-download": "You are not authorized to download this file.",
"publication-previous-version": "This is a previous version of the publication"
"publication-previous-version": "This is a previous version of the publication",
"unauthenticated-orcid-id": "Unauthenticated ORCID iD"
},
"create-author-dialog": {
"title": "Create a new author"
Expand Down
3 changes: 2 additions & 1 deletion resources/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@
"optional": "Facultatif",
"select-file": "Sélectionnez ou déposez le fichier ici",
"cant-download": "Vous n'êtes pas autorisé à télécharger ce fichier.",
"publication-previous-version": "Ceci est une version précédente de la publication"
"publication-previous-version": "Ceci est une version précédente de la publication",
"unauthenticated-orcid-id": "ORCID iD Non authentifié"
},
"create-author-dialog": {
"title": "Créer un nouvel auteur"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,19 @@ const removable = computed(() => {
</q-item>
<q-item v-if="manuscriptAuthor.data.author?.data.orcid">
<q-item-section avatar>
<OrcidAvatar />
<OrcidAvatar :unauthenticated="!manuscriptAuthor.data.author.data.orcid_verified" />
</q-item-section>
<q-item-section>
<a
class="text-primary"
:href="manuscriptAuthor.data.author?.data.orcid"
target="_blank"
>{{ manuscriptAuthor.data.author?.data.orcid }}</a>
<q-item-label>
<a
class="text-primary"
:href="manuscriptAuthor.data.author?.data.orcid"
target="_blank"
>{{ manuscriptAuthor.data.author?.data.orcid }}</a>
</q-item-label>
<q-item-label v-if="!manuscriptAuthor.data.author.data.orcid_verified" caption>
{{ $t('common.unauthenticated-orcid-id') }}
</q-item-label>
</q-item-section>
</q-item>
<q-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function goToManuscript(manuscript: ManuscriptRecordSummaryResource) {
>
<OrcidIcon
v-if="item.data.author?.data.orcid"
:unauthenticated="!item.data.author.data.orcid_verified"
/>
{{ item.data.author?.data.last_name }},
{{ item.data.author?.data.first_name }}
Expand Down

0 comments on commit 4e07c1e

Please sign in to comment.