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.length > 0 &&
this.metadata.identifiers[0] != null this.metadata.identifiers[0] != null
) { ) {
this.is_doi = true; for(var identifier of this.metadata.identifiers){
this.id_doi = this.metadata.identifiers[0].identifier; if (identifier.scheme == "doi"){
this.is_doi = true;
this.id_doi = identifier.identifier;
}
}
} }
// add metadata to the state // add metadata to the state

View File

@@ -7,7 +7,11 @@
#} #}
{% if metadata.identifiers %} {% 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> <dd>
{% if id_doi %} {% if id_doi %}
<span class="get-badge" data-toggle="tooltip" data-placement="bottom" style="cursor: pointer;" <span class="get-badge" data-toggle="tooltip" data-placement="bottom" style="cursor: pointer;"
@@ -34,3 +38,6 @@
{% endif %} {% endif %}
</dd> </dd>
{% endif %} {% endif %}
{% endfor %}
{% endif %}