mirror of
https://gitlab.com/comenius-institut/foerbico/metadata-form.git
synced 2025-12-10 08:44:31 +00:00
Merge branch '8-creator-affiliation-and-license-are-not-set-correctly-during-import' into 'master'
Resolve "Creator affiliation and license are not set correctly during import" See merge request oersi/metadata-form!12
This commit is contained in:
commit
88f71e5d96
1 changed files with 10 additions and 1 deletions
|
|
@ -528,6 +528,14 @@
|
||||||
institutionOptions += '<option value="' + item["ror"] + '"' + (item["ror"] === institution ? ' selected' : '') + '>' + item["label"] + '</option>';
|
institutionOptions += '<option value="' + item["ror"] + '"' + (item["ror"] === institution ? ' selected' : '') + '>' + item["label"] + '</option>';
|
||||||
organizationOptions += '<option value="' + item["ror"] + '"' + (item["ror"] === institution ? ' selected' : '') + '>' + item["label"] + '</option>';
|
organizationOptions += '<option value="' + item["ror"] + '"' + (item["ror"] === institution ? ' selected' : '') + '>' + item["label"] + '</option>';
|
||||||
});
|
});
|
||||||
|
if (institution?.length > 0 && !vocabInstitutions.find((e) => e["ror"] === institution)) {
|
||||||
|
if (affiliationName?.length > 0) {
|
||||||
|
institutionOptions += '<option value="' + institution + '"' + ' selected>' + affiliationName + '</option>';
|
||||||
|
}
|
||||||
|
if (organizationName?.length > 0) {
|
||||||
|
organizationOptions += '<option value="' + institution + '"' + ' selected>' + organizationName + '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
let customInstitutionSelected = institution === "" && affiliationName !== "";
|
let customInstitutionSelected = institution === "" && affiliationName !== "";
|
||||||
let customOrganizationSelected = institution === "" && organizationName !== "";
|
let customOrganizationSelected = institution === "" && organizationName !== "";
|
||||||
let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : ''
|
let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : ''
|
||||||
|
|
@ -772,6 +780,7 @@
|
||||||
const aboutIds = data.about ? data.about.map(idMap) : [];
|
const aboutIds = data.about ? data.about.map(idMap) : [];
|
||||||
const learningResourceTypeIds = data.learningResourceType ? data.learningResourceType.map(idMap) : [];
|
const learningResourceTypeIds = data.learningResourceType ? data.learningResourceType.map(idMap) : [];
|
||||||
const educationalLevelIds = data.educationalLevel ? data.educationalLevel.map(idMap) : [];
|
const educationalLevelIds = data.educationalLevel ? data.educationalLevel.map(idMap) : [];
|
||||||
|
const licenseUrl = data.license ? idMap(data.license) : ""
|
||||||
|
|
||||||
document.getElementById("inputStatus").value = data.creativeWorkStatus ? data.creativeWorkStatus : "Draft";
|
document.getElementById("inputStatus").value = data.creativeWorkStatus ? data.creativeWorkStatus : "Draft";
|
||||||
$("#datepicker1").datepicker("update", new Date(data.datePublished));
|
$("#datepicker1").datepicker("update", new Date(data.datePublished));
|
||||||
|
|
@ -782,7 +791,7 @@
|
||||||
document.getElementById("inputDescription").value = data.description ? data.description : "";
|
document.getElementById("inputDescription").value = data.description ? data.description : "";
|
||||||
$('#inputLanguage').val(data.inLanguage ? data.inLanguage : []).selectpicker('refresh');
|
$('#inputLanguage').val(data.inLanguage ? data.inLanguage : []).selectpicker('refresh');
|
||||||
$('#inputSubjectOf').val(aboutIds).selectpicker('refresh');
|
$('#inputSubjectOf').val(aboutIds).selectpicker('refresh');
|
||||||
setLicense((data.license && data.license.id) ? idMap(data.license) : "")
|
setLicense(licenseUrl)
|
||||||
document.getElementById("inputImage").value = data.image ? data.image : "";
|
document.getElementById("inputImage").value = data.image ? data.image : "";
|
||||||
$('#inputResourceType').val(learningResourceTypeIds).selectpicker('refresh');
|
$('#inputResourceType').val(learningResourceTypeIds).selectpicker('refresh');
|
||||||
if (educationalLevelIds.length > 0) {
|
if (educationalLevelIds.length > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue