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 2014/11/14 16:37:04 UTC
[GitHub] couchdb-fauxton pull request: Redesign Documents
GitHub user robertkowalski opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/151
Redesign Documents
This PR tries again to slice off small parts of 33 and my branch I created from 33
The goal is a faster and better review and a mergeable state as fauxton-master is a fast moving target. We merge parts of the branch iteratively and additionally refactor which is easier with small pieces. Smaller chunks also introduce less bugs as they can be tested more easy and the review does not take hours.
The plan: after this branch the select buttons are moving to the header:

@seanbarclay one note from the changes I made with the help of your awesome guide:
- it is currently not possible to style keys/values in the prettify-json area with different colors, they both get the same class from the library
I did not add the ability to hide the checkboxes - this is part of the next step where we have the toggle mechanism in the header. It is not a downgrade to the current functionality. I prepared everything so we can just remove the show-select class on a parent container to remove the checkboxes and to adjust the padding.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/robertkowalski/couchdb-fauxton doc-design
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/151.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 #151
----
commit 92a49d78c959e88a5d9b75f13ba82459ccd2f8bd
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-13T15:33:35Z
new design for docs
commit 444673f79467c0aed9b2148d044bb6588d628d58
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-13T16:45:50Z
wip
commit aa14008e0bce662d54728fd4cfa323353a20c8c6
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-13T17:03:15Z
easier customization
commit 6644436cd9feb8f89fbb52c69a23ec143f03eab0
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-13T21:33:47Z
styling: labels / checkboxes
commit 4b3d373c632f0d71b9ffcc01cb41cf8b58639417
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-14T13:17:53Z
fix change event
commit 25772c175013f6bfd1ba8b3ead34b7b882e9a389
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-14T14:29:45Z
show-select & select-all
commit e936cd76996040861924577c9b747473451d0407
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-14T14:57:04Z
whitespace
commit ba40f9b4536d3a5360f3fb678630ef9243090cb9
Author: Robert Kowalski <ro...@apache.org>
Date: 2014-11-14T15:04:31Z
Fix bulk-delete on all-doc-page
On Couch 1.6 `/_bulk_docs` returned `ok: true` when the request was an
success. On 2.0 the ok property is missing:
Example success message on 2.0:
```
[{"id":"Brocket","rev":"6-b6fa9e703c3eb92aa9c3a49cedf1e8c2"}]
```
Example error message on 2.0:
```
[{"id":"Blaggie-System","error":"conflict",
"reason":"Document update conflict."}]
```
Steps to reproduce the error in Fauxton:
- select 1 document in the all_docs screen
- click the trash icon to delete it
- click ok to delete it
- you are able to click the trash icon again and if you do, you
get an error
Closes COUCHDB-2462
----
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63473299
@benkeen thank you i corrected the behaviour. I initially implemented bulkdocs-deletion, I think it was meant to be just a select-all/deselect-all and i implemented it not properly
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63956051
whoops sorry, accidently deleted the branch. it is up again: https://github.com/apache/couchdb-fauxton/pull/161
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63640759
I would say that's a bug
---
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: Redesign Documents
Posted by michellephung <gi...@git.apache.org>.
Github user michellephung commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#discussion_r20593171
--- Diff: app/addons/documents/tests/nightwatch/deletesDocument.js ---
@@ -21,13 +21,14 @@ module.exports = {
.loginToGUI()
.createDocument(newDocumentName, newDatabaseName)
.url(baseUrl)
- .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime, false)
- .pause(1000)
+ .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime)
.click('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]')
- .waitForElementPresent('[data-id="'+newDocumentName+'"] .btn.btn-small.btn-danger.delete', waitTime, false)
- .execute('$("[data-id=\''+newDocumentName+'\'] .btn.btn-small.btn-danger.delete").click();')
+ .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime)
+ .click('label[for="checkbox-' + newDocumentName + '"]')
+ .waitForElementPresent('.js-bulk-delete:not(.disabled)', waitTime)
+ .click('button.js-bulk-delete')
.acceptAlert()
- .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
+ .waitForElementVisible('#global-notifications .alert.alert-info', waitTime)
--- End diff --
.waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
[ Needs third argument set to false so if element never shows up, this test doesn't stop subsequent tests. ]
---
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: Redesign Documents
Posted by seanbarclay <gi...@git.apache.org>.
Github user seanbarclay commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63774740
Thanks guys. Nice work.
The select controls not matching the intended design is an issue unless you think the controls are not a good idea in the first place. Hopefully we can figure out how to match the intended design there better before the next branch.
Another thing is how the All Button selects all. But if you deselect and click All, then it toggles the selected to deselected, and toggles deselected to selected. That's not really what I was intending there and why I thought having Select all and Deselect as separate controls might help to avoid this.
The other solution there is not to toggle- but add/remove the js-to-delete class from all.
For the JSON in docs- I was hoping we would reuse the doc editor library, but disable the editing, which I believe from tinkering way back that there is a JS property to do that. Let me know if that's going to be an issue.
The edit pencil- let's add a red color on hover transition there. Are we not adding adding the more menu? that would allow a user to duplicate, delete, etc.
Select button: Let's line that up horizontally with the _id key to the right.
On the doc checkbox, let's change the hover from #FFF to #CCC
I can talk to you more about it in the morning. I'm torched for tonight.
---
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: Redesign Documents
Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63680994
Looks good! +1 from 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: Redesign Documents
Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63499281
Looks good! Just one minor thing. If you click "All" on a page to select everything, then go to the next page via the ">" image, then go back to the previous page with "<", all the first page documents are checked but "All" is no longer selected. But this may be okay... what do you think?
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#discussion_r20709139
--- Diff: app/addons/documents/tests/nightwatch/deletesDocument.js ---
@@ -21,13 +21,14 @@ module.exports = {
.loginToGUI()
.createDocument(newDocumentName, newDatabaseName)
.url(baseUrl)
- .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime, false)
- .pause(1000)
+ .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime)
.click('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]')
- .waitForElementPresent('[data-id="'+newDocumentName+'"] .btn.btn-small.btn-danger.delete', waitTime, false)
- .execute('$("[data-id=\''+newDocumentName+'\'] .btn.btn-small.btn-danger.delete").click();')
+ .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime)
+ .click('label[for="checkbox-' + newDocumentName + '"]')
+ .waitForElementPresent('.js-bulk-delete:not(.disabled)', waitTime)
+ .click('button.js-bulk-delete')
.acceptAlert()
- .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
+ .waitForElementVisible('#global-notifications .alert.alert-info', waitTime)
--- End diff --
@michellephung I readded it to keep it consistent for now: https://github.com/apache/couchdb-fauxton/commit/4694a4e2af151c85e5d4a73c141676ab5930d9e8
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#discussion_r20593307
--- Diff: app/addons/documents/tests/nightwatch/deletesDocument.js ---
@@ -21,13 +21,14 @@ module.exports = {
.loginToGUI()
.createDocument(newDocumentName, newDatabaseName)
.url(baseUrl)
- .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime, false)
- .pause(1000)
+ .waitForElementPresent('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]', waitTime)
.click('#dashboard-content a[href="#/database/'+newDatabaseName+'/_all_docs"]')
- .waitForElementPresent('[data-id="'+newDocumentName+'"] .btn.btn-small.btn-danger.delete', waitTime, false)
- .execute('$("[data-id=\''+newDocumentName+'\'] .btn.btn-small.btn-danger.delete").click();')
+ .waitForElementVisible('label[for="checkbox-' + newDocumentName + '"]', waitTime)
+ .click('label[for="checkbox-' + newDocumentName + '"]')
+ .waitForElementPresent('.js-bulk-delete:not(.disabled)', waitTime)
+ .click('button.js-bulk-delete')
.acceptAlert()
- .waitForElementVisible('#global-notifications .alert.alert-info', waitTime, false)
+ .waitForElementVisible('#global-notifications .alert.alert-info', waitTime)
--- End diff --
is there a reason not to fail fast if it is already broken at this step?
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63677738
@benkeen i fixed that and added a test
---
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: Redesign Documents
Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:
https://github.com/apache/couchdb-fauxton/pull/151
---
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: Redesign Documents
Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:
https://github.com/apache/couchdb-fauxton/pull/151#issuecomment-63111210
HI @robertkowalski, one minor issue:
1. On a page that has multiple documents, select the first item. The delete icon becomes enabled, as you'd expect.
2. Click "All" twice. That toggles the checked rows, making the first row the only checked one again. However, the delete icon is no longer clickable.
@seanbarclay: Is "all" the right label for that button? If it's intended to toggle the selected rows, maybe "Toggle" might be more accurate? Or alternatively maybe the button should simple check/uncheck all and wipe out what you already have checked.
---
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.
---