<commit_before>import React, {PropTypes} from 'react'
import {withRouter, Link} from 'react-router'
import {connect} from 'react-redux'

import {
  NavBar,
  NavBlock,
  NavHeader,
  NavListItem,
} from 'src/side_nav/components/NavItems'

import {DEFAULT_HOME_PAGE} from 'shared/constants'

const {bool, shape, string} = PropTypes

const SideNav = React.createClass({
  propTypes: {
    params: shape({
      sourceID: string.isRequired,
    }).isRequired,
    location: shape({
      pathname: string.isRequired,
    }).isRequired,
    isHidden: bool.isRequired,
    logoutLink: string,
  },

  render() {
    const {
      params: {sourceID},
      location: {pathname: location},
      isHidden,
      logoutLink,
    } = this.props

    const sourcePrefix = `/sources/${sourceID}`
    const dataExplorerLink = `${sourcePrefix}/chronograf/data-explorer`
    const showLogout = !!logoutLink

    return isHidden
      ? null
      : <NavBar location={location}>
          <div className="sidebar--item">
            <Link
              to={`${sourcePrefix}/${DEFAULT_HOME_PAGE}`}
              className="sidebar--square sidebar--logo"
            >
              <span className="sidebar--icon icon cubo-uniform" />
            </Link>
          </div>
          <NavBlock icon="cubo-node" link={`${sourcePrefix}/hosts`}>
            <NavHeader link={`${sourcePrefix}/hosts`} title="Host List" />
          </NavBlock>
          <NavBlock icon="graphline" link={dataExplorerLink}>
            <NavHeader link={dataExplorerLink} title="Data Explorer" />
          </NavBlock>
          <NavBlock icon="dash-h" link={`${sourcePrefix}/dashboards`}>
            <NavHeader
              link={`${sourcePrefix}/dashboards`}
              title={'Dashboards'}
            />
          </NavBlock>
          <NavBlock
            matcher="alerts"
            icon="alert-triangle"
            link={`${sourcePrefix}/alerts`}
          >
            <NavHeader link={`${sourcePrefix}/alerts`} title="Alerting" />
            <NavListItem link={`${sourcePrefix}/alerts`}>
              Alert History
            </NavListItem>
            <NavListItem link={`${sourcePrefix}/alert-rules`}>
              Alert Rules
            </NavListItem>
          </NavBlock>
          <NavBlock icon="crown2" link={`${sourcePrefix}/admin`}>
            <NavHeader link={`${sourcePrefix}/admin`} title="Admin" />
          </NavBlock>
          <NavBlock icon="cog-thick" link={`${sourcePrefix}/manage-sources`}>
            <NavHeader
              link={`${sourcePrefix}/manage-sources`}
              title="Configuration"
            />
          </NavBlock>
          <div className="sidebar--bottom">
            <div className="sidebar--item">
              <div className="sidebar--square">
                <span className="sidebar--icon icon zap" />
              </div>
              <div className="sidebar-menu">
                <div className="sidebar-menu--heading">
                  Version: {VERSION}{/* eslint no-undef */}
                </div>
              </div>
            </div>
            {showLogout
              ? <NavBlock icon="user" className="sidebar--item-last">
                  <NavHeader
                    useAnchor={true}
                    link={logoutLink}
                    title="Logout"
                  />
                </NavBlock>
              : null}
          </div>
        </NavBar>
  },
})

const mapStateToProps = ({
  auth: {logoutLink},
  app: {ephemeral: {inPresentationMode}},
}) => ({
  isHidden: inPresentationMode,
  logoutLink,
})

export default connect(mapStateToProps)(withRouter(SideNav))<commit_msg>Attempt to block error when printing version number<commit_after>import React, {PropTypes} from 'react'
import {withRouter, Link} from 'react-router'
import {connect} from 'react-redux'

import {
  NavBar,
  NavBlock,
  NavHeader,
  NavListItem,
} from 'src/side_nav/components/NavItems'

import {DEFAULT_HOME_PAGE} from 'shared/constants'

const {bool, shape, string} = PropTypes

const V_NUMBER = VERSION /* eslint-disable no-undef */

const SideNav = React.createClass({
  propTypes: {
    params: shape({
      sourceID: string.isRequired,
    }).isRequired,
    location: shape({
      pathname: string.isRequired,
    }).isRequired,
    isHidden: bool.isRequired,
    logoutLink: string,
  },

  render() {
    const {
      params: {sourceID},
      location: {pathname: location},
      isHidden,
      logoutLink,
    } = this.props

    const sourcePrefix = `/sources/${sourceID}`
    const dataExplorerLink = `${sourcePrefix}/chronograf/data-explorer`
    const showLogout = !!logoutLink

    return isHidden
      ? null
      : <NavBar location={location}>
          <div className="sidebar--item">
            <Link
              to={`${sourcePrefix}/${DEFAULT_HOME_PAGE}`}
              className="sidebar--square sidebar--logo"
            >
              <span className="sidebar--icon icon cubo-uniform" />
            </Link>
          </div>
          <NavBlock icon="cubo-node" link={`${sourcePrefix}/hosts`}>
            <NavHeader link={`${sourcePrefix}/hosts`} title="Host List" />
          </NavBlock>
          <NavBlock icon="graphline" link={dataExplorerLink}>
            <NavHeader link={dataExplorerLink} title="Data Explorer" />
          </NavBlock>
          <NavBlock icon="dash-h" link={`${sourcePrefix}/dashboards`}>
            <NavHeader
              link={`${sourcePrefix}/dashboards`}
              title={'Dashboards'}
            />
          </NavBlock>
          <NavBlock
            matcher="alerts"
            icon="alert-triangle"
            link={`${sourcePrefix}/alerts`}
          >
            <NavHeader link={`${sourcePrefix}/alerts`} title="Alerting" />
            <NavListItem link={`${sourcePrefix}/alerts`}>
              Alert History
            </NavListItem>
            <NavListItem link={`${sourcePrefix}/alert-rules`}>
              Alert Rules
            </NavListItem>
          </NavBlock>
          <NavBlock icon="crown2" link={`${sourcePrefix}/admin`}>
            <NavHeader link={`${sourcePrefix}/admin`} title="Admin" />
          </NavBlock>
          <NavBlock icon="cog-thick" link={`${sourcePrefix}/manage-sources`}>
            <NavHeader
              link={`${sourcePrefix}/manage-sources`}
              title="Configuration"
            />
          </NavBlock>
          <div className="sidebar--bottom">
            <div className="sidebar--item">
              <div className="sidebar--square">
                <span className="sidebar--icon icon zap" />
              </div>
              <div className="sidebar-menu">
                <div className="sidebar-menu--heading">
                  Version: {V_NUMBER}
                </div>
              </div>
            </div>
            {showLogout
              ? <NavBlock icon="user" className="sidebar--item-last">
                  <NavHeader
                    useAnchor={true}
                    link={logoutLink}
                    title="Logout"
                  />
                </NavBlock>
              : null}
          </div>
        </NavBar>
  },
})

const mapStateToProps = ({
  auth: {logoutLink},
  app: {ephemeral: {inPresentationMode}},
}) => ({
  isHidden: inPresentationMode,
  logoutLink,
})

export default connect(mapStateToProps)(withRouter(SideNav))
{'fraction_non_alphanumeric': 0.13999458434876794, 'fraction_numerical': 0.00027078256160303275, 'mean_word_length': 1.9140039447731756, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2962277', 'n_tokens_mistral': 2079, 'n_tokens_neox': 2034, 'n_words': 381}