<commit_before><template>
  <div class="item" :class="errors && errors.length > 0 ? '--has-errors' : ''">
    <textarea class="text-area" maxlength="1000" style="min-height: 200px" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"  :class="description.length > 0 ? '--is-filled' : ''" type="text" v-model="description" @input="validate"></textarea>
    <label v-if="description.length < 450" class="label">Full description <span class="required">(required)</span></label>
    <span class="remaining-characters">{{ 1000 - description.length }}</span>
    <ul v-if="errors && errors.length > 0" class="error-list">
      <li v-for="(error, index) in errors" :key="index" class="error-item">{{ error }}</li>
    </ul>
    <p class="help">The full description of your ÐApp</p>
  </div>
</template>

<script>
  import { dispatchErrors } from '~/helpers/mixins'

  var validationTimer

  export default {
    computed: {
      description: {
        get () {
          return this.$store.getters['dapps/form/description']
        },
        set (value) {
          const field = {
            name: 'description',
            value: value
          }
          this.$store.dispatch('dapps/form/setField', field)
        }
      },
      errors () {
        return this.$store.getters['dapps/form/descriptionErrors']
      }
    },
    methods: {
      validate () {
        clearTimeout(validationTimer)
        const errors = {
          field: 'description',
          data: []
        }
        validationTimer = setTimeout(() => {
          this.description.length > 1000 ? errors.data.push(`Description can't be longer than 1000 characters`) : ''
          this.description.length < 50 ? errors.data.push(`Description must be longer than 50 characters`) : ''
          this.dispatchErrors(errors, 'dapps')
        }, 750)
      }
    },
    mixins: [dispatchErrors]
  }
</script>
<commit_msg>clarify we want english description<commit_after><template>
  <div class="item" :class="errors && errors.length > 0 ? '--has-errors' : ''">
    <textarea class="text-area" maxlength="1000" style="min-height: 200px" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"  :class="description.length > 0 ? '--is-filled' : ''" type="text" v-model="description" @input="validate"></textarea>
    <label v-if="description.length < 450" class="label">Full description <span class="required">(required)</span></label>
    <span class="remaining-characters">{{ 1000 - description.length }}</span>
    <ul v-if="errors && errors.length > 0" class="error-list">
      <li v-for="(error, index) in errors" :key="index" class="error-item">{{ error }}</li>
    </ul>
    <p class="help">The full description of your ÐApp in English.</p>
  </div>
</template>

<script>
  import { dispatchErrors } from '~/helpers/mixins'

  var validationTimer

  export default {
    computed: {
      description: {
        get () {
          return this.$store.getters['dapps/form/description']
        },
        set (value) {
          const field = {
            name: 'description',
            value: value
          }
          this.$store.dispatch('dapps/form/setField', field)
        }
      },
      errors () {
        return this.$store.getters['dapps/form/descriptionErrors']
      }
    },
    methods: {
      validate () {
        clearTimeout(validationTimer)
        const errors = {
          field: 'description',
          data: []
        }
        validationTimer = setTimeout(() => {
          this.description.length > 1000 ? errors.data.push(`Description can't be longer than 1000 characters`) : ''
          this.description.length < 50 ? errors.data.push(`Description must be longer than 50 characters`) : ''
          this.dispatchErrors(errors, 'dapps')
        }, 750)
      }
    },
    mixins: [dispatchErrors]
  }
</script>

{'fraction_non_alphanumeric': 0.162015503875969, 'fraction_numerical': 0.016537467700258397, 'mean_word_length': 2.679657794676806, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 53, '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': '6335347', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1116, 'n_words': 244}