Skip to content
Snippets Groups Projects
Commit 9e5ca6c0 authored by juanf's avatar juanf
Browse files

SSDM-3520 : enable/disable upload stored on display settings.

SVN: 36262
parent d3099647
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,43 @@ function ServerFacade(openbisServer) { ...@@ -50,6 +50,43 @@ function ServerFacade(openbisServer) {
this.openbisServer.setResponseInterceptor(responseInterceptor); this.openbisServer.setResponseInterceptor(responseInterceptor);
//
// Display Settings
//
this.getSetting = function(keyOrNull, callback) {
mainController.serverFacade.openbisServer.getWebAppSettings("ELN-LIMS", function(response) {
var settings = response.result.settings;
if(!settings) {
settings = {};
}
if(keyOrNull) {
callback(settings[keyOrNull]);
} else {
callback(settings);
}
});
}
this.setSetting = function(key, value) {
var _this = this;
var webAppId = "ELN-LIMS";
this.openbisServer.getWebAppSettings(webAppId, function(response) {
var settings = response.result.settings;
if(!settings) {
settings = {};
}
settings[key] = value;
var webAppSettings = {
"@type" : "WebAppSettings",
"webAppId" : webAppId,
"settings" : settings
}
_this.openbisServer.setWebAppSettings(webAppSettings, function(result) {});
});
}
// //
// Login Related Functions // Login Related Functions
// //
......
...@@ -24,7 +24,10 @@ function DataSetFormController(parentController, mode, sample, dataSet, isMini) ...@@ -24,7 +24,10 @@ function DataSetFormController(parentController, mode, sample, dataSet, isMini)
mainController.serverFacade.listDataSetTypes( mainController.serverFacade.listDataSetTypes(
function(data) { function(data) {
_this._dataSetFormModel.dataSetTypes = data.result; _this._dataSetFormModel.dataSetTypes = data.result;
_this._dataSetFormView.repaint($container); mainController.serverFacade.getSetting("DataSetFormModel.isAutoUpload", function(value) {
_this._dataSetFormModel.isAutoUpload = (value === "true");
_this._dataSetFormView.repaint($container);
});
} }
); );
} }
......
...@@ -199,6 +199,7 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) { ...@@ -199,6 +199,7 @@ function DataSetFormView(dataSetFormController, dataSetFormModel) {
$autoUploadCheck.change(function(){ $autoUploadCheck.change(function(){
var isChecked = $($(this).children()[0]).children()[0].checked; var isChecked = $($(this).children()[0]).children()[0].checked;
_this._dataSetFormModel.isAutoUpload = isChecked; _this._dataSetFormModel.isAutoUpload = isChecked;
mainController.serverFacade.setSetting("DataSetFormModel.isAutoUpload", isChecked);
}); });
var $autoUploadGroup = $('<fieldset>') var $autoUploadGroup = $('<fieldset>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment