[app][s]: split CSV and Excel as options in importer and use this info to explicitly set format for dataproxy.
* Previously could not import CSV files if did not end in .csv.
This commit is contained in:
@@ -153,9 +153,10 @@
|
|||||||
<label class="control-label">Type of data</label>
|
<label class="control-label">Type of data</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select name="backend_type">
|
<select name="backend_type">
|
||||||
<option value="elasticsearch">ElasticSearch</option>
|
<option value="csv">CSV</option>
|
||||||
<option value="dataproxy">CSV or Excel</option>
|
<option vlaue="excel">Excel</option>
|
||||||
<option value="gdocs">Google Spreadsheet</option>
|
<option value="gdocs">Google Spreadsheet</option>
|
||||||
|
<option value="elasticsearch">ElasticSearch</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -128,14 +128,17 @@ var ExplorerApp = Backbone.View.extend({
|
|||||||
$('.modal.js-import-dialog-url').modal('hide');
|
$('.modal.js-import-dialog-url').modal('hide');
|
||||||
var $form = $(e.target);
|
var $form = $(e.target);
|
||||||
var source = $form.find('input[name="source"]').val();
|
var source = $form.find('input[name="source"]').val();
|
||||||
|
var datasetInfo = {
|
||||||
|
id: 'my-dataset',
|
||||||
|
url: source,
|
||||||
|
webstore_url: source
|
||||||
|
};
|
||||||
var type = $form.find('select[name="backend_type"]').val();
|
var type = $form.find('select[name="backend_type"]').val();
|
||||||
var dataset = new recline.Model.Dataset({
|
if (type === 'csv' || type === 'excel') {
|
||||||
id: 'my-dataset',
|
datasetInfo.format = type;
|
||||||
url: source,
|
type = 'dataproxy';
|
||||||
webstore_url: source
|
}
|
||||||
},
|
var dataset = new recline.Model.Dataset(datasetInfo, type);
|
||||||
type
|
|
||||||
);
|
|
||||||
this.createExplorer(dataset);
|
this.createExplorer(dataset);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user