Commit 4a9b14ec authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch...

Merge branch '400-project-list-in-the-admin-area-does-not-update-new-project-row-or-removed-row' into 'master'

Resolve "Project list in the admin area does not update new project row or removed row"

Closes #400

See merge request piotr.gawron/minerva!306
parents 357ad008 6f95d24d
Pipeline #5112 passed with stage
in 1 minute and 48 seconds
......@@ -26,6 +26,7 @@ function AddProjectDialog(params) {
var self = this;
self.registerListenerType("onFileUpload");
self.registerListenerType("onZipFileUpload");
self.registerListenerType("onProjectAdd");
self.setZipEntries([]);
$(self.getElement()).addClass("minerva-edit-project-dialog");
$(self.getElement()).css({overflow: "hidden"});
......@@ -1030,6 +1031,10 @@ AddProjectDialog.prototype.getConverter = function () {
});
};
/**
*
* @returns {Promise<Project>}
*/
AddProjectDialog.prototype.onSaveClicked = function () {
var self = this;
var parserClass;
......@@ -1061,6 +1066,8 @@ AddProjectDialog.prototype.onSaveClicked = function () {
"zip-entries": self.getZipEntries()
};
return ServerConnector.addProject(options);
}).then(function (project) {
self.callListeners("onProjectAdd", project);
}).finally(function () {
GuiConnector.hideProcessing();
});
......
......@@ -261,6 +261,9 @@ MapsAdminPanel.prototype.onAddClicked = function () {
configuration: self.getConfiguration()
});
self._addDialog = dialog;
dialog.addListener("onProjectAdd", function () {
return self.onRefreshClicked()
});
return dialog.init().then(function () {
return dialog.open();
});
......
......@@ -130,6 +130,10 @@ describe('AddProjectDialog', function () {
options = params;
};
var dialog = createDialog();
var projectAdded = false;
dialog.addListener("onProjectAdd", function(){
projectAdded = true;
});
var file = new Blob(["<node></node>"]);
file.name = "test.xml";
......@@ -151,6 +155,8 @@ describe('AddProjectDialog', function () {
assert.ok(options["version"] !== undefined);
assert.ok(options["semantic-zoom"] !== undefined);
assert.ok(projectAdded);
}).finally(function () {
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