Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DLCM
UI
DLCM-Portal
Commits
0ec781b3
Commit
0ec781b3
authored
Oct 14, 2020
by
Alicia.DeDiosFuente
Browse files
fix:add contributor tooltip
parent
d3296eb4
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/app/features/home/components/presentationals/home-archive-form/home-archive-detail.presentational.html
View file @
0ec781b3
...
...
@@ -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>
...
...
src/app/features/home/models/archive-contributor.model.ts
0 → 100644
View file @
0ec781b3
export
interface
ArchiveContributor
{
name
:
string
;
orcid
:
string
affiliationName
:
string
;
}
src/app/features/home/models/archive.model.ts
View file @
0ec781b3
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
;
}
src/app/shared/utils/metadata.util.ts
View file @
0ec781b3
...
...
@@ -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
(
xp
ath
,
xmlDoc
,
this
.
prefixNSResolver
,
XPathResult
.
ORDERED_NODE_SNAPSHOT_TYPE
,
null
);
const
result
=
xmlDoc
.
evaluate
(
creatorP
ath
,
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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment