You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by benkeen <gi...@git.apache.org> on 2016/02/19 22:39:35 UTC

[GitHub] couchdb-fauxton pull request: Make DesignDocSelector into a dumb c...

GitHub user benkeen opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/650

    Make DesignDocSelector into a dumb component

    The dumbifies the DesignDocSelector to remove all ties a to
    store and passes everything via props so we can get more use out
    of it. Specifically, I need this for my next PR which includes
    a new, generic Clone Index modal that'll use this component
    in different contexts (i.e. all index types).
    
    Also includes validation in the component to make it more
    self-contained and allows for better UX by focusing on error fields.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/benkeen/couchdb-fauxton design-doc-selector-update

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/650.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 #650
    
----
commit 3e04c6f5798ef4ce5dba7d4bf9736937b29d54a5
Author: Ben Keen <be...@gmail.com>
Date:   2016-02-19T19:05:04Z

    Make DesignDocSelector into a dumb component
    
    The dumbifies the DesignDocSelector to remove all ties a to
    store and passes everything via props so we can get more use out
    of it. Specifically, I need this for my next PR which includes
    a new, generic Clone Index modal that'll use this component
    in different contexts (i.e. all index types).
    
    Also includes validation in the component to make it more
    self-contained and allows for better UX by focusing on error fields.

----


---
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: Make DesignDocSelector into a dumb c...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187689643
  
    +1 after using this.state


---
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: Make DesignDocSelector into a dumb c...

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/650#discussion_r53776369
  
    --- Diff: app/addons/documents/index-editor/components.react.jsx ---
    @@ -330,6 +331,7 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents)
             database: this.state.database,
             newView: this.state.isNewView,
             viewName: this.state.viewName,
    +        designDoc: indexEditorStore.getSaveDesignDoc(),
    --- End diff --
    
    `this.state.saveDesignDoc`
    
    saves performance & is in general nicer :)


---
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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-186455765
  
    Hey @robertkowalski, there's a failing test on this one, but it may have uncovered a related problem so I wanted to confirm the behaviour before fixing it. 
    
    Here's the scenario (do this on master): 
    1. editing a view and select "_sum" as the optional reduce option.
    2. result: it shows a single doc (the summed doc).
    
    So far, this seems correct to me. 
    
    3. now click back to all docs, then click on the View that you just added `_sum` to.
    4. That page then shows all docs in the view, not a single _sum result. 
    
    Is this behaviour correct? Seems strange to me... shouldn't that View now *always* just show the single document when you've selected _sum for a View, like the test is confirming?


---
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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187730685
  
    Nice, thanks Robert! Yeah I stuck the store call at that location because technically it was only needed at that point: and calling it *always* would call it before the data was actually ready. Not a big deal at all, I can just add in a clause to clear it up, and I agree it's cleaner to put them all in state. 


---
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: Make DesignDocSelector into a dumb c...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/650


---
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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187423517
  
    Here we go. I slimmed down the component further to remove the getter and the Backbone props (Document + design doc collection).


---
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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187230096
  
    Great, thanks Robert. I'll patch that up with this ticket and write a test for it. 


---
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: Make DesignDocSelector into a dumb c...

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187229609
  
    > Is this behaviour correct? Seems strange to me... shouldn't that View now always just show the single document when you've selected _sum for a View, like the test is confirming?
    
    yes that sounds like 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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#issuecomment-187268765
  
    Okay, I pared back this ticket a bit. I was a little overambitious in my refactoring. The next PR [https://github.com/apache/couchdb-fauxton/pull/651] moves the Views to their own page and will remove the need for some of the logic to dynamically reload the result list.


---
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: Make DesignDocSelector into a dumb c...

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/650#discussion_r53666391
  
    --- Diff: app/addons/documents/index-editor/components.react.jsx ---
    @@ -326,10 +351,12 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents)
             return;
           }
     
    +      var doc = this.refs.designDocSelector.getDesignDoc();
    --- End diff --
    
    hmmm, not feeling comfortable by calling a getter on a view to get data. we used to do that with backbone a lot and it got us really into trouble.
    
    maybe we can put that into a store and let the component fire an action? the dumb component does not need to be connected directly to the store, it could get the data updates as props from the parent component 


---
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: Make DesignDocSelector into a dumb c...

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/650#discussion_r53668730
  
    --- Diff: app/addons/documents/index-editor/components.react.jsx ---
    @@ -326,10 +351,12 @@ function (app, FauxtonAPI, React, Stores, Actions, Components, ReactComponents)
             return;
           }
     
    +      var doc = this.refs.designDocSelector.getDesignDoc();
    --- End diff --
    
    Blerg. I agree. Let me see what I can do. 


---
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.
---