diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js index 83922b9f487db531ea9a8cbad319af7345b2a674..808df5c63bc5b5c0fe73ffde4e5bf5e1466d32df 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/controllers/LayoutManager.js @@ -438,12 +438,13 @@ var LayoutManager = { }, resize : function(view, forceFirstTime) { if(this.canReload()) { - console.log("reloadView"); this.reloadView(view, forceFirstTime); } } } $(window).resize(function() { - LayoutManager.resize(mainController.views, true); + if(mainController && mainController.views) { + LayoutManager.resize(mainController.views, true); + } }); \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js index 4a3b8d7de38becbafae1558fc20f32182b5abf68..325692a6f796162d0bc566764b287fee37c782a8 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/server/ServerFacade.js @@ -104,7 +104,44 @@ function ServerFacade(openbisServer) { _this.openbisServer.setWebAppSettings(webAppSettings, function(result) {}); }); } + /* New Settings API - To use with new release + this.getSetting = function(key, callback) { + require([ "jquery", "openbis", "as/dto/person/update/PersonUpdate", "as/dto/person/id/Me", "as/dto/webapp/create/WebAppSettingCreation", "as/dto/person/fetchoptions/PersonFetchOptions" ], + function($, openbis, PersonUpdate, Me, WebAppSettingCreation, PersonFetchOptions) { + $(document).ready(function() { + var mefo = new PersonFetchOptions(); + var mefowsfo = mefo.withWebAppSettings("ELN-LIMS"); + mefowsfo.withSetting(key); + mainController.openbisV3.getPersons([ new Me() ], mefo).done(function(persons) { + var person = persons[new Me()]; + var settings = person.getWebAppSettings("ELN-LIMS"); + + var keySettings = settings.getSetting(key); + var value = null; + if(keySettings) { + value = keySettings.getValue(); + } + console.log("getSetting key: " + key + " value: " + value); + callback(value); + }); + }); + }); + } + this.setSetting = function(key, value) { + // console.log("Write key: " + key + " value: " + value); + require([ "jquery", "openbis", "as/dto/person/update/PersonUpdate", "as/dto/person/id/Me", "as/dto/webapp/create/WebAppSettingCreation", "as/dto/person/fetchoptions/PersonFetchOptions" ], + function($, openbis, PersonUpdate, Me, WebAppSettingCreation, PersonFetchOptions) { + $(document).ready(function() { + var update = new PersonUpdate(); + update.setUserId(new Me()); + var elnlims = update.getWebAppSettings("ELN-LIMS"); + elnlims.add(new WebAppSettingCreation(key, value)); + mainController.openbisV3.updatePersons([ update ]).done(function() { }); + }); + }); + } + */ // // Login Related Functions // diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js index b590ee518e7068dccd960a1ad80205e37241b391..2f3f0ff1bc92be2232794c5f2f1fb6e16dc7c1a5 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/FormUtil.js @@ -1149,7 +1149,7 @@ var FormUtil = new function() { Â Â Â Â // this.showDiskSpaceDialog = function() { - let _this = this; + var _this = this; Util.blockUI(null, null, true); @@ -1161,26 +1161,26 @@ var FormUtil = new function() { Util.showError("Could not get disk space information."); } else { - let $dialog = $("<div>"); + var $dialog = $("<div>"); $dialog .append($("<div>") .append($("<legend>").text("Available storage space:"))); - let $formFieldContainer = $("<div>"); + var $formFieldContainer = $("<div>"); $dialog.append($formFieldContainer); // close button - let $closeButton = $("<a>", { + var $closeButton = $("<a>", { class : "btn btn-default", id : "dropboxFolderNameClose" }).text("Close").css("margin-top", "15px"); $dialog.append($closeButton); // add disk space - let rowHeight = "50px"; - let barHeight = "30px"; + var rowHeight = "50px"; + var barHeight = "30px"; - let $table = $("<table>"); + var $table = $("<table>"); $table .append($("<thead>") .append($("<tr>").css("height", rowHeight) @@ -1201,16 +1201,16 @@ var FormUtil = new function() { $table.append($tbody); $formFieldContainer.append($table); - let diskSpaceValues = result.data; - for (let i=0; i<diskSpaceValues.length; i++) { - let filesystem = diskSpaceValues[i]["Mounted_on"] - let size = diskSpaceValues[i]["Size"] - let used = diskSpaceValues[i]["Used"] - let avail = diskSpaceValues[i]["Avail"] - let usedPercentage = diskSpaceValues[i]["UsedPercentage"] + var diskSpaceValues = result.data; + for (var i=0; i<diskSpaceValues.length; i++) { + var filesystem = diskSpaceValues[i]["Mounted_on"] + var size = diskSpaceValues[i]["Size"] + var used = diskSpaceValues[i]["Used"] + var avail = diskSpaceValues[i]["Avail"] + var usedPercentage = diskSpaceValues[i]["UsedPercentage"] - let $diskSpaceSection = $("<div>"); - let $total = $("<div>").css({ + var $diskSpaceSection = $("<div>"); + var $total = $("<div>").css({ height : barHeight, width : "100%", "background-color" : "lightgray", @@ -1220,7 +1220,7 @@ var FormUtil = new function() { "line-height" : barHeight, }); $total.text(usedPercentage); - let $used = $("<div>").css({ + var $used = $("<div>").css({ height: barHeight, width : usedPercentage, "background-color" : "lightblue", diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js index e614a21186b7a0a2a5be95949eb48fc4ed104b96..e9db5ffec7b27f4c9a50b517bd300d487a9f0f9b 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js @@ -420,8 +420,12 @@ function SampleFormController(mainController, mode, sample, paginationInfo) { if(samplesToDelete) { mainController.serverFacade.deleteSamples(samplesToDelete, "Deleted to trashcan from eln sample form " + _this._sampleFormModel.sample.identifier, - function() { - Util.showSuccess(message, callbackOk); + function(response) { + if(response.error) { + Util.showError("Deletes failed, other changes where commited: " + response.error.message, callbackOk); + } else { + Util.showSuccess(message, callbackOk); + } _this._sampleFormModel.isFormDirty = false; }, false); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js index dc34da9e5bef87ddcc20df9e47d3e255c2a58626..f63c725e0912feb27bb7de50ef72ea1da0c4f81d 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/StorageListView.js @@ -144,12 +144,12 @@ function StorageListView(storageListController, storageListModel) { } // multi-select delete option - let isMultiselectable = false; + var isMultiselectable = false; var extraOptions = []; if(!this._storageListModel.isDisabled) { isMultiselectable = true; extraOptions.push({ name : "Delete selected", action : function(selected) { - for (let i=0; i<selected.length; i++) { + for (var i=0; i<selected.length; i++) { _this.removeChildFromSampleOrMarkToDelete(selected[i]); } _this._dataGrid.refresh();