<commit_before>/*
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
<template>
  <div id="searchResults">
    <b-row align-h="between" class="mb-2">
      <b-col sm="4" class="form-inline">
        Show <b-form-select class="mx-1" :value="limit" @input="setLimit($event)" :options="limitOptions" /> results
      </b-col>
      <b-col sm="4">
        <search-column-select
          id="searchColumnSelect"
          class="float-right"
          :column-data="searchFields" />
      </b-col>
    </b-row>
    <div class="table-responsive">
      <table id="searchResultsTable" class="table table-striped">
        <thead>
          <tr>
            <th
              v-for="column in columns"
              :key="column.id"
              class="text-nowrap"
              scope="col">
              {{ column.resultLabel ? column.resultLabel : column.label }}
              <b-button
                class="sort-button px-0"
                :class="{active: column.param === orderingParam}"
                variant="link"
                @click="sortResults({ param: column.param, desc: (column.param === orderingParam) ? !orderingDesc : false })">
                {{ (column.param === orderingParam) ? orderingDesc ? '&#x2191;' : '&#x2193;' : '&#x2195;' }}
              </b-button>
            </th>
          </tr>
          <tr class="filters">
            <th v-for="column in columns" :key="column.id" :class="`search-result-filter-${column.type}`">
              <search-result-filter
                :type="column.type"
                :id="`${column.id}ResultFilter`"
                :errors="errors[column.param]"
                :param-names="column.params"
                :options="column.options || filterSelectOptions[column.id]"
                :value-field="column.valueField"
                :text-field="column.textField"
                :value="filterParams[column.id]"
                @input="applyFilter(column, $event)" />
            </th>
          </tr>
        </thead>
        <tbody role="rowgroup" v-if="(isBusy || isEmpty || isReset)">
          <tr :class="{loading: isBusy}">
            <td :colspan="columnCount">
              <div class="d-flex justify-content-center my-2">
                <div v-if="isBusy" class="spinner-border m-3" role="status" aria-hidden="true"></div>
                <strong v-if="isBusy" class="align-middle my-3 pt-1">
                  Loading...
                </strong>
                <strong v-else-if="isReset" class="align-middle my-3 pt-1">
                  Enter some criteria in the form above to search.
                </strong>
                <strong v-else-if="isEmpty" class="align-middle my-3 pt-1">
                  No results matched your search criteria.
                </strong>
              </div>
            </td>
          </tr>
        </tbody>
        <tbody role="rowgroup" v-else>
          <tr v-for="row in results" :key="row.well_tag_number">
            <td v-for="column in columns" :key="column.id" class="data">
              <template v-if="column.param === 'well_tag_number'">
                <router-link :to="{ name: 'wells-detail', params: {id: row.well_tag_number} }">{{ row.well_tag_number }}</router-link>
              </template>
              <template v-else-if="column.param === 'street_address'">
                {{ row | streetAddressFormat }}
              </template>
              <template v-else-if="column.type === 'select' && Array.isArray(row[column.param])"><commit_msg>Left justify results table messages<commit_after>/*
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
<template>
  <div id="searchResults">
    <b-row align-h="between" class="mb-2">
      <b-col sm="4" class="form-inline">
        Show <b-form-select class="mx-1" :value="limit" @input="setLimit($event)" :options="limitOptions" /> results
      </b-col>
      <b-col sm="4">
        <search-column-select
          id="searchColumnSelect"
          class="float-right"
          :column-data="searchFields" />
      </b-col>
    </b-row>
    <div class="table-responsive">
      <table id="searchResultsTable" class="table table-striped">
        <thead>
          <tr>
            <th
              v-for="column in columns"
              :key="column.id"
              class="text-nowrap"
              scope="col">
              {{ column.resultLabel ? column.resultLabel : column.label }}
              <b-button
                class="sort-button px-0"
                :class="{active: column.param === orderingParam}"
                variant="link"
                @click="sortResults({ param: column.param, desc: (column.param === orderingParam) ? !orderingDesc : false })">
                {{ (column.param === orderingParam) ? orderingDesc ? '&#x2191;' : '&#x2193;' : '&#x2195;' }}
              </b-button>
            </th>
          </tr>
          <tr class="filters">
            <th v-for="column in columns" :key="column.id" :class="`search-result-filter-${column.type}`">
              <search-result-filter
                :type="column.type"
                :id="`${column.id}ResultFilter`"
                :errors="errors[column.param]"
                :param-names="column.params"
                :options="column.options || filterSelectOptions[column.id]"
                :value-field="column.valueField"
                :text-field="column.textField"
                :value="filterParams[column.id]"
                @input="applyFilter(column, $event)" />
            </th>
          </tr>
        </thead>
        <tbody role="rowgroup" v-if="(isBusy || isEmpty || isReset)">
          <tr :class="{loading: isBusy}">
            <td :colspan="columnCount">
              <div class="d-flex justify-content-left my-1 mx-1">
                <div v-if="isBusy" class="spinner-border m-3" role="status" aria-hidden="true"></div>
                <strong v-if="isBusy" class="align-middle my-3 pt-1">
                  Loading...
                </strong>
                <strong v-else-if="isReset" class="align-middle my-3 pt-1">
                  Enter some criteria in the form above to search.
                </strong>
                <strong v-else-if="isEmpty" class="align-middle my-3 pt-1">
                  No results matched your search criteria.
                </strong>
              </div>
            </td>
          </tr>
        </tbody>
        <tbody role="rowgroup" v-else>
          <tr v-for="row in results" :key="row.well_tag_number">
            <td v-for="column in columns" :key="column.id" class="data">
              <template v-if="column.param === 'well_tag_number'">
                <router-link :to="{ name: 'wells-detail', params: {id: row.well_tag_number} }">{{ row.well_tag_number }}</router-link>
              </template>
              <template v-else-if="column.param === 'street_address'">
                {{ row | streetAddressFormat }}
              </template>
              <template v-else-if="column.type === 'select' && Array.isArray(row[column.param])">
{'fraction_non_alphanumeric': 0.14764683968707315, 'fraction_numerical': 0.00732646218800447, 'mean_word_length': 1.8919210053859965, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6954827', 'n_tokens_mistral': 2319, 'n_tokens_neox': 2231, 'n_words': 532}