@@ -56,6 +56,12 @@ def load_description_dict_from_schema(schema: dict) -> dict[str, str]:
56
56
if desc and key not in description_dict :
57
57
description_dict [key ] = desc
58
58
59
+ ## Define descriptions for tabs
60
+ description_dict ['GeneralInformation' ] = "This section gives general information about the software."
61
+ description_dict ['Provenance' ] = "This section describes the creation history of the software."
62
+ description_dict ['RelatedPersons' ] = "This section lists all relevant persons who are connected to the software."
63
+ description_dict ['TechnicalAspects' ] = "This section describes the technical aspects of the software."
64
+
59
65
return description_dict
60
66
61
67
# Define required field_type per element
@@ -94,15 +100,16 @@ def define_field_type(schema: dict, types: dict, array = False) -> dict[str, str
94
100
else :
95
101
type_dict [key ] = "single_input_object"
96
102
elif value .get ("type" ) == "string" :
97
- type_dict [key ] = "long_field" if key == "description" else "single_inputs"
103
+ if key == "description" :
104
+ type_dict [key ] = "big_field"
105
+ elif key == "abstract" :
106
+ type_dict [key ] = "long_field"
107
+ else :
108
+ type_dict [key ] = "single_inputs"
98
109
elif value .get ("type" ) == "array" :
99
110
items = value .get ("items" , {}) # Safely get "items" or default to an empty dict
100
- if "enum" in items :
101
- enum_values = items .get ("enum" )
102
- if enum_values is not None and len (enum_values ) > 10 :
103
- type_dict [key ] = "tagging_autocomplete"
104
- else :
105
- type_dict [key ] = "tagging_dropdown"
111
+ if "enum" in items :
112
+ type_dict [key ] = "tagging_autocomplete"
106
113
elif items .get ("type" ) == "string" :
107
114
type_dict [key ] = "tagging"
108
115
elif "$ref" in items :
@@ -205,7 +212,7 @@ def create_empty_metadata(schema: dict) -> dict[str, dict[str, str]]:
205
212
properties_list = load_properties_list_from_schema (schema )
206
213
metadata = {"GeneralInformation" : create_empty_metadata_dict_from_properties_list (properties_list , schema , "name" , "copyrightHolder" ),
207
214
"Provenance" : create_empty_metadata_dict_from_properties_list (properties_list , schema , "softwareVersion" , "funding" ),
208
- "Contributors " : create_empty_metadata_dict_from_properties_list (properties_list , schema , "contributor" , "maintainer" ),
215
+ "RelatedPersons " : create_empty_metadata_dict_from_properties_list (properties_list , schema , "contributor" , "maintainer" ),
209
216
"TechnicalAspects" : create_empty_metadata_dict_from_properties_list (properties_list , schema , "downloadUrl" , "targetProduct" )
210
217
}
211
218
return metadata
0 commit comments