Github user benkeen commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/303#discussion_r25785476
--- Diff: app/addons/documents/changes/stores.js ---
@@ -15,51 +15,58 @@ define([
'addons/documents/changes/actiontypes'
], function (FauxtonAPI, ActionTypes) {
- var Stores = {};
-
- // tracks the state of the header (open/closed)
- var ChangesHeaderStore = FauxtonAPI.Store.extend({
+ var ChangesStore = FauxtonAPI.Store.extend({
initialize: function () {
this.reset();
},
reset: function () {
this._tabVisible = false;
+ this._filters = [];
+ this._changes = [];
+ this._databaseName = '';
+ this._maxChangesListed = 1000;
+ this._showingSubset = false;
},
- toggleTabVisibility: function () {
- this._tabVisible = !this._tabVisible;
+ setChanges: function (options) {
+ this._filters = options.filters;
+ this._databaseName = options.databaseName;
+ this._changes = _.map(options.changes, function (change) {
+ return {
+ id: change.get('id'),
+ seq: change.get('seq'),
+ deleted: change.get('deleted') ? change.get('deleted') : false,
+ changes: change.get('changes'),
+ doc: change.get('doc') // only populated with ?include_docs=true
+ };
+ });
--- End diff --
True! The thing is, the models have a whole bunch of stuff in them - I just
wanted to specify exactly what's needed for the element, so although it's
manual you can see at a glance what the changes array contains. Also, it forces
the `deleted` property to have a default `false` value, which is needed for the
filter searches later.
This okay?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---