From 2291f069487deebaaed0647bc84c3d13a5faba40 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Mon, 7 May 2012 03:53:30 +0100 Subject: [PATCH] [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. --- app/index.html | 5 +++-- app/js/app.js | 17 ++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/index.html b/app/index.html index 656bc497..48df1faf 100644 --- a/app/index.html +++ b/app/index.html @@ -153,9 +153,10 @@
diff --git a/app/js/app.js b/app/js/app.js index 675914c8..4070c841 100755 --- a/app/js/app.js +++ b/app/js/app.js @@ -128,14 +128,17 @@ var ExplorerApp = Backbone.View.extend({ $('.modal.js-import-dialog-url').modal('hide'); var $form = $(e.target); 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 dataset = new recline.Model.Dataset({ - id: 'my-dataset', - url: source, - webstore_url: source - }, - type - ); + if (type === 'csv' || type === 'excel') { + datasetInfo.format = type; + type = 'dataproxy'; + } + var dataset = new recline.Model.Dataset(datasetInfo, type); this.createExplorer(dataset); },