Skip to content

Commit

Permalink
Update recline to work with datastore v2
Browse files Browse the repository at this point in the history
Changes on application.js to use datastore_active extra and define a
'ckan' backend when initializing recline. Update recline.js with the new
backend. This changes were ported from 95c975. Also upgrade to Flotr2.

TODO:
Exception on recline:

Uncaught TypeError: Cannot call method 'toggle' of undefined
  • Loading branch information
amercader committed Oct 8, 2012
1 parent ef6c02d commit 8c1517f
Show file tree
Hide file tree
Showing 8 changed files with 8,278 additions and 2,982 deletions.
13 changes: 8 additions & 5 deletions ckan/public/scripts/application.js
Expand Up @@ -1675,8 +1675,8 @@ CKAN.DataPreview = function ($, my) {
}

// 4 situations
// a) webstore_url is active (something was posted to the datastore)
// b) csv or xls (but not webstore)
// a) something was posted to the datastore - need to check for this
// b) csv or xls (but not datastore)
// c) can be treated as plain text
// d) none of the above but worth iframing (assumption is
// that if we got here (i.e. preview shown) worth doing
Expand All @@ -1694,9 +1694,12 @@ CKAN.DataPreview = function ($, my) {
}
}

if (resourceData.webstore_url) {
resourceData.url = '/api/data/' + resourceData.id;
resourceData.backend = 'elasticsearch';
// Set recline CKAN backend API endpoint to right location (so it can locate
// CKAN DataStore)
recline.Backend.Ckan.API_ENDPOINT = CKAN.SITE_URL + '/api';

if (resourceData.datastore_active) {
resourceData.backend = 'ckan';
var dataset = new recline.Model.Dataset(resourceData);
var errorMsg = CKAN.Strings.errorLoadingPreview + ': ' + CKAN.Strings.errorDataStore;
dataset.fetch()
Expand Down
2,599 changes: 0 additions & 2,599 deletions ckan/public/scripts/vendor/flot/0.7/jquery.flot.js

This file was deleted.

82 changes: 82 additions & 0 deletions ckan/public/scripts/vendor/flotr2/excanvas.min.js

Large diffs are not rendered by default.

6,966 changes: 6,966 additions & 0 deletions ckan/public/scripts/vendor/flotr2/flotr2.js

Large diffs are not rendered by default.

502 changes: 502 additions & 0 deletions ckan/public/scripts/vendor/flotr2/flotr2.min.js

Large diffs are not rendered by default.

0 comments on commit 8c1517f

Please sign in to comment.