You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by sergey-safarov <gi...@git.apache.org> on 2016/11/06 10:07:32 UTC
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed view displaying for d...
GitHub user sergey-safarov opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/802
COUCHDB-3224: Fixed view displaying for database with "/" symbols in name
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sergey-safarov/couchdb-fauxton COUCHDB-3224
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/802.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #802
----
commit 9d5d8d335d6dc0b9faeb3db8f1052a66aaaf3331
Author: Sergey Safarov <s....@gmail.com>
Date: 2016-11-06T10:04:42Z
COUCHDB-3224: Fixed view displaying for database with "/" symbols in name
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@garrensmith I updated PR but exist two issues:
1) tests is looped
2) two tests is failed.
I can revert back last changes.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@garrensmith I update pull request.
Please look at replication dialog. Generated POST with content
{"user_ctx":{"name":null,"roles":["_admin","_reader","_writer"]},"source":{"headers":{},"url":"http://217.12.247.220:5984/account%2F9b%2F44%2F9289fc701376b87ac2ad5ee78571"},"target":{"headers":{},"url":"http://217.12.247.220:5984/asdfsad"},"create_target":true,"continuous":false}
But replication is failed. This is CouchDB issue?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Pull request is updated.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
About test cases. I can make hotfix but test case creation is to complex task for me.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r104326008
--- Diff: app/addons/documents/components/jumptodoc.react.jsx ---
@@ -28,7 +28,7 @@ const JumpToDoc = ({database, loadOptions}) => {
ignoreCase={false}
cache={false}
onChange={({value: docId}) => {
- const url = FauxtonAPI.urls('document', 'app', encodeURIComponent(database.id), app.utils.safeURLName(docId));
+ const url = FauxtonAPI.urls('document', 'app', encodeURIComponent(database.id), encodeURIComponent(docId));
--- End diff --
Is may be removed "safeURLName" function from app.utils?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r106408073
--- Diff: app/addons/databases/actions.js ---
@@ -176,7 +176,7 @@ export default {
databaseName = databaseName.trim();
- const url = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(databaseName), '');
+ const url = FauxtonAPI.urls('allDocs', 'app', encodeURIComponent(databaseName), '');
--- End diff --
Same as aboce it seems its better to use `allDocsSantized` then you don't need to encodeURIComponent
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Requested changes in 04f05996264302a6802cbe6ca2ba4b8e33fcac93
If i correctly understand what is you requested.
Also i search for other places where is used "encodeURIComponent" and make changes in 51c209bd3e0031085599452db4c7f1f57832c77b
Please make review of this commits too.
If all is ok, then I will squash three into one commit.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r104325765
--- Diff: app/addons/documents/index-editor/stores.js ---
@@ -186,7 +186,7 @@ Stores.IndexEditorStore = FauxtonAPI.Store.extend({
getSaveDesignDoc: function () {
if (this._designDocId === 'new-doc') {
var doc = {
- _id: '_design/' + this._newDesignDocName,
+ _id: '_design/' + encodeURIComponent(this._newDesignDocName),
--- End diff --
Here is encoded DesignDoc name in POST request to CouchDB
Where is may be encoded viewname in POST request to CouchDB?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@sergey-safarov the PR looks good, it will be superseeded by https://github.com/apache/couchdb-fauxton/pull/807 which contains more fixes and changes our integration tests to default to database names with special chars.
your commit will land seperately together with the other commits :)
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@garrensmith thank you for update
I tested current fauxton master all fine except one "Cancel" button.
To reproduce required start editing of view or create new view and press cancel.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Is may be removed "safeURLName" function from app.utils?
View name displaying is fixed view not work properly. I not know how to fix.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Thanks @sergey-safarov this is great. The tests are failing. Could you see why. And could you maybe add a test or two to prove this improves and fixes the `/` issues
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@sergey-safarov I will take a look next week. The PR has quite wide reaching effects. So I need to take a look at it. Leave it as is for now.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
hey, thank you for your contribution -- i was on vacation, i'll check next week!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r106408017
--- Diff: app/addons/databases/actions.js ---
@@ -155,7 +155,7 @@ export default {
type: 'success',
clear: true
});
- var route = FauxtonAPI.urls('allDocs', 'app', app.utils.safeURLName(databaseName), '?limit=' + Resources.DocLimit);
+ var route = FauxtonAPI.urls('allDocs', 'app', encodeURIComponent(databaseName), '?limit=' + Resources.DocLimit);
--- End diff --
Could you rather use this function https://github.com/apache/couchdb-fauxton/blob/master/app/addons/documents/base.js#L40 and then you don't need to encodeURIComponent
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Ok. @robertkowalski needs to review this before we can merge.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@sergey-safarov seems it was a travis issue. Could you fix the lint issues and try again.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
@sergey-safarov thanks for trying to help us with this. We have decided to rather solve this with `encodeURIComponent`. I've just merged a PR that should fix the view section.
Unfortunately we won't need this PR. But it would be great if you could test fauxton master and make sure we have now fixed all the encoding issues.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Hi @sergey-safarov this is looking good. I spotted another encoding issue. If I create a new view and give it a `/` then it fails like this:

Would you be able to fix this as well? You should just need to do a decodeURIComponent in some of the react components. After that and once all the tests pass I can merge this in.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Thanks for testing, would you be able to make a fix for the bug you found?
All misspelling thanks to my iPhone.
On Mon, Feb 27, 2017 at 5:31 PM +0200, "sergey-safarov" <no...@github.com> wrote:
@garrensmith thank you for update
I tested current fauxton master all fine except one "Cancel" button.
To reproduce required start editing of view or create new view and press cancel.
\u2014
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r103267380
--- Diff: app/addons/documents/doc-editor/components.react.jsx ---
@@ -227,7 +227,7 @@ var AttachmentsPanelButton = React.createClass({
var doc = this.props.doc.get('_id');
return _.map(this.props.doc.get('_attachments'), function (item, filename) {
- var url = FauxtonAPI.urls('document', 'attachment', db, doc, app.utils.safeURLName(filename));
+ var url = FauxtonAPI.urls('document', 'attachment', encodeURIComponent(db), doc, app.utils.safeURLName(filename));
--- End diff --
Could you remove `safeURLName` we don't need it if we use the encodeURIComponent.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed view displaying for database...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Hello @garrensmith error is fixed
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Could you rather do this work on a new PR and close this one.�
All misspelling thanks to my iPhone.
On Mon, Feb 27, 2017 at 6:13 PM +0200, "sergey-safarov" <no...@github.com> wrote:
Pull request is updated.
\u2014
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #802: COUCHDB-3224: Fixed database name encoding in vi...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/802
Hello @garrensmith
Could you look error present in build log.
Think some dependency cannot be installed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #802: COUCHDB-3224: Fixed database name encodin...
Posted by sergey-safarov <gi...@git.apache.org>.
Github user sergey-safarov commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/802#discussion_r104326088
--- Diff: app/addons/documents/index-editor/stores.js ---
@@ -186,7 +186,7 @@ Stores.IndexEditorStore = FauxtonAPI.Store.extend({
getSaveDesignDoc: function () {
if (this._designDocId === 'new-doc') {
var doc = {
- _id: '_design/' + this._newDesignDocName,
+ _id: '_design/' + encodeURIComponent(this._newDesignDocName),
--- End diff --
Is may be removed "safeURLName" function from app.utils?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---