<commit_before>var React = require('react');
var Skill = require('./Skill');

class SkillList extends React.Component {

    

    _getValidSkills() {
      const checkTags = this.props.selectedTags.length > 0
      const selectedTags = this.props.selectedTags.map(function (tag) {
        return tag.id
      });
      const checkSearch = this.props.searchText.length > 0
      const searchText = this.props.searchText.toLowerCase()
      return this.props.skills.filter((skill) => {


        if (checkTags) {
          if (skill.skill_tags.length == 0) {
            return false;
          } else {
            const tags = skill.skill_tags.map(function (skill_tag) {
              return skill_tag.tag.id
            });
            for(i in selectedTags){
              if(tags.indexOf(selectedTags[i]) == -1){
                return false
              }
            }
          }
        }
        if (checkSearch) {
          if (!(skill.name.toLowerCase().includes(searchText))) {
            return false
          }
        }

        return true;
      });
    }
<commit_msg>The text filter should include tag names (#25)<commit_after>var React = require('react');
var Skill = require('./Skill');

class SkillList extends React.Component {

    

    _getValidSkills() {
      const checkTags = this.props.selectedTags.length > 0
      const selectedTags = this.props.selectedTags.map(function (tag) {
        return tag.id
      });
      const checkSearch = this.props.searchText.length > 0
      const searchText = this.props.searchText.toLowerCase()
      return this.props.skills.filter((skill) => {


        if (checkTags) {
          if (skill.skill_tags.length == 0) {
            return false;
          } else {
            const tags = skill.skill_tags.map(function (skill_tag) {
              return skill_tag.tag.id
            });
            for(i in selectedTags){
              if(tags.indexOf(selectedTags[i]) == -1){
                return false
              }
            }
          }
        }
        if (checkSearch) {

          const skillString = skill.skill_tags.map(function (skill_tag) {return skill_tag.tag.name}).join("////") + "///" + skill.name;
          if (!(skillString.toLowerCase().includes(searchText))) {
            return false
          }
        }

        return true;
      });
    }

{'fraction_non_alphanumeric': 0.11972731146144014, 'fraction_numerical': 0.004260758414997869, 'mean_word_length': 1.7175925925925926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7589311', 'n_tokens_mistral': 659, 'n_tokens_neox': 658, 'n_words': 132}