forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11008 Primera versión vista del ítem; cambio tamaño font-size-base
- Loading branch information
Showing
42 changed files
with
705 additions
and
521 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
src/app/shared/metadata-field-wrapper/metadata-field-wrapper.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { MetadataValue } from 'src/app/core/shared/metadata.models'; | ||
import { Item } from 'src/app/core/shared/item.model'; | ||
|
||
// Métodos para obtener los valores de url y urn de ['dc.identifier.uri', 'sedici.identifier.other'] | ||
export function extractSuffix(identifier: string, prefixes: string[]): string { | ||
for (const prefix of prefixes) { | ||
const index = identifier.indexOf(prefix); | ||
if (index !== -1) { | ||
return identifier.substring(index + prefix.length).trim(); | ||
} | ||
} | ||
return identifier; | ||
} | ||
|
||
export function setUrl(urlBase: string, suffix: string): string { | ||
return urlBase + suffix; | ||
} | ||
|
||
export function setPersistentIdentifiers(object: Item, identifierOtherMetadataName: string[]): { mdValue: MetadataValue, label: string, url: string }[] { | ||
let itemIdentifiers = []; | ||
object.allMetadata(identifierOtherMetadataName).forEach( | ||
(mdValue, index) => { | ||
const identifierValue = mdValue.value.toLowerCase(); | ||
let label = ''; | ||
let url = ''; | ||
let urn = ''; | ||
let urlBase = ''; | ||
|
||
if (identifierValue.includes('doi') || identifierValue.startsWith('10.')) { | ||
label = 'DOI'; | ||
urn = extractSuffix(mdValue.value, ['https://doi.org/', 'http://dx.doi.org/', 'doi:', 'DOI:']); | ||
urlBase = 'https://doi.org/'; | ||
} else if (identifierValue.includes('hdl') || identifierValue.includes('handle')) { | ||
label = 'HDL'; | ||
urn = extractSuffix(mdValue.value, ['http://hdl.handle.net/', 'hdl:', '/handle/']); | ||
urlBase = 'http://hdl.handle.net/'; | ||
} else if (identifierValue.includes('arxiv')) { | ||
label = 'arXiv'; | ||
urn = extractSuffix(mdValue.value, ['/arxiv.org/abs/', '/arxiv.org/pdf/', '/archive.org/details/arxiv-', 'arxiv:', 'arXiv:']); | ||
urlBase = 'https://arxiv.org/abs/'; | ||
} else if (identifierValue.includes('pmcid') || identifierValue.includes('pmid')) { | ||
label = 'PubMed'; | ||
urn = extractSuffix(mdValue.value, ['pmid:', 'pmcid:']); | ||
urlBase = urn.startsWith('PMC') ? 'https://www.ncbi.nlm.nih.gov/pmc/articles/' : 'https://pubmed.ncbi.nlm.nih.gov/'; | ||
} else if (identifierValue.includes('ark')) { | ||
label = 'ARK'; | ||
urn = extractSuffix(mdValue.value, ['ark:']); | ||
urlBase = 'https://n2t.net/ark:/'; // VER | ||
} else { | ||
return; | ||
} | ||
|
||
if (identifierValue.startsWith('http')) { | ||
url = identifierValue; | ||
} else { | ||
url = setUrl(urlBase, urn); | ||
} | ||
|
||
const identifierListLength = itemIdentifiers.push({ | ||
mdValue: new MetadataValue(), | ||
label: label, | ||
url: url, | ||
}); | ||
itemIdentifiers[identifierListLength - 1].mdValue.value = urn; | ||
} | ||
); | ||
return itemIdentifiers; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<ng-container *ngVar="(breadcrumbs$ | async) as breadcrumbs"> | ||
<nav *ngIf="(showBreadcrumbs$ | async)" aria-label="breadcrumb" class="nav-breadcrumb"> | ||
<ol class="container breadcrumb my-0"> | ||
<ng-container *ngFor="let bc of breadcrumbs; let last = last;"> | ||
<ng-container *ngIf="!last"> | ||
<ng-container *ngTemplateOutlet="breadcrumb; context: bc"></ng-container> | ||
</ng-container> | ||
</ng-container> | ||
</ol> | ||
</nav> | ||
|
||
<ng-template #breadcrumb let-text="text" let-url="url"> | ||
<li class="breadcrumb-item"><div class="breadcrumb-item-limiter"><a [routerLink]="url" class="text-truncate" [ngbTooltip]="text | translate" placement="bottom" >{{text | translate}}</a></div></li> | ||
</ng-template> | ||
|
||
<ng-template #activeBreadcrumb let-text="text"> | ||
<li class="breadcrumb-item active" aria-current="page"><div class="breadcrumb-item-limiter"><div class="text-truncate">{{text | translate}}</div></div></li> | ||
</ng-template> | ||
</ng-container> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.nav-breadcrumb { | ||
background-color: var(--ds-breadcrumb-bg); | ||
} | ||
|
||
.breadcrumb { | ||
border-radius: 0; | ||
padding-bottom: calc(var(--ds-content-spacing) / 2); | ||
padding-top: calc(var(--ds-content-spacing) / 2); | ||
background-color: var(--ds-breadcrumb-bg); | ||
} | ||
|
||
li.breadcrumb-item { | ||
display: flex; | ||
} | ||
|
||
.breadcrumb-item-limiter { | ||
display: inline-block; | ||
max-width: var(--ds-breadcrumb-max-length); | ||
> * { | ||
max-width: 100%; | ||
display: block; | ||
} | ||
} | ||
|
||
li.breadcrumb-item { | ||
a { | ||
color: var(--ds-breadcrumb-link-color); | ||
} | ||
} | ||
|
||
li.breadcrumb-item.active { | ||
color: var(--ds-breadcrumb-link-active-color); | ||
} | ||
|
||
.breadcrumb-item+ .breadcrumb-item::before { | ||
display: block; | ||
content: quote(">") !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 16 additions & 15 deletions
31
...m-page/simple/field-components/badge-metadata-values/badge-metadata-values.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
<ds-metadata-field-wrapper [label]="label | translate" [inlineLabel]="false"> | ||
<a href="{{ badgeUrl }}" target="_blank" *ngIf="badgeUrl else badge"> | ||
<ng-container *ngTemplateOutlet="badge"></ng-container> | ||
</a> | ||
<a href="{{ badgeUrl }}" target="_blank" *ngIf="badgeUrl else badge"> | ||
<ng-container *ngTemplateOutlet="badge"></ng-container> | ||
</a> | ||
</ds-metadata-field-wrapper> | ||
|
||
<ng-template #badge> | ||
<div class="badge-group" [ngClass]="{'group-inline-block': badgeLabel}" *ngFor="let mdValue of mdValues"> | ||
<span class="badge badge-label" [ngClass]="badgeLabelType" *ngIf="badgeLabel"> | ||
{{badgeLabel}} | ||
</span> | ||
<span class="badge {{badgeType}}" [ngClass]="{'badge-content': badgeLabel}"> | ||
{{mdValue.value}} | ||
<ng-container *ngIf="copyToClipboardButton"> | ||
<span class="d-none" #elementContentToCopy>{{mdValue.value}}</span> | ||
<i id="copyButton-{{mdValue.value}}" class="copyButton fa fa-copy" aria-hidden="true" (click)="copyToClipboard(elementContentToCopy, 'copyButton-' + mdValue.value )"></i> | ||
</ng-container> | ||
</span> | ||
</div> | ||
<div class="badge-group" [ngClass]="{'group-inline-block': badgeLabel}" *ngFor="let mdValue of mdValues"> | ||
<span class="badge badge-label" [ngClass]="badgeLabelType" *ngIf="badgeLabel"> | ||
{{badgeLabel}} | ||
</span> | ||
<span class="badge {{badgeType}}" [ngClass]="{'badge-content': badgeLabel}"> | ||
<a *ngIf="url; else plainText" href="{{ url }}" target="_blank" class="no-format">{{ mdValue.value }}</a> | ||
<ng-template #plainText>{{ mdValue.value }}</ng-template> | ||
<ng-container *ngIf="copyToClipboardButton"> | ||
<span class="d-none" #elementContentToCopy>{{mdValue.value}}</span> | ||
<i id="copyButton-{{mdValue.value}}" class="copyButton fa fa-copy" aria-hidden="true" (click)="copyToClipboard(elementContentToCopy, 'copyButton-' + mdValue.value )"></i> | ||
</ng-container> | ||
</span> | ||
</div> | ||
</ng-template> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...ple/field-components/specific-field/identfier-other/item-page-identifier.other-field.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="item-page-field"> | ||
<ds-metadata-values | ||
[mdValues]="mdValues" | ||
[separator]="separator" | ||
[label]="label" | ||
></ds-metadata-values> | ||
</div> |
52 changes: 52 additions & 0 deletions
52
...imple/field-components/specific-field/identfier-other/item-page-identifier.other-field.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { | ||
Component, | ||
Input, | ||
} from '@angular/core'; | ||
|
||
import { Item } from 'src/app/core/shared/item.model'; | ||
import { MetadataValuesComponent } from 'src/app/item-page/field-components/metadata-values/metadata-values.component'; | ||
import { MetadataValue } from 'src/app/core/shared/metadata.models'; | ||
|
||
@Component({ | ||
selector: 'ds-item-page-identifier-other-field', | ||
templateUrl: './item-page-identifier.other-field.html', | ||
standalone: true, | ||
imports: [MetadataValuesComponent], | ||
}) | ||
|
||
export class ItemPageIdentifierOtherFieldComponent{ | ||
|
||
/** | ||
* The item to display metadata for | ||
*/ | ||
@Input() item: Item; | ||
|
||
/** | ||
* Fields (schema.element.qualifier) used to render their values. | ||
*/ | ||
fields: string[] = ['sedici.identifier.other']; | ||
|
||
/** | ||
* Label i18n key for the rendered metadata | ||
*/ | ||
label: string = 'Otros idenfiticadores'; | ||
|
||
/** | ||
* Separator string between multiple values of the metadata fields defined | ||
* @type {string} | ||
*/ | ||
separator = '<br/>'; | ||
|
||
mdValues: MetadataValue[]; | ||
|
||
ngOnInit() { | ||
this.selectNotPersistentIdentifiers(); | ||
} | ||
|
||
selectNotPersistentIdentifiers(): void { | ||
const persistentIdentifiers = ['doi', 'DOI', 'handle', 'hdl', 'arxiv', 'arXiv', 'pmcid', 'pmid', 'ark']; | ||
this.mdValues = this.item.allMetadata(this.fields).filter(mdValue => { | ||
return !persistentIdentifiers.some(identifier => mdValue.value.includes(identifier)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div *ngVar="(itemRD$ | async) as itemRD"> | ||
<div class="item-page" *ngIf="itemRD?.hasSucceeded" @fadeInOut> | ||
<div *ngIf="itemRD?.payload as item"> | ||
<ds-item-alerts [item]="item"></ds-item-alerts> | ||
<ds-qa-event-notification [item]="item"></ds-qa-event-notification> | ||
<ds-notify-requests-status [itemUuid]="item.uuid"></ds-notify-requests-status> | ||
<ds-item-versions-notice [item]="item"></ds-item-versions-notice> | ||
<ds-view-tracker [object]="item"></ds-view-tracker> | ||
<ds-listable-object-component-loader *ngIf="!item.isWithdrawn || (isAdmin$|async)" [object]="item" [viewMode]="viewMode"></ds-listable-object-component-loader> | ||
<ds-item-versions class="mt-2" [item]="item" [displayActions]="false"></ds-item-versions> | ||
</div> | ||
</div> | ||
<ds-error *ngIf="itemRD?.hasFailed" message="{{'error.item' | translate}}"></ds-error> | ||
<ds-loading *ngIf="itemRD?.isLoading" message="{{'loading.item' | translate}}"></ds-loading> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.