<commit_before><script>
export default {
  name: 'ReportErrorGroup',
  props: {
    errorGroup: Object,
  },
  mounted: () => {
    if (typeof $ !== 'undefined') { // eslint-disable-line
      $('[rel="popover"]').popover({ // eslint-disable-line
        html: true,
      })
    }
  },
  computed: {
    rowNumbers() {
      return Object.keys(this.errorGroup.rows)
        .map(item => parseInt(item, 10) || null)
        .sort((a, b) => a - b)
    },
  },
}
</script>

<template>
<div class="result panel panel-danger">

  <div class="panel-heading">
    <span class="text-uppercase label label-danger">Invalid</span>
    <span class="count label">{{ (errorGroup.count < 10) ? errorGroup.count : `10/${errorGroup.count}` }}</span>
    <h5 class="panel-title">{{ errorGroup.name }}</h5>
    <span class="help"
          rel="popover"
          data-toggle="popover"
          data-placement="left"
          :title="`<span class='label label-info'>${errorGroup.type}</span> ${errorGroup.name}`"
          :data-content="`${errorGroup.name}. <a>Read more</a>`">
      <span class="icon-info"><i>What is this?</i></span>
    </span>
  </div>

  <div class="panel-body">
    <table class="table table-bordered table-condensed">
      <thead v-if="errorGroup.headers">
        <tr>
          <th>H</th>
          <th v-for="header of errorGroup.headers">{{ header }}</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="rowNumber, index of rowNumbers" v-if="index < 10 " class="result-header-row">
          <td class="result-row-index">{{ (rowNumber !== null) ? rowNumber : 'H' }}</td>
          <td v-for="(value, index) of errorGroup.rows[rowNumber].values"
              :class="{danger: errorGroup.rows[rowNumber].badcols.has(index + 1)}">
            {{ value }}
          </td>
        </tr>
      </tbody>
    </table>
  </div>

</div>
</template><commit_msg>added show next 10 rows button<commit_after><script>
export default {
  name: 'ReportErrorGroup',
  props: {
    errorGroup: Object,
  },
  data() {
    return {
      visibleRowsCount: 10,
    }
  },
  mounted: () => {
    if (typeof $ !== 'undefined') { // eslint-disable-line
      $('[rel="popover"]').popover({ // eslint-disable-line
        html: true,
      })
    }
  },
  computed: {
    rowNumbers() {
      return Object.keys(this.errorGroup.rows)
        .map(item => parseInt(item, 10) || null)
        .sort((a, b) => a - b)
    },
  },
}
</script>

<template>
<div class="result panel panel-danger">

  <div class="panel-heading">
    <span class="text-uppercase label label-danger">Invalid</span>
    <span class="count label">{{ errorGroup.count }}</span>
    <h5 class="panel-title">{{ errorGroup.name }}</h5>
    <span class="help"
          rel="popover"
          data-toggle="popover"
          data-placement="left"
          :title="`<span class='label label-info'>${errorGroup.type}</span> ${errorGroup.name}`"
          :data-content="`${errorGroup.name}. <a>Read more</a>`">
      <span class="icon-info"><i>What is this?</i></span>
    </span>
  </div>

  <div class="panel-body">
    <table class="table table-bordered table-condensed">
      <thead v-if="errorGroup.headers">
        <tr>
          <th>H</th>
          <th v-for="header of errorGroup.headers">{{ header }}</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="rowNumber, index of rowNumbers" v-if="index < visibleRowsCount " class="result-header-row">
          <td class="result-row-index">{{ (rowNumber !== null) ? rowNumber : 'H' }}</td>
          <td v-for="(value, index) of errorGroup.rows[rowNumber].values"
              :class="{danger: errorGroup.rows[rowNumber].badcols.has(index + 1)}">
            {{ value }}
          </td>
        </tr>
      </tbody>
    </table>
    <a class="btn btn-default" v-if="visibleRowsCount < rowNumbers.length" @click="visibleRowsCount += 10">
      Show next 10 rows
    </a>
  </div>

</div>
</template>
{'fraction_non_alphanumeric': 0.1967005076142132, 'fraction_numerical': 0.006091370558375634, 'mean_word_length': 2.5156110615521854, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 99, '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': '3617202', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1309, 'n_words': 259}