From be754d50efa16b56f98fa27493a53bf587e733d0 Mon Sep 17 00:00:00 2001 From: Mirjan Hoffmann Date: Mon, 12 Feb 2024 07:43:36 +0100 Subject: [PATCH 1/2] fixed license import Ref https://gitlab.com/oersi/metadata-form/-/issues/8 --- metadata-generator.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata-generator.html b/metadata-generator.html index 33dc696..51e60a6 100644 --- a/metadata-generator.html +++ b/metadata-generator.html @@ -772,6 +772,7 @@ const aboutIds = data.about ? data.about.map(idMap) : []; const learningResourceTypeIds = data.learningResourceType ? data.learningResourceType.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"; $("#datepicker1").datepicker("update", new Date(data.datePublished)); @@ -782,7 +783,7 @@ document.getElementById("inputDescription").value = data.description ? data.description : ""; $('#inputLanguage').val(data.inLanguage ? data.inLanguage : []).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 : ""; $('#inputResourceType').val(learningResourceTypeIds).selectpicker('refresh'); if (educationalLevelIds.length > 0) { From 85629206a3a6f31a12084c518c7cfab03ccdf511 Mon Sep 17 00:00:00 2001 From: Mirjan Hoffmann Date: Mon, 12 Feb 2024 10:45:01 +0100 Subject: [PATCH 2/2] fixed import of institutions that are not listed in the fix institution-list Ref https://gitlab.com/oersi/metadata-form/-/issues/8 --- metadata-generator.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/metadata-generator.html b/metadata-generator.html index 51e60a6..68b075b 100644 --- a/metadata-generator.html +++ b/metadata-generator.html @@ -528,6 +528,14 @@ institutionOptions += ''; organizationOptions += ''; }); + if (institution?.length > 0 && !vocabInstitutions.find((e) => e["ror"] === institution)) { + if (affiliationName?.length > 0) { + institutionOptions += ''; + } + if (organizationName?.length > 0) { + organizationOptions += ''; + } + } let customInstitutionSelected = institution === "" && affiliationName !== ""; let customOrganizationSelected = institution === "" && organizationName !== ""; let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : ''