Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 4ee93ef4 authored by Stefan Probst's avatar Stefan Probst
Browse files

feat: add orcid icon and affiliation to actor details

parent cfd2628d
Pipeline #193314 passed with stages
in 19 minutes and 2 seconds
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
<style type="text/css">
.st0{fill:#000000;}
.st1{fill:#FFFFFF;}
</style>
<path class="st0" d="M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z"/>
<g>
<path class="st1" d="M86.3,186.2H70.9V79.1h15.4v48.4V186.2z"/>
<path class="st1" d="M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5
c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z"/>
<path class="st1" d="M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1
C84.2,46.7,88.7,51.3,88.7,56.8z"/>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
<style type="text/css">
.st0{fill:#A6CE39;}
.st1{fill:#FFFFFF;}
</style>
<path class="st0" d="M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z"/>
<g>
<path class="st1" d="M86.3,186.2H70.9V79.1h15.4v48.4V186.2z"/>
<path class="st1" d="M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5
c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z"/>
<path class="st1" d="M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1
C84.2,46.7,88.7,51.3,88.7,56.8z"/>
</g>
</svg>
\ No newline at end of file
......@@ -1000,7 +1000,7 @@ export async function request<T = unknown>({
const data = await response.json()
if (typeof data.message === 'string') {
message = data.message
} else if (data.error !== undefined) {
} else if (data.error != null) {
if (typeof data.error === 'string') {
message = data.error
} else if (typeof data.error.message === 'string') {
......
......@@ -32,6 +32,7 @@ import { formatDate } from '@/utils/formatDate'
import { getSingularItemCategoryLabel } from '@/utils/getSingularItemCategoryLabel'
import type { RequiredFields } from '@/utils/ts/object'
import { Svg as UrlIcon } from '@@/assets/icons/url.svg'
import OrcidIcon from '@@/public/assets/images/orcid.svg'
/** lazy load markdown processor */
const Markdown = dynamic(() => import('@/modules/markdown/Markdown'))
......@@ -301,7 +302,7 @@ function ItemMedia({ media }: { media: Item['media'] }) {
/>
) : (
<div className="grid place-items-center">
<a href={currentMediaUrl} download>
<a href={currentMediaUrl} download rel="noopener noreferrer">
Download{' '}
{current.metadata?.filename ??
current.metadata?.location?.sourceUrl ??
......@@ -558,10 +559,39 @@ function useItemMetadata({
</span>
<ul className="flex flex-col space-y-2">
{actors.map((actor) => {
const orcid = actor.externalIds?.find(
(a) => a.identifierService?.code === 'ORCID',
)
return (
<li key={actor.id} className="flex flex-col">
<span className="mr-2 whitespace-nowrap">
{actor.name}
<span className="flex flex-wrap items-center">
<span className="mr-1.5">{actor.name}</span>
{orcid != null ? (
<a
href={`https://orcid.org/${orcid.identifier}`}
rel="noopener noreferrer"
target="_blank"
aria-label="ORCID"
className="flex-shrink-0 mr-1.5"
>
<img
src={OrcidIcon}
alt=""
aria-hidden
className="w-5 h-5"
/>
</a>
) : null}
{Array.isArray(actor.affiliations) &&
actor.affiliations.length > 0 ? (
<span className="mr-1.5 text-gray-550">
{actor.affiliations
.map((affiliation) => {
return affiliation.name
})
.join(', ')}
</span>
) : null}
</span>
{actor.email != null ? (
<Anchor href={'mailto:' + actor.email}>
......@@ -584,9 +614,9 @@ function useItemMetadata({
if (dateCreated != null || dateLastUpdated != null) {
metadata.dates = (
<dl className="py-8" key="item-dates">
<dl className="py-8 space-y-2" key="item-dates">
{dateCreated != null ? (
<div>
<div className="flex">
<dt>
<span className="mr-2 font-medium text-gray-550 whitespace-nowrap">
Created:
......@@ -598,10 +628,10 @@ function useItemMetadata({
</div>
) : null}
{dateLastUpdated != null ? (
<div>
<div className="flex">
<dt>
<span className="mr-2 font-medium text-gray-550 whitespace-nowrap">
Created:
Last updated:
</span>
</dt>
<dd>
......
......@@ -8766,7 +8766,7 @@ onetime@^5.1.0:
 
"openapi-ts-client@git+https://github.com/stefanprobst/openapi-ts-client":
version "0.1.0"
resolved "git+https://github.com/stefanprobst/openapi-ts-client#6f2d334e70e08bffd0723250767a71311afe13eb"
resolved "git+https://github.com/stefanprobst/openapi-ts-client#586456a491f2abf94d29c1fdaf85de435c1ac61b"
dependencies:
got "^11.6.0"
lodash.camelcase "^4.3.0"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment