Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/des 2558 updates to metadata #1134

Merged
merged 12 commits into from
Dec 12, 2023
52 changes: 29 additions & 23 deletions designsafe/apps/api/publications/search_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ def simulation_type_query(simulation_type):

def nh_type_query(nh_type):
NON_OTHER_NH_TYPES = [
"Drought",
"Earthquake",
"Extreme Temperatures",
"Fire",
"Wildfire",
"Flood",
"Hurricane/Tropical Storm",
"Landslide",
Expand All @@ -62,7 +64,8 @@ def nh_type_query(nh_type):
"Thunderstorm",
"Storm Surge",
"Pandemic",
"Wind"
"Wind",
"Other"
]
if nh_type == "Other":
return ~Q({'terms': {'project.value.nhTypes.keyword': NON_OTHER_NH_TYPES}})
Expand All @@ -79,28 +82,31 @@ def other_facility_query(facility):

def other_type_query(data_type):
data_types = [
'Benchmark Dataset',
'Check Sheet',
'Code',
'Database',
'Dataset',
'Field Survey',
'Image',
'Jupyter Notebook',
'Learning Object',
'Model',
'Paper',
'Proceeding',
'Poster',
'Presentation',
'Report',
'Reseach Experience for Undergraduates',
'SimCenter Testbed',
'Social Sciences',
'Survey Instrument',
'Testbed',
'Video',
'White Paper',
"Archival Materials",
"Audio",
"Benchmark Dataset",
"Check Sheet",
"Code",
"Database",
"Dataset",
"Engineering",
"Image",
"Interdisciplinary",
"Jupyter Notebook",
"Learning Object",
"Model",
"Paper",
"Proceeding",
"Poster",
"Presentation",
"Report",
"Research Experience for Undergraduates",
"SimCenter Testbed",
"Social Sciences",
"Survey Instrument",
"Testbed",
"Video",
"Other"
]
if data_type == 'Other':
return ~Q({'terms': {'project.value.dataType.keyword': data_types}}) # | ~Q({'exists', {'field': 'project.value.dataType.keyword'}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,16 @@ <h3 class="text-center">
style="margin-bottom: 5px;"
ng-options="item for item in $ctrl.fieldResearchTypes"
ng-model="$ctrl.form.frTypes[$index]"
ng-required="$first">
ng-required="$first"
ng-if="!$ctrl.isOther($ctrl.form.frTypes[$index], $ctrl.fieldResearchTypes)">
<option value="">-- Select Field Research Type --</option>
</select>
<div ng-if="$ctrl.isOther($ctrl.form.frTypes[$index], $ctrl.fieldResearchTypes)">
<input type="text"
ng-model="$ctrl.form.frTypes[$index]"
class="form-control"
/>
</div>
</div>
<button class="btn-project-add-rm"
ng-click="$ctrl.addField($ctrl.form.frTypes)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"Cited By"
],
"nhTypes": [
"Other",
"Drought",
"Earthquake",
"Extreme Temperatures",
"Fire",
"Wildfire",
"Flood",
"Hurricane/Tropical Storm",
"Landslide",
Expand All @@ -21,26 +22,33 @@
"Thunderstorm",
"Storm Surge",
"Pandemic",
"Wind"
"Wind",
"Other"
],
"frTypes": [
"Engineering",
"Field Experiment",
"Geosciences",
"Public Health",
"Social Sciences",
"Interdisciplinary",
"Field Experiment",
"Cross-Sectional Study",
"Longitudinal Study",
"Reconnaissance",
"Something Else",
"Social Sciences"
"Other"

],
"otherTypes": [
"Archival Materials",
"Audio",
"Benchmark Dataset",
"Check Sheet",
"Code",
"Database",
"Dataset",
"Field Survery",
"Engineering",
"Image",
"Interdisciplinary",
"Jupyter Notebook",
"Learning Object",
"Model",
Expand All @@ -55,7 +63,6 @@
"Survey Instrument",
"Testbed",
"Video",
"White Paper",
"Other"
]
}