From 9ee4936814ad41f74cc80345a3e7217c8c0efc10 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 13 Feb 2018 12:11:12 +0100
Subject: [PATCH] when adding project include version and organism properly

---
 .../src/main/js/gui/admin/AddProjectDialog.js        |  7 ++++++-
 .../src/test/js/gui/admin/AddProjectDialog-test.js   | 12 ++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/frontend-js/src/main/js/gui/admin/AddProjectDialog.js b/frontend-js/src/main/js/gui/admin/AddProjectDialog.js
index d9eb87fa1d..bb29ff5b38 100644
--- a/frontend-js/src/main/js/gui/admin/AddProjectDialog.js
+++ b/frontend-js/src/main/js/gui/admin/AddProjectDialog.js
@@ -738,7 +738,11 @@ AddProjectDialog.prototype.getDisease = function () {
 AddProjectDialog.prototype.getOrganism = function () {
   return $("[name='project-organism']", this.getElement()).val();
 };
-AddProjectDialog.prototype.getOrganism = function () {
+AddProjectDialog.prototype.setOrganism = function (organism) {
+  $("[name='project-organism']", this.getElement()).val(organism);
+};
+
+AddProjectDialog.prototype.getVersion = function () {
   return $("[name='project-version']", this.getElement()).val();
 };
 AddProjectDialog.prototype.getNotifyEmail = function () {
@@ -834,6 +838,7 @@ AddProjectDialog.prototype.onSaveClicked = function () {
       "cache": self.isCache(),
       "notify-email": self.getNotifyEmail(),
       "disease": self.getDisease(),
+      "version": self.getVersion(),
       "organism": self.getOrganism(),
       "sbgn": self.isSbgn(),
       "semantic-zoom": self.isSemanticZooming(),
diff --git a/frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js b/frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
index f76d54a2d7..001ebcf429 100644
--- a/frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
+++ b/frontend-js/src/test/js/gui/admin/AddProjectDialog-test.js
@@ -150,6 +150,8 @@ describe('AddProjectDialog', function () {
         assert.ok(options["disease"] !== undefined);
         assert.ok(options["organism"] !== undefined);
         assert.ok(options["sbgn"] !== undefined);
+        assert.ok(options["version"] !== undefined);
+
         assert.ok(options["semantic-zoom"] !== undefined);
       }).finally(function () {
         return dialog.destroy();
@@ -157,6 +159,16 @@ describe('AddProjectDialog', function () {
     });
   });
 
+  it('getOrganism', function () {
+    var dialog = new AddProjectDialog({
+      element: testDiv,
+      customMap: null
+    });
+    dialog.setOrganism("9606");
+    assert.equal("9606", dialog.getOrganism());
+    return dialog.destroy();
+  });
+
   describe('checkValidity', function () {
     it('invalid project name', function () {
       var dialog = new AddProjectDialog({
-- 
GitLab