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
......@@ -18,6 +18,8 @@ minerva (14.0.3) stable; urgency=medium
warning, but does not fail upload (#937)
* Bug fix: export of the map to SBML that was imported with older version
(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
......
......@@ -218,13 +218,11 @@ AddProjectDialog.prototype.createGeneralTabContent = function () {
table.appendChild(self.createInputRow({
labelName: "ProjectId:",
defaultValue: "id",
inputName: "project-id",
help: 'A working name of the uploaded project on the MINERVA platform. Unique in the platform.'
}));
table.appendChild(self.createInputRow({
labelName: "Project name:",
defaultValue: "NEW DISEASE MAP",
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.'
}));
......@@ -753,7 +751,6 @@ AddProjectDialog.prototype.init = function () {
select = $("[name='project-map-canvas-type']", self.getElement())[0];
self._fillMapCanvasTypeSelectOptions(select, configuration);
return self.getServerConnector().getLoggedUser().then(function (user) {
self.setNotifyEmail(user.getEmail());
self.bindProjectUploadPreferences(user, "annotateModel", "project-annotate-automatically");
self.bindProjectUploadPreferences(user, "autoResize", "project-auto-margin");
self.bindProjectUploadPreferences(user, "validateMiriam", "project-verify-annotations");
......@@ -889,6 +886,7 @@ AddProjectDialog.prototype.destroy = function () {
/**
*
* @return {Promise<T>}
*/
AddProjectDialog.prototype.open = function () {
var self = this;
......@@ -902,6 +900,11 @@ AddProjectDialog.prototype.open = function () {
});
}
$(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 () {
serverConnector: ServerConnector
});
};
it('init', function () {
it('open', function () {
helper.loginAsAdmin();
var dialog = createDialog();
return dialog.init().then(function () {
return dialog.open();
}).then(function () {
assert.ok(dialog.getNotifyEmail() !== "");
assert.equal(0, logger.getWarnings().length);
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