Github user robertkowalski commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/575#discussion_r44907599
--- 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 (
--- End diff --
you can use omit the else case in both functions:
```js
var blurb = 'Grant database member privileges to user accounts with the
following roles:';
if (this.props.section === 'admins') {
blurb = 'Grant database ADMIN privileges to user accounts with the
following roles:';
}
```
---
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.
---