66 Commits

Author SHA1 Message Date
Rufus Pollock
b7f9d01f3e [test,add][xs]: addendum to last commit 095f64e1f3cca2f036d82f614928415217198aaf to fix tests. 2014-08-18 10:00:13 +01:00
Vitor Baptista
b26f270ffa [#425] Fix Dataset.query() when called with Query model
The problem is that Backbone >= 0.9.9 doesn't accept updating models with:

    model.set(otherModel);

That needs to be changed to:

    model.set(otherModel.attributes);

Dataset.query() accepts both regular JS objects and Query models, so we need to
check the parameter type to support both.
2014-05-14 15:51:11 -03:00
kielni
964a593106 fix variable hiding when finding filter to replace 2014-01-06 14:56:31 -08:00
kielni
f7f010ea33 add new methods for facets: removeFacet, clearFacets, and refreshFacets 2013-09-06 13:51:17 -07:00
kielni
95fab060c3 add options to addFacet for size and silent 2013-09-06 11:58:23 -07:00
kielni
ef1064b888 add method to replace a filter 2013-09-06 11:40:31 -07:00
Rufus Pollock
5d24fd474d [csv,bugfix][s]: fix to csv backend to correct issue with header row appearing in data in case where fields passed explicitly.
* The bug was triggered by change in 4d128af797546e5174537d8ed530a243e444eeab to use model fields if explicitly provided
  * model.test.js illustrated issue (that new test was failing prior to changes to csv backend in this commit)
* Issue was that CSV backend did not pass back fields option. Previously, if no fields provided from backend we extracted fields from first row of the returned records. With change in 4d128af797546e5174537d8ed530a243e444eeab to use model fields if provided we had an issue as we no longer removed first row for fields.
* Fixed by having CSV backend explicitly extract fields and pass them back
2013-06-15 12:12:15 +01:00
Rufus Pollock
4d128af797 [model,bugfix][s]: if explicitly passed field info to a dataset use that over any field info derived from backend. 2013-06-02 20:04:09 +01:00
Dan Wilson
b2c5c7f0e0 Misc test suite fixes for IE8. Fixes #323. 2013-05-14 18:45:43 +01:00
Rufus Pollock
dc55d53fdd [#330,model][s]: getFieldValue & getFieldValueUnrendered now return '' if field argument is null / undefined - fixes #330. 2013-02-24 14:34:28 +00:00
Rufus Pollock
5a322e2c7c [#286,bugfix]: fix for case where fields array has nulls in it.
If passed fields = [ null, ..., ...] or [ ... , null, ...] we fail in Dataset._normalizeRecordsAndFields method because:

1. If null is first element we do not do field generation correctly because typeof(null) is object - ede211646a/src/model.js (L108)
2.  We call toString on field names which fails for null ede211646a/src/model.js (L113)
2012-12-09 18:58:52 +00:00
Rufus Pollock
ede211646a [#264,bugfix,filtereditor][s]: track down and fix bug with addFilter (and hence filtereditor) - fixes #264.
* Quite a subtle bug due to the fact that we were not doing a deep copy on the filter template in addFilter
2012-11-08 20:35:03 +00:00
Rufus Pollock
f6a3395b40 [#258,model][xs]: tiny bugfix for cases where fields in raw state contain a non-string - fixes #258. 2012-10-19 07:57:47 +01:00
Rufus Pollock
7819b3b185 [#248,model][s]: normalize Field types where possible by mapping standard type aliases to default type name - fixes #248.
* view.graph.js improve graph view by making sure datetime for an axis is judged by whether it is date, datetime or time not just date!
* backend.ckan.js some type conversions now done in core model so can be removed
2012-10-12 22:06:56 +01:00
Rufus Pollock
d599f75e85 [model,refator][s]: reintroduce summary on Record object deprecating recordSummary on Dataset.
* Reverses change in 1dadc1106bd2dbcad4580d3889e15ac44c865f80
* Record now has fields attribute passed down from Dataset. This is needed in order to support summary method and also makes sense -- as pointed out by @zephod
* Update examples
2012-07-09 01:29:46 +01:00
Rufus Pollock
f06b9ad1b1 [field][xs]: formatter for geo_point type (like an object). 2012-06-29 20:40:15 +01:00
Rufus Pollock
5216e23f45 [model/query][s]: tidying up last part of recent filter refactor by removing addTermFilter + addGeoFilter - closes #154. 2012-06-25 09:30:37 +01:00
Rufus Pollock
1fee4c2821 [#165,model/dataset][m]: new method normalizeRecordsAndFields to ensure we get valid records and fields from fetch (e.g. no duplicate field ids!). 2012-06-24 12:42:22 +01:00
Rufus Pollock
6e5c15a816 [#162,backend,model][l]: major commit addressing several parts of the backend / model refactor in #162.
* Now have Dataset setup and manage "memory store"

  * New fetch API as per issue #162 spec
  * dataproxy utilizes useMemoryStore attribute and just implements fetch
  * Switch gdocs to use Memory.Store properly via new useMemoryStore + fetch methodology
  * Memory backend: query function now follows promise API, remove fetch,upsert,delete and add save function to Store object

* Also refactor to remove _source in QueryResult "hits" attribute on all backends but ElasticSearch - cf #159 (note this means ES currently broken)
2012-06-23 20:23:24 +01:00
Rufus Pollock
0148dd45b2 [test,addendum][xs]: fixes for tests after changes in last commit b64daea1a763ba40d450d8234f7b3ac0c8f15c16. 2012-06-18 21:21:03 +01:00
Rufus Pollock
f14dcdcaaf [#154,model/query][m]: refactor to new filter structure (see ticket) updating FilterEditor widget and backends.
* ElasticSearch changes represents a significant refactor and now support filters and query via constant_score (did not support this before!)
2012-06-16 13:04:03 +01:00
Rufus Pollock
8fe04ddd4f [#111,filter/geo][m]: geo filter support - filter editor working though not sure actual query is working (!).
* Extensive refactoring of Model.Query and View.FilterEditor to do this cleanly (geo_distance and term treated similarly now)
2012-06-15 10:51:13 +01:00
Rufus Pollock
58cac002dc [#145,widget/fields,model][m]: working fields widget with field summary data generated by Dataset.getFieldsSummary function.
* Layout is still not right -- need to put widget in sidebar (though looks a lot better)
* Datset.getFieldsSummary to compute facets for fields
* Remove facet usage in the demo
2012-06-04 23:57:24 +01:00
Rufus Pollock
c1c1881660 [#129,refactor][l]: ([s] in effort) rename Document to Record - fixes #129. 2012-05-31 21:08:00 +01:00
Rufus Pollock
23b32dff1c [#128,backend/memory,misc][l]: commence major backend refactor by converting recline.Backend.Memory to module and splitting existing code into BackboneSyncer and DataWrapper.
* Lots of other changes to having passing tests (note some actual functionality is likely a little broken esp around state serialization and the app)
2012-05-26 14:26:01 +01:00
Rufus Pollock
b4255ef18f [model][s]: default string renderer will linkify http://... links. 2012-05-24 00:30:35 +01:00
Rufus Pollock
67ff757722 [#68,field][s]: link and markdown format for strings with default formatter. 2012-04-21 23:54:49 +01:00
Rufus Pollock
7743534eac [#88,backend][s]: add __type__ attribute to all backends to identify them and provide a more robust and generic way to load backends from a string identifier such as that __type__ field.
* Also remove recline.Model.backends registry as can be replaced with this more generic solution.
* This refactoring is necessitated by our need to serialize backend info for save/reload of a dataset and explorer state in #88.
2012-04-15 22:19:43 +01:00
Rufus Pollock
498e9712c6 [#68,model/Field][s]: introduce default renderers for object and float:percentage. 2012-04-10 16:36:55 +01:00
Rufus Pollock
0f4a0a6189 [#68,fields][m]: add format attribute plus support for renderer and deriver functions. 2012-04-10 01:24:34 +01:00
Rufus Pollock
1eb7df9a7c [#66,model][s]: addTermFacet on Query object.
* Also fix a major bug (that was causing weird test failures) re setting defaults (you cannot set defaults with objects).
2012-04-02 21:04:52 +01:00
Rufus Pollock
80165659b1 [#62,faceting][s]: basic faceting fully functional on ES. 2012-04-01 14:20:12 +01:00
Rufus Pollock
6ba8c82408 [#62,facets][s]: partially working faceting with elasticsearch. 2012-04-01 13:51:15 +01:00
Rufus Pollock
3412962a35 [#62,faceting][s]: introduce Facet and FacetList models and use them.
* Conceptual breakthrough on how Faceting and Filtering interact (have updated issue #62 as a result).
2012-03-31 18:06:41 +01:00
Rufus Pollock
d68529c113 [test/model][xs]: add a test for FieldList.toJSON. 2012-03-29 08:38:58 +01:00
Rufus Pollock
4074f380d8 [#25,view,refactor][s]: get views working with new field setup (fixes #25).
* One nastiness along the way (30m delay!) that is worth noting: flot graph was a problem because it turned out that a) (re-)render triggered by dataset attributes change and fields only got set *after* core dataset attributes and so info was rendering.
* model.test.js: basic test for Dataset.toTemplateJSON
2012-02-18 09:07:35 +00:00
Rufus Pollock
a75e04701f [#25,model][xs]: turns out the hack to allow simple arguments to Field ctor does *not* work. 2012-02-18 08:11:38 +00:00
Rufus Pollock
2da6c1a297 [#25,model][xs]: remove artificial field attribute (follow up to penultimate commit cf42e43ff0f32ba24e940455b060ae278025942b). 2012-02-18 07:48:14 +00:00
Rufus Pollock
cf42e43ff0 [#25,model][s]: introduce new Field Model and FieldList collection and attach to Dataset.
* NB: no refactoring elsewhere yet to take account of this
* model.test.js: tests for Field (first proper model tests!)
2012-02-18 07:33:15 +00:00
Rufus Pollock
702b030b70 [rename][xs]: rename model.test.js to backend.test.js to better reflect its function. 2012-02-18 07:05:31 +00:00
Rufus Pollock
3ea18aa715 [#25,refactor][s]: rename header(s) -> field(s) throughout. 2012-02-17 23:43:27 +00:00
Rufus Pollock
866ad12a15 [#49,query][s]: introduce Query model object and use it in Dataset.
* tests: refactor Memory backend tests so that tests are independent (to avoid issues of carry over of query state)
* TODO: use query stuff in views - NB sorting seems broken in DataTable.
2012-02-17 23:05:34 +00:00
Rufus Pollock
87fa752908 [#43,backend][s]: GDocs backend working (and has improved docs). 2012-02-17 09:16:02 +00:00
Rufus Pollock
7f923d3ccf [backend][s]: Webstore and DataProxy now passing tests again. 2012-02-17 09:10:24 +00:00
Rufus Pollock
2d4e6a2ecc [#43,model][m]: refactor Dataset and BackendMemory to the new setup approach.
* NB: other model tests broken as a result.
2012-02-17 08:53:36 +00:00
Rufus Pollock
57effa02aa [whitespace][xs]: correct indentation issues introduced in b3a71e82cca77bfe24c93290dd321174c85ab3b7. 2012-02-16 19:51:05 +00:00
Rufus Pollock
21173b6acf [#35,all][m]: crude error catching for backends based on timeouts (best we can do with JSONP) - fixes #35.
* Show errors in UI
* required some extensive refactoring to use done/fail on promise rather than then
2012-02-10 03:16:49 +00:00
Rufus Pollock
1491ae5bcc [#34,query][m]: start on proper query support (move to query and sort support in BackendMemory). 2012-02-09 18:05:37 +00:00
Rufus Pollock
1539169e21 [#35,refactor][l]: fixes #35, major refactor to have datasets intialized with backend and endpoint information.
* Backbone.sync now switches on type of backend set for a dataset (allowing simultaneous use of multiple datasets with different backends)
* Datasets are initialized with backend config (see docs and code)
2012-02-08 09:27:56 +00:00
James Casbon
b3a71e82cc correct indents on model.js with gg=G 2012-01-29 16:20:51 +00:00