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

SSDM-3817 : Checkbox to not show warning anymore on Plain text imports

SVN: 36771
parent f04a5170
No related branches found
No related tags found
No related merge requests found
...@@ -26,30 +26,18 @@ function DataGridController(title, columns, data, rowClickEventHandler, showAllC ...@@ -26,30 +26,18 @@ function DataGridController(title, columns, data, rowClickEventHandler, showAllC
this.init = function($container, extraOptions) { this.init = function($container, extraOptions) {
var webAppId = "ELN-LIMS"; var webAppId = "ELN-LIMS";
mainController.serverFacade.openbisServer.getWebAppSettings(webAppId, function(response) { mainController.serverFacade.getSetting(configKey, function(tableConfig) {
var settings = response.result.settings;
var onColumnsChange = function(tableState) { var onColumnsChange = function(tableState) {
if(!settings) { mainController.serverFacade.setSetting(configKey, JSON.stringify(tableState));
settings = {};
}
settings[configKey] = JSON.stringify(tableState);
var webAppSettings = {
"@type" : "WebAppSettings",
"webAppId" : webAppId,
"settings" : settings
}
mainController.serverFacade.openbisServer.setWebAppSettings(webAppSettings, function(result) {});
} }
var tableSettings = null;
if(configKey && settings[configKey]) { if(tableConfig) {
tableSettings = JSON.parse(settings[configKey]); tableConfig = JSON.parse(tableConfig);
if(Object.keys(tableSettings).length > 3) { //Clean old settings if(!tableConfig.pageSize) { //Clean old settings
tableSettings = null; tableConfig = null;
} }
} }
_this._grid = new Grid(columns, data, showAllColumns, tableSettings, onColumnsChange, isMultiselectable); _this._grid = new Grid(columns, data, showAllColumns, tableConfig, onColumnsChange, isMultiselectable);
if(rowClickEventHandler) { if(rowClickEventHandler) {
_this._grid.addRowClickListener(rowClickEventHandler); _this._grid.addRowClickListener(rowClickEventHandler);
} }
......
...@@ -311,9 +311,18 @@ $.extend(Grid.prototype, { ...@@ -311,9 +311,18 @@ $.extend(Grid.prototype, {
exportTSV : function(isAllRowsOrVisible, isAllColumnsOrVisible, plainText) { exportTSV : function(isAllRowsOrVisible, isAllColumnsOrVisible, plainText) {
var _this = this; var _this = this;
if(plainText) { var disablePlanTextExportWarning = this.tableSettings.disablePlanTextExportWarning;
Util.showWarning("<b>DO NOT USE THIS FILE FOR BATCH UPDATE!</b><br>This file does not contain rich text format. If used for Batch Update, all rich text format in the updated entries will be lost!", function() { if(plainText && !disablePlanTextExportWarning) {
var dontShowAnymore = "<input type='checkbox' id='disablePlanTextExportWarning'> Don't show this warning again.";
Util.showWarning("<b>DO NOT USE THIS FILE FOR BATCH UPDATE!</b><br>This file does not contain rich text format. If used for Batch Update, all rich text format in the updated entries will be lost!<br><br>" + dontShowAnymore, function() {
_this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText); _this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText);
var isSelected = $("#disablePlanTextExportWarning").val() === "on";
if(_this.onChangeState) {
_this.tableSettings.disablePlanTextExportWarning = isSelected;
_this.onChangeState(_this.tableSettings);
}
}); });
} else { } else {
_this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText); _this.exportTSVB(isAllRowsOrVisible, isAllColumnsOrVisible, plainText);
......
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