<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>
  <b-form @submit.prevent="handleSubmit()" @reset.prevent="handleReset()">
    <div v-for="section in defaultFilterSections" :key="section.header">
      <b-row class="mt-1">
        <b-col>
          <h3>{{ section.header }}</h3>
        </b-col>
      </b-row>
      <search-filter
        v-for="field in getFilterFields(section.fields)"
        :key="field.id"
        :type="field.type"
        :id="`${field.id}Filter`"
        :param-names="field.params"
        :label="field.label"
        :errors="errors[field.param]"
        :options="field.options || filterSelectOptions[field.id]"
        :value-field="field.valueField"
        :text-field="field.textField"
        :any-value-checkbox="field.anyValueBoolean"
        v-model="filterParams[field.id]" />
    </div>
    <b-row>
      <b-col class="my-3">
        <b-btn variant="primary" type="submit">Search</b-btn>
        <b-btn variant="dark" type="reset" class="mx-2">Reset</b-btn>
      </b-col>
    </b-row>
    <b-row class="mt-1">
      <b-col>
        <h3>Additional Fields</h3>
      </b-col>
    </b-row>
    <search-filter
      v-for="field in selectedAdditionalFilters"
      :key="field.id"
      :type="field.type"
      :id="`${field.id}Filter`"
      :param-names="field.params"
      :label="field.label"
      :errors="errors[field.param]"
      :options="field.options || filterSelectOptions[field.id]"
      :value-field="field.valueField"
      :text-field="field.textField"
      :any-value-checkbox="field.anyValueBoolean"
      v-model="filterParams[field.id]"
      @remove="removeSelectedFilter(field.id)"
      removable />
    <b-row>
      <b-col sm="9" class="mb-1">
        <b-form-select id="additionalFilterInput" v-model="selectedFilterId">
          <option :value="null">Select a field to search on</option>
          <optgroup v-for="optGroup in additionalFilterSelectOptions" :key="optGroup.label" :label="optGroup.label">
            <option v-for="option in optGroup.options" :key="option.id" :value="option.value" :disabled="option.disabled">{{ option.text }}</option>
          </optgroup>
        </b-form-select>
      </b-col>
      <b-col sm="3" class="mb-1">
        <b-button block variant="primary" @click="addSelectedFilter" :disabled="selectedFilterId === null">Add Field</b-button>
      </b-col>
    </b-row>
  </b-form>
</template>

<script>
import { mapGetters } from 'vuex'
import { FETCH_CODES } from '@/submissions/store/actions.types.js'
import {
  FETCH_DRILLER_NAMES,
  FETCH_ORGANIZATION_NAMES,<commit_msg>Changes well advanced search Additional Fields dropdown label<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>
  <b-form @submit.prevent="handleSubmit()" @reset.prevent="handleReset()">
    <div v-for="section in defaultFilterSections" :key="section.header">
      <b-row class="mt-1">
        <b-col>
          <h3>{{ section.header }}</h3>
        </b-col>
      </b-row>
      <search-filter
        v-for="field in getFilterFields(section.fields)"
        :key="field.id"
        :type="field.type"
        :id="`${field.id}Filter`"
        :param-names="field.params"
        :label="field.label"
        :errors="errors[field.param]"
        :options="field.options || filterSelectOptions[field.id]"
        :value-field="field.valueField"
        :text-field="field.textField"
        :any-value-checkbox="field.anyValueBoolean"
        v-model="filterParams[field.id]" />
    </div>
    <b-row>
      <b-col class="my-3">
        <b-btn variant="primary" type="submit">Search</b-btn>
        <b-btn variant="dark" type="reset" class="mx-2">Reset</b-btn>
      </b-col>
    </b-row>
    <b-row class="mt-1">
      <b-col>
        <h3>Additional Fields</h3>
      </b-col>
    </b-row>
    <search-filter
      v-for="field in selectedAdditionalFilters"
      :key="field.id"
      :type="field.type"
      :id="`${field.id}Filter`"
      :param-names="field.params"
      :label="field.label"
      :errors="errors[field.param]"
      :options="field.options || filterSelectOptions[field.id]"
      :value-field="field.valueField"
      :text-field="field.textField"
      :any-value-checkbox="field.anyValueBoolean"
      v-model="filterParams[field.id]"
      @remove="removeSelectedFilter(field.id)"
      removable />
    <b-row>
      <b-col sm="9" class="mb-1">
        <b-form-select id="additionalFilterInput" v-model="selectedFilterId">
          <option :value="null">Select a field</option>
          <optgroup v-for="optGroup in additionalFilterSelectOptions" :key="optGroup.label" :label="optGroup.label">
            <option v-for="option in optGroup.options" :key="option.id" :value="option.value" :disabled="option.disabled">{{ option.text }}</option>
          </optgroup>
        </b-form-select>
      </b-col>
      <b-col sm="3" class="mb-1">
        <b-button block variant="primary" @click="addSelectedFilter" :disabled="selectedFilterId === null">Add Field</b-button>
      </b-col>
    </b-row>
  </b-form>
</template>

<script>
import { mapGetters } from 'vuex'
import { FETCH_CODES } from '@/submissions/store/actions.types.js'
import {
  FETCH_DRILLER_NAMES,
  FETCH_ORGANIZATION_NAMES,
{'fraction_non_alphanumeric': 0.1567816823024328, 'fraction_numerical': 0.005088249324216886, 'mean_word_length': 2.9092604101926662, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 93, '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': '4889160', 'n_tokens_mistral': 2025, 'n_tokens_neox': 1994, 'n_words': 419}