<commit_before>/* jshint esnext: true */

import React             from 'react';
import MultiSelectField  from './components/multiselect-field/MultiSelectField.es6.js';
import CheckboxGroup     from './components/checkbox-group/CheckboxGroup.es6.js';
import StudentVis        from './components/student-vis/StudentVis.es6.js';
import SkillBubbles      from './components/skill-bubbles/SkillBubbles.es6.js';

let {Component} = React;

class SummaryData extends Component {
  render() {
    const {students, skills} = this.props;
    const studentCount = (students || []).length;
    const skillCount   = (skills || []).length;
    return (
      <summary-data>
      <div><count>{studentCount}</count><h1>Students</h1></div> <div><count>{skillCount}</count><h1>Skills</h1></div>
      </summary-data>
    );
  }
} 

export default class SummerOfTechApp extends Component {

  constructor(props) {
    super(props);
    const {store} = this.props;
    let names;
    const complementarySkills = store.listComplementarySkills(names);
    this.state = {
      primarySkills : names,
      levels        : store.listExperienceLevels(),
      students      : store.listActiveStudents(),
      complementarySkills: complementarySkills, 
      filterStudents: store.listStudentsWithSkills(names), 
      bubbleSkills: store.nestByCategory(complementarySkills)
    };
    this.handlers = {
      handleSkillsChange: this.handleSkillsChange.bind(this), 
      handleExperienceChange: this.handleExperienceChange.bind(this)
    };
  }

  handleSkillsChange(names) {
    this.setState({ primarySkills: names });
    this.whenPrimaryChange(names);
  }

  handleExperienceChange(levels) {
    const {store} = this.props;
    const names = this.state.primarySkills;
    store.activeExperienceLevels(levels);
    this.whenPrimaryChange(names);
  }

  whenPrimaryChange(names) {
    const {store} = this.props;
    const complementarySkills = store.listComplementarySkills(names);
    this.setState({
      primarySkills: names,
      complementarySkills: complementarySkills, 
      filterStudents: store.listStudentsWithSkills(names), 
      bubbleSkills: store.nestByCategory(complementarySkills)
    });
  }

  render() {
    const {store} = this.props;
    const {complementarySkills, students, filterStudents, levels, bubbleSkills} = this.state;
    let {handleSkillsChange, handleExperienceChange} = this.handlers;
    return (
      <div>
        <header>
          <div id="logo">
            <img src="../dist/assets/sot_logo_small.png" height="100"/>
            <img src="../dist/assets/sot_banner.png" height="88"/>
            <div id="subtitle"><div>find your intern</div></div>
          </div>
        </header>
        <page>
          <aside>
            <article>
            Discover students and their skills. 
            </article>
            <article>
              <MultiSelectField names={complementarySkills} onChange={handleSkillsChange} placeholder="Search for skills"/>
              <CheckboxGroup items={levels} onChange={handleExperienceChange}/>
            </article><commit_msg>[fix] static links to avoid issues with IE on codepen<commit_after>/* jshint esnext: true */

import React             from 'react';
import MultiSelectField  from './components/multiselect-field/MultiSelectField.es6.js';
import CheckboxGroup     from './components/checkbox-group/CheckboxGroup.es6.js';
import StudentVis        from './components/student-vis/StudentVis.es6.js';
import SkillBubbles      from './components/skill-bubbles/SkillBubbles.es6.js';

let {Component} = React;

class SummaryData extends Component {
  render() {
    const {students, skills} = this.props;
    const studentCount = (students || []).length;
    const skillCount   = (skills || []).length;
    return (
      <summary-data>
      <div><count>{studentCount}</count><h1>Students</h1></div> <div><count>{skillCount}</count><h1>Skills</h1></div>
      </summary-data>
    );
  }
} 

export default class SummerOfTechApp extends Component {

  constructor(props) {
    super(props);
    const {store} = this.props;
    let names;
    const complementarySkills = store.listComplementarySkills(names);
    this.state = {
      primarySkills : names,
      levels        : store.listExperienceLevels(),
      students      : store.listActiveStudents(),
      complementarySkills: complementarySkills, 
      filterStudents: store.listStudentsWithSkills(names), 
      bubbleSkills: store.nestByCategory(complementarySkills)
    };
    this.handlers = {
      handleSkillsChange: this.handleSkillsChange.bind(this), 
      handleExperienceChange: this.handleExperienceChange.bind(this)
    };
  }

  handleSkillsChange(names) {
    this.setState({ primarySkills: names });
    this.whenPrimaryChange(names);
  }

  handleExperienceChange(levels) {
    const {store} = this.props;
    const names = this.state.primarySkills;
    store.activeExperienceLevels(levels);
    this.whenPrimaryChange(names);
  }

  whenPrimaryChange(names) {
    const {store} = this.props;
    const complementarySkills = store.listComplementarySkills(names);
    this.setState({
      primarySkills: names,
      complementarySkills: complementarySkills, 
      filterStudents: store.listStudentsWithSkills(names), 
      bubbleSkills: store.nestByCategory(complementarySkills)
    });
  }

  render() {
    const {store} = this.props;
    const {complementarySkills, students, filterStudents, levels, bubbleSkills} = this.state;
    let {handleSkillsChange, handleExperienceChange} = this.handlers;
    return (
      <div>
        <header>
          <div id="logo">
            <img src="http://widged.github.io/SOT-skills-report/dist/assets/sot_logo_small.png" height="100"/>
            <img src="http://widged.github.io/SOT-skills-report/dist/assets/sot_banner.png" height="88"/>
            <div id="subtitle"><div>find your intern</div></div>
          </div>
        </header>
        <page>
          <aside>
            <article>
            Discover students and their skills. 
            </article>
            <article>
              <MultiSelectField names={complementarySkills} onChange={handleSkillsChange} placeholder="Search for skills"/>
              <CheckboxGroup items={levels} onChange={handleExperienceChange}/>
            </article>
{'fraction_non_alphanumeric': 0.12222925902469918, 'fraction_numerical': 0.004116529449018366, 'mean_word_length': 3.0860284605433375, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, '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': '1189174', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1849, 'n_words': 338}