Commit 47a0b8c9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

after project is updated list of project is refreshed

parent 487bf5e4
Pipeline #4164 passed with stage
in 1 minute and 4 seconds
......@@ -18,6 +18,7 @@ var xss = require('xss');
function EditProjectDialog(params) {
AbstractGuiElement.call(this, params);
var self = this;
self.registerListenerType("onSave");
$(self.getElement()).addClass("minerva-edit-project-dialog");
$(self.getElement()).css({overflow: "hidden"});
......@@ -237,8 +238,10 @@ EditProjectDialog.prototype.createGeneralTabContent = function () {
content: '<span class="ui-icon ui-icon-disk"></span>&nbsp;SAVE',
onclick: function () {
return self.onSaveClicked().then(function () {
return self.callListeners("onSave");
}).then(function () {
return self.close();
}, GuiConnector.alert);
}).catch(GuiConnector.alert);
},
xss: false
});
......
......@@ -261,11 +261,16 @@ MapsAdminPanel.prototype.destroy = function () {
if ($.fn.DataTable.isDataTable(table)) {
promises.push($(table).DataTable().destroy());
}
if (self._logDialogs !== undefined) {
for (var key in self._logDialogs) {
if (self._logDialogs.hasOwnProperty(key)) {
promises.push(self._logDialogs[key].destroy());
}
var key;
for (key in self._logDialogs) {
if (self._logDialogs.hasOwnProperty(key)) {
promises.push(self._logDialogs[key].destroy());
}
}
for (key in self._dialogs) {
if (self._dialogs.hasOwnProperty(key)) {
promises.push(self._dialogs[key].destroy());
}
}
return Promise.all(promises);
......@@ -297,6 +302,10 @@ MapsAdminPanel.prototype.getDialog = function (project) {
});
self._dialogs[project.getProjectId()] = dialog;
return dialog.init().then(function () {
return dialog.addListener("onSave", function () {
return self.onRefreshClicked()
});
}).then(function () {
return dialog;
});
} else {
......
......@@ -51,6 +51,28 @@ describe('MapsAdminPanel', function () {
});
});
it('getDialog', function () {
helper.loginAsAdmin();
var mapTab;
var project;
return ServerConnector.getProject().then(function (result) {
project = result;
return ServerConnector.getConfiguration();
}).then(function (configuration) {
mapTab = new MapsAdminPanel({
element: testDiv,
project: project,
configuration: configuration
});
return mapTab.init();
}).then(function () {
return mapTab.getDialog(project);
}).then(function (dialog) {
assert.ok(dialog.getListeners("onSave").length > 0);
return mapTab.destroy();
});
});
describe('onAddClicked', function () {
it('default', function () {
......
Supports Markdown
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