bugfix: adds check for scheme 'doi'

This commit is contained in:
Mojib Wali
2021-03-17 17:11:00 +01:00
committed by GitHub
parent db01116eeb
commit ea54a17c43
2 changed files with 14 additions and 3 deletions

View File

@@ -29,8 +29,12 @@ export class DoiMint extends Component {
this.metadata.identifiers.length > 0 &&
this.metadata.identifiers[0] != null
) {
this.is_doi = true;
this.id_doi = this.metadata.identifiers[0].identifier;
for(var identifier of this.metadata.identifiers){
if (identifier.scheme == "doi"){
this.is_doi = true;
this.id_doi = identifier.identifier;
}
}
}
// add metadata to the state

View File

@@ -7,7 +7,11 @@
#}
{% if metadata.identifiers %}
{%- set id_doi = metadata.identifiers[0].identifier %}
{% for identifier in metadata.identifiers %}
{% if identifier.scheme == 'doi' %}
{%- set id_doi = identifier.identifier %}
<dd>
{% if id_doi %}
<span class="get-badge" data-toggle="tooltip" data-placement="bottom" style="cursor: pointer;"
@@ -34,3 +38,6 @@
{% endif %}
</dd>
{% endif %}
{% endfor %}
{% endif %}