about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-05 13:45:45 -0500
committerFrederick Muriuki Muriithi2025-05-05 16:20:10 -0500
commit5e5ac256740e7e0e44e09111b9015c2960fb4fa3 (patch)
tree0f73742d027825efedfbf52d3d740b31521d4238
parentdb018a349d812df6432cc73320e18f3db5e1dccd (diff)
downloadgn-uploader-5e5ac256740e7e0e44e09111b9015c2960fb4fa3.tar.gz
Provide endpoint for loading data after QC is successful.
-rw-r--r--uploader/phenotypes/views.py19
-rw-r--r--uploader/templates/phenotypes/review-job-data.html12
2 files changed, 30 insertions, 1 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 20b95e2..00ecadb 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -606,6 +606,25 @@ def review_job_data(
                                activelink="add-phenotypes")
 
 
+@phenotypesbp.route(
+    "<int:species_id>/populations/<int:population_id>/phenotypes/datasets"
+    "/<int:dataset_id>/load-data-to-database",
+    methods=["POST"])
+@require_login
+@with_dataset(
+    species_redirect_uri="species.populations.phenotypes.index",
+    population_redirect_uri="species.populations.phenotypes.select_population",
+    redirect_uri="species.populations.phenotypes.list_datasets")
+def load_data_to_database(
+        species: dict,
+        population: dict,
+        dataset: dict,
+        **kwargs
+):# pylint: disable=[unused-argument]
+    """Load the data from the given QC job into the database."""
+    raise NotImplemented("This feature is yet to be implemented!")
+
+
 def update_phenotype_metadata(conn, metadata: dict):
     """Update a phenotype's basic metadata values."""
     with conn.cursor(cursorclass=DictCursor) as cursor:
diff --git a/uploader/templates/phenotypes/review-job-data.html b/uploader/templates/phenotypes/review-job-data.html
index befb5e2..1343c19 100644
--- a/uploader/templates/phenotypes/review-job-data.html
+++ b/uploader/templates/phenotypes/review-job-data.html
@@ -68,7 +68,17 @@
   {%endfor%}
   </ul>
 
-  <a href="#" class="not-implemented btn btn-primary">continue</a>
+  <form id="frm-review-phenotype-data"
+        method="POST"
+        action="{{url_for('species.populations.phenotypes.load_data_to_database',
+                species_id=species.SpeciesId,
+                population_id=population.Id,
+                dataset_id=dataset.Id)}}">
+    <input type="hidden" name="data-qc-job-id" value="{{job.jobid}}" />
+    <input type="submit"
+           value="continue"
+           class="btn btn-primary" />
+  </form>
 </div>
 {%else%}
 <div class="row">