Skip to content

Commit

Permalink
Merge branch 'main' into dev-20221212
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Rosenberg authored and Jake Rosenberg committed Dec 12, 2023
2 parents f1ab8ff + 4568564 commit ab8aaac
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 31 deletions.
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"
]
}

0 comments on commit ab8aaac

Please sign in to comment.