Commit 0ec781b3 authored by Alicia.DeDiosFuente's avatar Alicia.DeDiosFuente
Browse files

fix:add contributor tooltip

parent d3296eb4
......@@ -85,7 +85,10 @@
<div>
<span class="label">{{labelTranslateEnum.contributors | translate}}</span>
<ul class="list-contributors">
<li *ngFor="let contributor of archive.contributors">
<li *ngFor="let contributor of archive.contributors"
[matTooltip]="contributor"
[matTooltipPosition]="'above'"
>
{{contributor}}
</li>
</ul>
......
export interface ArchiveContributor {
name: string;
orcid: string
affiliationName: string;
}
import {Enums} from "@enums";
import {ArchiveContributor} from "@home/models/archive-contributor.model";
import {ArchiveMetadata} from "@shared/models/business/archive-metadata.model";
export interface Archive {
......@@ -14,7 +15,7 @@ export interface Archive {
dataSensitivityToTranslate: string;
accessLevel: Enums.Deposit.AccessEnum;
accessLevelToTranslate: string;
contributors: string[];
contributors: ArchiveContributor[];
archiveMetadata: ArchiveMetadata;
withThumbnail: boolean;
}
......@@ -3,6 +3,7 @@ import {
MetadataEnum,
} from "@app/shared/models/business/archive-metadata.model";
import {Enums} from "@enums";
import {ArchiveContributor} from "@home/models/archive-contributor.model";
import {
isNullOrUndefined,
isTrue,
......@@ -113,13 +114,20 @@ export class MetadataUtil {
return this.getInformation(xpath, metadata);
}
static getContributors(metadata: Metadata): string[] {
const xpath = "/d:resource/d:creators/d:creator/d:creatorName";
const results = [];
static getContributors(metadata: Metadata): ArchiveContributor[] {
const creatorPath = "/d:resource/d:creators/d:creator";
const creatorNamePath = "/d:resource/d:creators/d:creator/d:creatorName";
const affiliationPath = "/d:resource/d:creators/d:creator/d:affiliation";
const doiPath = "/d:resourced:creators/d:creator/d:identifier[@identifierType='DOI']";
const results: ArchiveContributor[] = [];
const xmlDoc = this.parse(metadata[MetadataEnum.dataciteXml]);
const result = xmlDoc.evaluate(xpath, xmlDoc, this.prefixNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
const result = xmlDoc.evaluate(creatorPath, xmlDoc, this.prefixNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0, length = result.snapshotLength; i < length; ++i) {
results.push(result.snapshotItem(i).textContent);
console.error("getContributors");
console.error(result);
console.error(result.snapshotLength);
// results.push(result.snapshotItem(i).textContent);
}
return results;
}
......
Supports Markdown
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