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/06/23 08:42:24 UTC
[1/2] fauxton commit: updated refs/heads/master to 2c37da5
Repository: couchdb-fauxton
Updated Branches:
refs/heads/master 52753f1f8 -> 2c37da5cb
Change '<' behaviour
When in a view always return to _all_docs. When viewing a doc use the
history.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/2c37da5c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/2c37da5c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/2c37da5c
Branch: refs/heads/master
Commit: 2c37da5cbc934c627e3b6ed8ac2040da2e8e3f36
Parents: 32917ab
Author: Garren Smith <ga...@gmail.com>
Authored: Mon Jun 22 10:29:11 2015 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jun 23 08:41:49 2015 +0200
----------------------------------------------------------------------
app/addons/documents/helpers.js | 5 ++++-
app/addons/documents/routes-doc-editor.js | 6 +++---
2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2c37da5c/app/addons/documents/helpers.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/helpers.js b/app/addons/documents/helpers.js
index 1d156b2..4a999f7 100644
--- a/app/addons/documents/helpers.js
+++ b/app/addons/documents/helpers.js
@@ -16,7 +16,7 @@ define([
var Helpers = {};
- Helpers.getPreviousPage = function (database, wasCloned) {
+ Helpers.getPreviousPageForDoc = function (database, wasCloned) {
var previousPage = database.url('index'), // default to the current database's all_docs page
lastPages = FauxtonAPI.router.lastPages;
@@ -33,6 +33,9 @@ define([
return previousPage;
};
+ Helpers.getPreviousPage = function (database) {
+ return database.url('index');
+ };
// sequence info is an array in couchdb2 with two indexes. On couch 1.x, it's just a string / number
Helpers.getSeqNum = function (val) {
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/2c37da5c/app/addons/documents/routes-doc-editor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/routes-doc-editor.js b/app/addons/documents/routes-doc-editor.js
index 400de43..bf5d28c 100644
--- a/app/addons/documents/routes-doc-editor.js
+++ b/app/addons/documents/routes-doc-editor.js
@@ -49,7 +49,7 @@ function (app, FauxtonAPI, Helpers, Documents, DocEditor, Databases) {
},
crumbs: function () {
- var previousPage = Helpers.getPreviousPage(this.database, this.wasCloned);
+ var previousPage = Helpers.getPreviousPageForDoc(this.database, this.wasCloned);
return [
{ type: 'back', link: previousPage },
@@ -72,7 +72,7 @@ function (app, FauxtonAPI, Helpers, Documents, DocEditor, Databases) {
this.docView = this.setView('#dashboard-content', new DocEditor.CodeEditor({
model: this.doc,
database: this.database,
- previousPage: Helpers.getPreviousPage(this.database)
+ previousPage: Helpers.getPreviousPageForDoc(this.database)
}));
},
@@ -126,7 +126,7 @@ function (app, FauxtonAPI, Helpers, Documents, DocEditor, Databases) {
},
crumbs: function () {
- var previousPage = Helpers.getPreviousPage(this.database);
+ var previousPage = Helpers.getPreviousPageForDoc(this.database);
return [
{ type: 'back', link: previousPage },
{ name: 'New Document', link: '#' }
[2/2] fauxton commit: updated refs/heads/master to 2c37da5
Posted by ga...@apache.org.
Encode Url for document id
This fixes the issue of documents created with '\' causing the back
button to not work properly.
This fixes COUCHDB-2717
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/32917ab7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/32917ab7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/32917ab7
Branch: refs/heads/master
Commit: 32917ab763b75d1ddbbfdd93a12a4315f662dd23
Parents: 52753f1
Author: Garren Smith <ga...@gmail.com>
Authored: Tue Jun 16 15:59:50 2015 +0200
Committer: Garren Smith <ga...@gmail.com>
Committed: Tue Jun 23 08:41:49 2015 +0200
----------------------------------------------------------------------
app/addons/documents/base.js | 2 +-
app/addons/documents/tests/routeSpec.js | 14 +++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/32917ab7/app/addons/documents/base.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/base.js b/app/addons/documents/base.js
index ba4a892..348b16d 100644
--- a/app/addons/documents/base.js
+++ b/app/addons/documents/base.js
@@ -75,7 +75,7 @@ function (app, FauxtonAPI, Documents) {
},
app: function (database, doc) {
- return '/database/' + database + '/' + doc;
+ return '/database/' + database + '/' + encodeURI(doc);
},
apiurl: function (database, doc) {
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/32917ab7/app/addons/documents/tests/routeSpec.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/tests/routeSpec.js b/app/addons/documents/tests/routeSpec.js
index a6aab28..84bd9f8 100644
--- a/app/addons/documents/tests/routeSpec.js
+++ b/app/addons/documents/tests/routeSpec.js
@@ -11,12 +11,14 @@
// the License.
define([
+ 'api',
+ 'addons/documents/base',
'addons/documents/routes',
'addons/documents/header/header.actions',
'addons/documents/index-results/actions',
'testUtils'
-], function (Documents, HeaderActions, IndexResultsActions, testUtils) {
+], function (FauxtonAPI, Base, Documents, HeaderActions, IndexResultsActions, testUtils) {
var assert = testUtils.assert;
var DocumentRoute = Documents.RouteObjects[2];
@@ -50,4 +52,14 @@ define([
});
});
+
+ describe('Fauxton Urls', function () {
+
+ it('document app encodes document id', function () {
+ var id = "\foo";
+ var url = FauxtonAPI.urls('document', 'app', 'fake-db', id);
+ assert.deepEqual("/database/fake-db/%0Coo", url);
+ });
+
+ });
});