Skip to content

Commit

Permalink
[SSE] Fix saving to csv
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Nov 28, 2024
1 parent eb1b40b commit add40ac
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions apps/common/main/lib/view/OpenDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,21 @@ define([
}

if (this.type == Common.Utils.importTextType.CSV || this.type == Common.Utils.importTextType.Paste || this.type == Common.Utils.importTextType.Columns || this.type == Common.Utils.importTextType.Data) {
// var delimiter = this.settings && this.settings.asc_getDelimiter() ? this.settings.asc_getDelimiter() : 4,
// delimiterChar = this.settings && this.settings.asc_getDelimiterChar() ? this.settings.asc_getDelimiterChar() : '';
// var value = Common.localStorage.getItem(this.type == Common.Utils.importTextType.CSV ? "sse-settings-csv-delimiter" : "sse-settings-data-delimiter");
// if (value) {
// value = parseInt(value);
// if (!isNaN(value)) {
// delimiter = value;
// (delimiter===-1) && (delimiterChar = Common.localStorage.getItem(this.type == Common.Utils.importTextType.CSV ? "sse-settings-csv-delimiter-char" : "sse-settings-data-delimiter-char") || '');
// }
// }

var delimiter = '';
var delimiter = '',
delimiterChar = '';
if (!this.preview) { // don't need to detect delimiter (save to csv)
delimiter = this.settings && this.settings.asc_getDelimiter() ? this.settings.asc_getDelimiter() : 4,
delimiterChar = this.settings && this.settings.asc_getDelimiterChar() ? this.settings.asc_getDelimiterChar() : '';
var value = Common.localStorage.getItem(this.type == Common.Utils.importTextType.CSV ? "sse-settings-csv-delimiter" : "sse-settings-data-delimiter");
if (value) {
value = parseInt(value);
if (!isNaN(value)) {
delimiter = value;
(delimiter===-1) && (delimiterChar = Common.localStorage.getItem(this.type == Common.Utils.importTextType.CSV ? "sse-settings-csv-delimiter-char" : "sse-settings-data-delimiter-char") || '');
}
}
}

this.cmbDelimiter = new Common.UI.ComboBox({
el: $('#id-delimiters-combo', this.$window),
style: 'width: 100px;',
Expand All @@ -402,7 +405,7 @@ define([
maxLength: 1,
validateOnChange: true,
validateOnBlur: false,
value: ''
value: delimiterChar
});
this.inputDelimiter.setVisible(delimiter===-1);
this.inputDelimiter.on ('changing', _.bind(this.onInputCharChanging, this));
Expand Down

0 comments on commit add40ac

Please sign in to comment.