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/09/08 15:40:45 UTC

[GitHub] couchdb-fauxton pull request: Fix missing section name if deleting...

GitHub user robertkowalski opened a pull request:

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

    Fix missing section name if deleting the first item

    - refetch collection and rerender view after a delete
    
    closes COUCHDB-2321

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

    $ git pull https://github.com/robertkowalski/couchdb-fauxton COUCHDB-2321--config-delete-optimistic

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

    https://github.com/apache/couchdb-fauxton/pull/56.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 #56
    
----
commit b94d2ad146d056efdd3a62f5c2fb069dde6a0e58
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2014-09-08T13:40:38Z

    Config: remove unused views from base.js

commit 4f5b3f9bc28c2475b421f42b59c8cdfdd78c0adb
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2014-09-08T13:41:34Z

    Fix missing section name if deleting the first item
    
      - refetch collection and rerender view after a delete
    
    closes COUCHDB-2321

----


---
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 section name if deleting...

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/56#discussion_r18145830
  
    --- Diff: app/addons/config/views.js ---
    @@ -35,12 +35,18 @@ function(app, FauxtonAPI, Config, Components) {
           "keyup .js-value-input": "processKeyEvents"
         },
     
    -    deleteValue: function (event) {
    -      var result = confirm("Are you sure you want to delete this configuration value?");
    +    deleteValue: function () {
    +      var collection = this.collection,
    +          result = confirm("Are you sure you want to delete this configuration value?");
     
           if (!result) { return; }
     
    -      this.model.destroy();
    +      this.model.destroy().done(function () {
    +        collection.fetch({reset: true}).done(function () {
    +          Views.Events.trigger("rerender");
    --- End diff --
    
    @robertkowalski this is great. But could you change this from `Views.Events` to `Fauxton.Events`. We have a global events object. Could you refactor this whole module to move to using that instead of its own events object.


---
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 section name if deleting...

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/56#discussion_r18232082
  
    --- Diff: app/addons/config/views.js ---
    @@ -35,12 +32,18 @@ function(app, FauxtonAPI, Config, Components) {
           "keyup .js-value-input": "processKeyEvents"
         },
     
    -    deleteValue: function (event) {
    -      var result = confirm("Are you sure you want to delete this configuration value?");
    +    deleteValue: function () {
    +      var collection = this.collection,
    +          result = confirm("Are you sure you want to delete this configuration value?");
     
           if (!result) { return; }
     
    -      this.model.destroy();
    +      this.model.destroy().done(function () {
    +        collection.fetch({reset: true}).done(function () {
    +          FauxtonAPI.Events.trigger("config:rerender", this.selectAllMenu);
    --- End diff --
    
    Is the `this` correct in this `this.selectAllMenu`? Does the collection or the view have that property?


---
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 section name if deleting...

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

    https://github.com/apache/couchdb-fauxton/pull/56#issuecomment-57349966
  
    @garrensmith good catch, it did not belong there at all!


---
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 section name if deleting...

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

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


---
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 section name if deleting...

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

    https://github.com/apache/couchdb-fauxton/pull/56#issuecomment-57347298
  
    I refactored it and found a bug with the modal: https://issues.apache.org/jira/browse/COUCHDB-2344 - but I don't think it is blocking this PR


---
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 section name if deleting...

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

    https://github.com/apache/couchdb-fauxton/pull/56#issuecomment-57348905
  
    Awesome thanks @robertkowalski. I have one question on this. Otherwise I'm +1.


---
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 section name if deleting...

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

    https://github.com/apache/couchdb-fauxton/pull/56#issuecomment-57434675
  
    +1. Merge 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.
---