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

    https://github.com/apache/couchdb-fauxton/pull/575#discussion_r44907740
  
    --- Diff: app/addons/permissions/components.react.jsx ---
    @@ -123,39 +123,73 @@ function (app, FauxtonAPI, React, Components, Stores, 
Actions) {
           this.setState({newRole: e.target.value});
         },
     
    +    getAccountBlurb: function () {
    +      var blurb = '';
    +      if (this.props.section === 'admins') {
    +        blurb = 'Grant database ADMIN privileges to the following user 
accounts:';
    +      } else {
    +        blurb = 'Grant database member privileges to user accounts with 
the following roles:';
    +      }
    +      return (
    +        <header>
    +          <h4 className="capitalize">{this.props.section} Accounts</h4>
    +          <p>{blurb}</p>
    +        </header>
    +      );
    +    },
    +
    +    getRoleBlurb: function () {
    +      var blurb = '';
    +      if (this.props.section === 'admins') {
    +        blurb = 'Grant database ADMIN privileges to user accounts with the 
following roles:';
    +      } else {
    +        blurb = 'Grant database member privileges to user accounts with 
the following roles:';
    +      }
    +      return (
    +        <header>
    +          <h4 className="capitalize">{this.props.section} Roles</h4>
    +          <p>{blurb}</p>
    +        </header>
    +      );
    +    },
    +
    +    getPageHeader: function () {
    +      if (this.props.section === 'admins') {
    +        return (
    +          <header className="page-header">
    +            <h3>{this.props.title}</h3>
    +            <p className="help">
    +              {this.getHelp()}
    +              <a className="help-link" data-bypass="true" 
href={getDocUrl('DB_PERMISSION')} target="_blank">
    +                <i className="icon-question-sign"></i>
    +              </a>
    +            </p>
    +          </header>
    +       );
    +      } else {
    +        return '';
    --- End diff --
    
    you can use an early return instead. 
    
    please also return `null` instead of an empty string


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