You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2015/02/12 19:42:54 UTC
[GitHub] couchdb-fauxton pull request: Fix missing confirmation when leavin...
GitHub user robertkowalski opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/267
Fix missing confirmation when leaving editor
To not render a property in React we need to pass `null` to it. If
we are passing `false` or `"false"` it gets rendered into the DOM.
This fixes a bug where you edited a document and then got no
confirmation dialog if you are really sure you want to leave the
page without saving if you clicked on the navigation bar on the
left.
Having `data-bypass="false"` will mean to the selector
`:not(["data-bypass"])` that there is a `data-bypass` - containing
a String! (which then matches the selector)
What we want is _no_ `data-bypass` if we don't want to bypass.
Looking at the old DOM a month ago shows how we used `data-bypass`:
![bildschirmfoto 2015-02-12 um 19 12 19](https://cloud.githubusercontent.com/assets/298166/6174373/9092ac76-b2ee-11e4-8f26-3873cd1b4979.png)
Closes COUCHDB-2574
superseeds #263
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/robertkowalski/couchdb-fauxton 2574-save-editor-changed-confirmation-react-bug
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/267.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 #267
----
commit cf03798402d7c02b1d124e15960e9e203ae73ff8
Author: Robert Kowalski <ro...@apache.org>
Date: 2015-02-12T18:13:40Z
Fix coding style
commit 60dce889c5e0f950b948cb05811046f8eb4b93f6
Author: Robert Kowalski <ro...@apache.org>
Date: 2015-02-12T18:14:58Z
Fix missing confirmation when leaving editor
Fix for passing false as a string with is evaluated truthy
This fixes a bug where you edited a document and then got no
confirmation dialog if you are really sure you want to leave the
page without saving if you clicked on the navigation bar on the
left.
To not render a property in React we need to pass `null` to it. If
we are passing `false` or `"false"` it gets rendered into the DOM.
Having `data-bypass="false"` will mean to the selector
`:not(["data-bypass"])` that there is a `data-bypass` - containing
a String! (which then matches the selector)
What we want is _no_ `data-bypass` if we don't want to bypass.
Closes COUCHDB-2574
----
---
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: Fix missing confirmation when leavin...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/267#issuecomment-74662626
merged as b030b218a5e9e1fd891bc9750c593f356dd5cb7f and c6e6a438f9bd29434215c93f0552db8192fecf75
---
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: Fix missing confirmation when leavin...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/267#issuecomment-74662259
@benkeen I like the idea of #263 as it follows the principles of the least surprise.
What do you think of something like this for changing the routers api: match on all, but not on `data-bypass="false"`. This would also keep older components like the global notifications working.
---
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: Fix missing confirmation when leavin...
Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/267#issuecomment-74127677
Awesome. +1
I still think https://github.com/apache/couchdb-fauxton/pull/263 should be added, because the currently logic is incorrect: it just checks for the *existence* of the data-bypass attribute and not its value (true/false). As such, it will never run the event delegated code (FauxtonAPI.navigate()) for anything with that attribute regardless of value.
Your fix fixes it for React components, but not for any old code.
Just my 2 cents.
---
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: Fix missing confirmation when leavin...
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:
https://github.com/apache/couchdb-fauxton/pull/267
---
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.
---