<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 {arrayOf, bool, shape, string} = PropTypes

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

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

  renderUserMenuBlockWithCustomLinks(customLinks, logoutLink) {
    return [<NavHeader key={0} title="User" />].concat(
      customLinks
        .map(({name, url}, i) =>
          <NavListItem
            key={i + 1}
            useAnchor={true}
            isExternal={true}
            link={url}
          >
            {name}
          </NavListItem>
        )
        .concat(
          <NavListItem
            key={customLinks.length + 1}
            useAnchor={true}
            link={logoutLink}
          >
            Logout
          </NavListItem>
        )
    )
  },

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

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

    return isHidden
      ? null
      : <NavBar location={location}>
          <div className="sidebar--item">
            <Link
              to={`${sourcePrefix}/${DEFAULT_HOME_PAGE}`}
              className="sidebar--square sidebar--logo"<commit_msg>Use ES6 spread operator instead of .concat for nav items<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 {arrayOf, bool, shape, string} = PropTypes

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

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

  renderUserMenuBlockWithCustomLinks(customLinks, logoutLink) {
    return [
      <NavHeader key={0} title="User" />,
      ...customLinks.map(({name, url}, i) =>
        <NavListItem key={i + 1} useAnchor={true} isExternal={true} link={url}>
          {name}
        </NavListItem>
      ),
      <NavListItem
        key={customLinks.length + 1}
        useAnchor={true}
        link={logoutLink}
      >
        Logout
      </NavListItem>,
    ]
  },

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

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

    return isHidden
      ? null
      : <NavBar location={location}>
          <div className="sidebar--item">
            <Link
              to={`${sourcePrefix}/${DEFAULT_HOME_PAGE}`}
              className="sidebar--square sidebar--logo"
{'fraction_non_alphanumeric': 0.12506582411795683, 'fraction_numerical': 0.0018430753027909425, 'mean_word_length': 2.370896184560781, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '6799777', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1148, 'n_words': 243}