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

    https://github.com/apache/couchdb-fauxton/pull/713#discussion_r64248343
  
    --- Diff: app/addons/documents/changes/components.react.jsx ---
    @@ -21,171 +21,177 @@ define([
       '../../components/react-components.react',
     
       'react-addons-css-transition-group',
    -  '../../../../assets/js/plugins/prettify',
    +  '../../../../assets/js/plugins/prettify'
     ], function (app, FauxtonAPI, React, ReactDOM, Actions, Stores, 
Components, ReactComponents, ReactCSSTransitionGroup) {
     
    -  var changesStore = Stores.changesStore;
    -
    +  var store = Stores.changesStore;
       var BadgeList = ReactComponents.BadgeList;
     
    -  // the top-level component for the Changes Filter section. Handles 
hiding/showing of the filters form
    -  var ChangesHeaderController = React.createClass({
    -    getInitialState: function () {
    -      return this.getStoreState();
    -    },
     
    -    getStoreState: function () {
    +  class ChangesController extends React.Component {
    +    constructor (props) {
    +      super(props);
    +      this.state = this.getStoreState();
    +    }
    +
    +    getStoreState () {
           return {
    -        showTabContent: changesStore.isTabVisible()
    +        changes: store.getChanges(),
    +        loaded: store.isLoaded(),
    +        databaseName: store.getDatabaseName(),
    +        isShowingSubset: store.isShowingSubset()
           };
    -    },
    +    }
     
    -    onChange: function () {
    +    onChange () {
           this.setState(this.getStoreState());
    -    },
    -
    -    componentDidMount: function () {
    -      changesStore.on('change', this.onChange, this);
    -    },
    +    }
     
    -    componentWillUnmount: function () {
    -      changesStore.off('change', this.onChange);
    -    },
    +    componentDidMount () {
    +      store.on('change', this.onChange, this);
    +    }
     
    -    toggleFilterSection: function () {
    -      Actions.toggleTabVisibility();
    -    },
    +    componentWillUnmount () {
    +      store.off('change', this.onChange);
    +    }
     
    -    render: function () {
    -      var tabContent = '';
    -      if (this.state.showTabContent) {
    -        tabContent = <ChangesTabContent key="changesFilterSection" />;
    +    showingSubsetMsg () {
    +      const { isShowingSubset, changes } = this.state;
    +      var msg = '';
    +      if (isShowingSubset) {
    +        var numChanges = changes.length;
    --- End diff --
    
    use let, it will not bleed out of the block


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