From 45685645d51f67bf35d401eae1c52ad15dd7b2b6 Mon Sep 17 00:00:00 2001 From: Van Go <35277477+van-go@users.noreply.github.com> Date: Tue, 12 Dec 2023 12:13:07 -0600 Subject: [PATCH] Task/des 2558 updates to metadata (#1134) * commit to main * task/des-2558-edit-dataType, frType, nhType lists * dataType as text * docker file * docker file * docker file * add Wildfire; does not replace Fire * add Wildfire; does not replace Fire * docker file fix --------- Co-authored-by: Jake Rosenberg --- .../apps/api/publications/search_utils.py | 52 +++++++++++-------- .../manage-project.template.html | 9 +++- .../manage-project/project-form-options.json | 21 +++++--- 3 files changed, 51 insertions(+), 31 deletions(-) diff --git a/designsafe/apps/api/publications/search_utils.py b/designsafe/apps/api/publications/search_utils.py index a670852ee4..9e60f23b84 100644 --- a/designsafe/apps/api/publications/search_utils.py +++ b/designsafe/apps/api/publications/search_utils.py @@ -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", @@ -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}}) @@ -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'}}) diff --git a/designsafe/static/scripts/projects/components/manage-project/manage-project.template.html b/designsafe/static/scripts/projects/components/manage-project/manage-project.template.html index 3b6802abf4..9d80fa185e 100644 --- a/designsafe/static/scripts/projects/components/manage-project/manage-project.template.html +++ b/designsafe/static/scripts/projects/components/manage-project/manage-project.template.html @@ -168,9 +168,16 @@

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)"> +
+ +