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

    https://github.com/apache/couchdb-fauxton/pull/386#discussion_r30854540
  
    --- Diff: app/addons/activetasks/components.react.jsx ---
    @@ -453,17 +384,71 @@ define([
               <td>{startedOnMsg}</td>
               <td>{updatedOnMsg}</td>
               <td>{rowData.pid}</td>
    -          <td>{progressMsg}</td>
    +          <td>{progressMsg}<ActiveTasksViewSourceSequence 
item={this.props.item}/></td>
             </tr>
           );
         }
       });
     
    +  var ActiveTasksViewSourceSequence = React.createClass({
    +    onTrayToggle: function (e) {
    +      e.preventDefault();
    +      this.refs.view_source_sequence_btn.toggle(function (shown) {
    +        if (shown) {
    +          this.refs.view_source_sequence_btn.getDOMNode().focus();
    +        }
    +      }.bind(this));
    +    },
    +
    +    sequences: function (item) {
    +      if (_.isNumber(item) ) {
    +        return (
    +          <ComponentsReact.ClipboardWithTextField textToCopy={item} 
uniqueKey={item}>
    +          </ComponentsReact.ClipboardWithTextField>
    +          );
    +      } else if (_.isArray(item)) {
    +        return (
    +          _.map(item, function (seq, i) {
    +            return (
    +              <ComponentsReact.ClipboardWithTextField textToCopy={seq} 
uniqueKey={i + Math.random(100)} key={i}>
    +              </ComponentsReact.ClipboardWithTextField>
    +            );
    +          })
    +        );
    +      }
    +    },
    +
    +    render: function () {
    +
    +      if (_.has(this.props.item, 'source_seq')) {
    +        var sequences = this.sequences(this.props.item.source_seq);
    +        return (
    +          <div>
    +            Current source sequence: 
    +            <a href="#" 
    +              className="view-source-sequence-btn" 
    +              onClick={this.onTrayToggle} 
    +              data-bypass="true">
    +              View
    +            </a>
    +            <ComponentsReact.Tray ref="view_source_sequence_btn" 
className="view_source_sequence_tray">
    +              <span className="add-on">Source Sequence</span>
    +              {sequences}
    +            </ComponentsReact.Tray>
    +          </div>
    +        );
    +      } else {
    --- End diff --
    
    you return early, no need for the else


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