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

    https://github.com/apache/couchdb-fauxton/pull/649#discussion_r53340739
  
    --- Diff: app/addons/components/react-components.react.jsx ---
    @@ -1046,13 +1055,28 @@ function (app, FauxtonAPI, React, ReactDOM, Stores, 
Actions,
         },
     
         getDocContent: function () {
    -      if (!_.isEmpty(this.props.docContent)) {
    -        return (
    -          <div className="doc-data">
    -            <pre className="prettyprint">{this.props.docContent}</pre>
    -          </div>
    -        );
    +      if (_.isEmpty(this.props.docContent)) {
    +        return null;
    +      }
    +
    +      // if need be, truncate the document
    +      var content = this.props.docContent;
    +      var isTruncated = false;
    +      if (this.props.truncate) {
    +        var lines = this.props.docContent.split('\n');
    +        if (lines.length > this.props.maxRows) {
    +          isTruncated = true;
    +          lines = lines.slice(0, this.props.maxRows);
    +          content = lines.join('\n');
    +        }
    --- End diff --
    
    can we move the logic to the store / data model?


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