Commit b978534a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '963-fields-in-add-project-window-are-empty-after-1st-displaying' into 'master'

Resolve "Fields in Add project window are empty after 1st displaying"

Closes #963

See merge request !968
parents 45b5dfd5 a94589aa
minerva (14.0.3) stable; urgency=medium minerva (14.0.3) stable; urgency=medium
* Bug fix: sbml parser had sometimes problems with combining layout and multi * Bug fix: sbml parser had sometimes problems with combining layout and multi
packages (#966) packages (#966)
* Bug fix: parsing of CellDesigner files that contained substanceUnits could * Bug fix: parsing of CellDesigner files that contained substanceUnits could
crash the upload (#985) crash the upload (#985)
* Bug fix: verificatin of version length added when uploading project * Bug fix: verificatin of version length added when uploading project
implemented (#978) implemented (#978)
* Bug fix: CLEAR button disappeard when plugin tab used to much space (#976) * Bug fix: CLEAR button disappeard when plugin tab used to much space (#976)
* Bug fix: removing data overlay refreshes list of overlays in info window * Bug fix: removing data overlay refreshes list of overlays in info window
(#974) (#974)
* Bug fix: general overlays are always on top of data overlays in info window * Bug fix: general overlays are always on top of data overlays in info window
(#975) (#975)
* Bug fix: refresh button in overlay panel synchronise list of general and * Bug fix: refresh button in overlay panel synchronise list of general and
user provided data overlays (#975) user provided data overlays (#975)
* Bug fix: changing order of data overlays is reflected in info window * Bug fix: changing order of data overlays is reflected in info window
* Bug fix: opening map with no available background crashed (#964) * Bug fix: opening map with no available background crashed (#964)
* Bug fix: uploading SBGN file that does not pass xsd validation provides a * Bug fix: uploading SBGN file that does not pass xsd validation provides a
warning, but does not fail upload (#937) warning, but does not fail upload (#937)
* Bug fix: export of the map to SBML that was imported with older version * Bug fix: export of the map to SBML that was imported with older version
(below 14.0.0) didn't produce valid SBML (#970) (below 14.0.0) didn't produce valid SBML (#970)
* Bug fix: fields in add project window are reinitialized after each open
(#963)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 16 Oct 2019 9:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 16 Oct 2019 9:00:00 +0200
......
...@@ -218,13 +218,11 @@ AddProjectDialog.prototype.createGeneralTabContent = function () { ...@@ -218,13 +218,11 @@ AddProjectDialog.prototype.createGeneralTabContent = function () {
table.appendChild(self.createInputRow({ table.appendChild(self.createInputRow({
labelName: "ProjectId:", labelName: "ProjectId:",
defaultValue: "id",
inputName: "project-id", inputName: "project-id",
help: 'A working name of the uploaded project on the MINERVA platform. Unique in the platform.' help: 'A working name of the uploaded project on the MINERVA platform. Unique in the platform.'
})); }));
table.appendChild(self.createInputRow({ table.appendChild(self.createInputRow({
labelName: "Project name:", labelName: "Project name:",
defaultValue: "NEW DISEASE MAP",
inputName: "project-name", inputName: "project-name",
help: 'The name of the uploaded project displayed in the top left corner of the Admin and User panels; your official name of the project.' help: 'The name of the uploaded project displayed in the top left corner of the Admin and User panels; your official name of the project.'
})); }));
...@@ -753,7 +751,6 @@ AddProjectDialog.prototype.init = function () { ...@@ -753,7 +751,6 @@ AddProjectDialog.prototype.init = function () {
select = $("[name='project-map-canvas-type']", self.getElement())[0]; select = $("[name='project-map-canvas-type']", self.getElement())[0];
self._fillMapCanvasTypeSelectOptions(select, configuration); self._fillMapCanvasTypeSelectOptions(select, configuration);
return self.getServerConnector().getLoggedUser().then(function (user) { return self.getServerConnector().getLoggedUser().then(function (user) {
self.setNotifyEmail(user.getEmail());
self.bindProjectUploadPreferences(user, "annotateModel", "project-annotate-automatically"); self.bindProjectUploadPreferences(user, "annotateModel", "project-annotate-automatically");
self.bindProjectUploadPreferences(user, "autoResize", "project-auto-margin"); self.bindProjectUploadPreferences(user, "autoResize", "project-auto-margin");
self.bindProjectUploadPreferences(user, "validateMiriam", "project-verify-annotations"); self.bindProjectUploadPreferences(user, "validateMiriam", "project-verify-annotations");
...@@ -889,6 +886,7 @@ AddProjectDialog.prototype.destroy = function () { ...@@ -889,6 +886,7 @@ AddProjectDialog.prototype.destroy = function () {
/** /**
* *
* @return {Promise<T>}
*/ */
AddProjectDialog.prototype.open = function () { AddProjectDialog.prototype.open = function () {
var self = this; var self = this;
...@@ -902,6 +900,11 @@ AddProjectDialog.prototype.open = function () { ...@@ -902,6 +900,11 @@ AddProjectDialog.prototype.open = function () {
}); });
} }
$(div).dialog("open"); $(div).dialog("open");
return self.getServerConnector().getLoggedUser().then(function (user) {
self.setNotifyEmail(user.getEmail());
self.setProjectId("id");
self.setName("NEW DISEASE MAP");
});
}; };
/** /**
......
...@@ -28,10 +28,12 @@ describe('AddProjectDialog', function () { ...@@ -28,10 +28,12 @@ describe('AddProjectDialog', function () {
serverConnector: ServerConnector serverConnector: ServerConnector
}); });
}; };
it('init', function () { it('open', function () {
helper.loginAsAdmin(); helper.loginAsAdmin();
var dialog = createDialog(); var dialog = createDialog();
return dialog.init().then(function () { return dialog.init().then(function () {
return dialog.open();
}).then(function () {
assert.ok(dialog.getNotifyEmail() !== ""); assert.ok(dialog.getNotifyEmail() !== "");
assert.equal(0, logger.getWarnings().length); assert.equal(0, logger.getWarnings().length);
return dialog.destroy(); return dialog.destroy();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment