-
Notifications
You must be signed in to change notification settings - Fork 2
MENDELU/ORCID Authority #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: customer/mendelu
Are you sure you want to change the base?
MENDELU/ORCID Authority #1261
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| .orcid-author { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
| } | ||
|
|
||
| .ds-orcid-link { | ||
| text-decoration: none; | ||
| color: inherit; | ||
|
|
||
| &:hover { | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
|
|
||
| .orcid-badge { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| text-decoration: none; | ||
|
|
||
| &:hover { | ||
| opacity: 0.8; | ||
| } | ||
| } | ||
|
|
||
| .orcid-icon { | ||
| width: 16px; | ||
| height: 16px; | ||
| vertical-align: middle; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| .orcid-author { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: 0.25rem; | ||
| } | ||
|
|
||
| .orcid-link { | ||
| text-decoration: none; | ||
| color: inherit; | ||
|
|
||
| &:hover { | ||
| text-decoration: underline; | ||
| } | ||
| } | ||
|
|
||
| .orcid-badge { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| text-decoration: none; | ||
|
|
||
| &:hover { | ||
| opacity: 0.8; | ||
| } | ||
| } | ||
|
|
||
| .orcid-icon { | ||
| width: 16px; | ||
| height: 16px; | ||
| vertical-align: middle; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,16 @@ | ||
|
|
||
| import { Component } from '@angular/core'; | ||
|
Check failure on line 2 in src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts
|
||
| import { RouterLink } from '@angular/router'; | ||
|
|
||
| import { VALUE_LIST_BROWSE_DEFINITION } from '../../../../core/shared/value-list-browse-definition.resource-type'; | ||
| import { MetadatumRepresentation } from '../../../../core/shared/metadata-representation/metadatum/metadatum-representation.model'; | ||
| import { hasValue } from '../../../empty.util'; | ||
| import { MetadataRepresentationListElementComponent } from '../metadata-representation-list-element.component'; | ||
|
|
||
| @Component({ | ||
| selector: 'ds-plain-text-metadata-list-element', | ||
| templateUrl: './plain-text-metadata-list-element.component.html', | ||
| styleUrls: ['./plain-text-metadata-list-element.component.scss'], | ||
| standalone: true, | ||
| imports: [ | ||
| RouterLink, | ||
|
|
@@ -31,4 +34,24 @@ | |
| } | ||
| return queryParams; | ||
| } | ||
|
|
||
| /** | ||
| * Check if this metadata representation has an ORCID authority | ||
| */ | ||
| isOrcidAuthority(): boolean { | ||
| const metadatum = this.mdRepresentation as MetadatumRepresentation; | ||
| if (!hasValue(metadatum.authority)) { | ||
| return false; | ||
| } | ||
| const orcidPattern = /^\d{4}-\d{4}-\d{4}-\d{4}$/; | ||
| return orcidPattern.test(metadatum.authority); | ||
|
Comment on lines
+42
to
+47
|
||
| } | ||
|
|
||
| /** | ||
| * Get the ORCID profile URL | ||
| */ | ||
| getOrcidUrl(): string { | ||
| const metadatum = this.mdRepresentation as MetadatumRepresentation; | ||
| return `https://orcid.org/${encodeURIComponent(metadatum.authority)}`; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ORCID iDs can have an "X" as the final check digit; the regex
^\d{4}-\d{4}-\d{4}-\d{4}$will reject valid ORCIDs ending in X. Update the pattern (and consider making it a shared constant since the same regex/URL is now duplicated in multiple components).