<commit_before>import React, {Component} from 'react'
import PageHeader from './PageHeader'
import DragAndDrop from './DragAndDrop'
import {connect} from 'react-redux'
import {setCurrentDashboard} from '../reducers/dashboardReducer'
var PrintTemplate = require('react-print')

// export default class DashboardView extends Component {
const DashboardView = (props) => {
  const print = () => (
  window.print()
)

  return (
    <div className = "container-fluid">
        <button onClick={print} className="pull-right" id="react-no-print"><span className="glyphicon glyphicon-download"></span></button>
        <ul style={{listStyle: 'none'}}>
          <h3>Choose Dashboard</h3>
          { props.dashBoards.dashboards.map(db => (
            <li key={db.id} ><a onClick= { () => props.setCurrentDashboard(db.id)}>{db.title}</a> </li>
        )) }
        </ul>
            <div className="container">
                <DragAndDrop />
            </div>
    </div>
  )
}

// ----------------------- Container -----------------------
const mapStateToProps = (state) => (
  {
    dashBoards: state.dashboards,
    currentDashboardCards: state.dashboards.currentDashboard.cards
  }
)
const mapDispatchToProps = (dispatch) => ({
  setCurrentDashboard: (dbId) => {
    dispatch(setCurrentDashboard(dbId))
  }
})
export default connect(mapStateToProps, mapDispatchToProps)(DashboardView)
<commit_msg>trying to implement dashboard change using selector tool<commit_after>import React, {Component} from 'react'
import PageHeader from './PageHeader'
import DragAndDrop from './DragAndDrop'
import {connect} from 'react-redux'
import {setCurrentDashboard} from '../reducers/dashboardReducer'
var PrintTemplate = require('react-print')
import {Form, FormGroup, Button, ControlLabel, FormControl, ListGroup, ListGroupItem} from 'react-bootstrap'

// export default class DashboardView extends Component {
const DashboardView = (props) => {
  const print = () => (
  window.print()
)

  return (
    <div className = "container-fluid">
        <button onClick={print} className="pull-right" id="react-no-print"><span className="glyphicon glyphicon-download"></span></button>
        <div className="row">
        <div className="col-sm-3">

        <FormGroup controlId="formControlsSelect">
              <ControlLabel>Select a Dashboard</ControlLabel>
              <FormControl componentClass="select" placeholder="select" onChange= {props.setCurrentDashboard}>
              {
              props.dashBoards.dashboards.map((db)=>{
                return <option key = {db.id} value={db.id}>{db.title}</option>
              })
              }
              </FormControl>
            </FormGroup>
        </div>
        <div className="col-sm-9">
                <DragAndDrop />
        </div>
    </div>
  </div>
  )
}

// ----------------------- Container -----------------------
const mapStateToProps = (state) => (
  {
    dashBoards: state.dashboards,
    currentDashboardCards: state.dashboards.currentDashboard.cards
  }
)
const mapDispatchToProps = (dispatch) => ({
  setCurrentDashboard: (event) => {
    event.preventDefault()
    let dbId = event.target.value
    dispatch(setCurrentDashboard(dbId))
  }
})
export default connect(mapStateToProps, mapDispatchToProps)(DashboardView)

{'fraction_non_alphanumeric': 0.1628614916286149, 'fraction_numerical': 0.0012176560121765602, 'mean_word_length': 2.8795749704840614, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6696682', 'n_tokens_mistral': 941, 'n_tokens_neox': 940, 'n_words': 196}