Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/52#discussion_r17231150
  
    --- Diff: app/addons/replication/route.js ---
    @@ -32,19 +31,30 @@ function(app, FauxtonAPI, Replication, Views) {
           {"name": "Replicate changes from: ", "link": "replication"}
         ],
         defaultView: function(dbname){
    -                   this.databases = new Replication.DBList({});
    -      this.tasks = new Replication.Tasks({id: "ReplicationTasks"});
    +      var isAdmin = FauxtonAPI.session.isAdmin();
    +
    +      this.databases = new Replication.DBList({});
           this.replication = new Replication.Replicate({});
    -                   this.setView("#dashboard-content", new 
Views.ReplicationForm({
    +
    +      if (isAdmin) {
    +        this.tasks = new Replication.Tasks({id: "ReplicationTasks"});
    +        this.setView("#dashboard-content", new 
Views.ReplicationFormForAdmins({
    +          selectedDB: dbname ||"",
    +          collection: this.databases,
    +          status: this.tasks
    +        }));
    +        return;
    +      }
    +      this.setView("#dashboard-content", new Views.ReplicationForm({
             selectedDB: dbname ||"",
    -                           collection: this.databases,
    -        status:  this.tasks
    -                   }));  
    +        collection: this.databases,
    +        status: this.tasks
    --- End diff --
    
    I would prefer that this is set `this.tasks = [];` at the beginning of this 
function. So we at least has some sort of value 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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to