59 Commits

Author SHA1 Message Date
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
James Casbon
9eeb4ab97a google spreadsheet backend 2012-01-28 19:44:07 +00:00
Rufus Pollock
76b05eb846 [#31,backends][m]: add BackendDataProxy, fixes #31. 2012-01-26 11:07:27 +00:00
Rufus Pollock
6d32ac2b27 [refactor][s]: rename getRows to getDocuments (thereby removing outstanding TODO). 2012-01-06 12:08:55 +00:00
Rufus Pollock
250f931c36 [refactor][s]: rename rowCount to docCount and remove getLength method as can just use dataset.docCount. 2012-01-06 11:43:17 +00:00
Rufus Pollock
e65bc74a88 [#14,#6,backend,view][m]: delete row in data table now working via Backbone with backend memory.
* #6: BackendMemory now supports delete for Documents.
2012-01-05 12:26:13 +00:00
Rufus Pollock
ce076a2eac [model/backend,#6][s]: BackendMemory now supports saving of Documents. 2012-01-05 01:39:31 +00:00
Rufus Pollock
97f50c5bf5 [test/model][s]: update webstore backend test to have ajax fully mocked so tests work fully when offline. 2012-01-05 01:36:53 +00:00