You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2015/04/07 10:34:59 UTC
fauxton commit: updated refs/heads/master to 6c04315
Repository: couchdb-fauxton
Updated Branches:
refs/heads/master 30b551a74 -> 6c0431583
change find to _.find in index-editor-actions
and checks for attribute before assigning it
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/6c043158
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/6c043158
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/6c043158
Branch: refs/heads/master
Commit: 6c0431583b9234fd6346b9aecba7fb0330f4c802
Parents: 30b551a
Author: michellephung@gmail.com <mi...@gmail.com>
Authored: Mon Apr 6 16:10:31 2015 -0400
Committer: michellephung@gmail.com <mi...@gmail.com>
Committed: Mon Apr 6 19:20:29 2015 -0400
----------------------------------------------------------------------
app/addons/documents/index-editor/actions.js | 2 +-
app/addons/documents/shared-resources.js | 3 ++-
app/addons/documents/tests/actionsSpec.js | 16 +++++++++-------
3 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6c043158/app/addons/documents/index-editor/actions.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/index-editor/actions.js b/app/addons/documents/index-editor/actions.js
index 84bf535..79ef149 100644
--- a/app/addons/documents/index-editor/actions.js
+++ b/app/addons/documents/index-editor/actions.js
@@ -30,7 +30,7 @@ function (app, FauxtonAPI, Documents, ActionTypes, IndexResultsActions) {
},
findDesignDoc: function (designDocs, designDocId) {
- return designDocs.find(function (doc) {
+ return _.find(designDocs, function (doc) {
return doc.id === designDocId;
}).dDocModel();
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6c043158/app/addons/documents/shared-resources.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/shared-resources.js b/app/addons/documents/shared-resources.js
index 4800480..a78709a 100644
--- a/app/addons/documents/shared-resources.js
+++ b/app/addons/documents/shared-resources.js
@@ -105,8 +105,9 @@ define([
if (!this.isDdoc()) {
return false;
}
+
var views = this.get('views'),
- tempView = views[view] || {};
+ tempView = views[view] || {};
if (reduce) {
tempView.reduce = reduce;
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/6c043158/app/addons/documents/tests/actionsSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/actionsSpec.js b/app/addons/documents/tests/actionsSpec.js
index 605298a..d0a44bd 100644
--- a/app/addons/documents/tests/actionsSpec.js
+++ b/app/addons/documents/tests/actionsSpec.js
@@ -45,6 +45,8 @@ define([
params: { limit: 10 },
database: database
});
+
+ designDocs = designDocs.models;
});
afterEach(function () {
@@ -103,7 +105,7 @@ define([
Actions.saveView(viewInfo);
- var updatedDesignDoc = designDocs.first().dDocModel();
+ var updatedDesignDoc = _.first(designDocs).dDocModel();
assert.equal(updatedDesignDoc.get('views')['test-view'].reduce, '_sum');
});
@@ -118,7 +120,7 @@ define([
designDocs: designDocs
};
- var updatedDesignDoc = designDocs.first().dDocModel();
+ var updatedDesignDoc = _.first(designDocs).dDocModel();
var spy = sinon.spy(updatedDesignDoc, 'save');
Actions.saveView(viewInfo);
@@ -138,7 +140,7 @@ define([
newView: true,
designDocs: designDocs
};
- var designDoc = designDocs.first();
+ var designDoc = _.first(designDocs);
designDoc.save = function () {
var promise = $.Deferred();
@@ -168,7 +170,7 @@ define([
}
}
};
- var designDoc = designDocs.first();
+ var designDoc = _.first(designDocs);
designDoc.save = function () {
var promise = $.Deferred();
@@ -204,8 +206,8 @@ define([
params: { limit: 10 },
database: database
});
-
- designDoc = designDocs.first();
+ designDocs = designDocs.models;
+ designDoc = _.first(designDocs);
});
@@ -226,7 +228,7 @@ define([
assert.ok(_.isUndefined(designDoc.getDdocView(viewName)));
});
- it('saves design do if has other views', function () {
+ it('saves design doc if has other views', function () {
var spy = sinon.spy(designDoc, 'save');
Actions.deleteView({