<commit_before><template>
  <li>
    <span class="modal__li-title">{{ titleTrimmed }}</span>

    <span 
      class="modal__li-failed"
      v-show="hasFailed"
    >{{ text.failed }}</span>

    <span 
      class="modal__li-generating"
      v-show="isGenerating"
    >{{ text.generating }}</span>

    <a 
      class="modal__li-download"
      :href="url"  
      v-show="isReady"
    >{{ text.download }}</a>

    <span 
      class="modal__li-delete" 
      @click="deleteItem"
    />
  </li>
</template>
<script>
import axios from 'axios'
import mixinAxiosHelpers from '../../mixins/mixin-axios-helpers'

export default {
  name: 'download-item',

  mixins: [ mixinAxiosHelpers ],

  props: {
    endpointCreate: {
      required: true,
      type: String
    },
    endpointPoll: {
      required: true,
      type: String
    },
    params: {
      required: true,
      type: Object //{ domain: String, token: String }
    },
    text: {
      required: true,
      type: Object //{ download: String, failed: String, generating: String }
    },
  },

  data () {
    return {
      fakeItem: false,
      fakeItemData: {
        hasFailed: true,
        url: ''
      },
      hasFailed: false,
      id: '',
      interval: null,
      title: '',
      url: ''
    }
  },

  computed: {
    isGenerating () {
      return !this.hasFailed && this.url == ''
    },
    
    isReady () {
      return this.url != ''
    },

    titleTrimmed () {
      return this.title.length <= 30 ? this.title : this.title.substring(0,27) + '...'
    }
  },

  mounted () {
    this.axiosSetHeaders()
    this.ajaxRequestDownload()
  },

  watch: {

  },
<commit_msg>Remove watch<commit_after><template>
  <li>
    <span class="modal__li-title">{{ titleTrimmed }}</span>

    <span 
      class="modal__li-failed"
      v-show="hasFailed"
    >{{ text.failed }}</span>

    <span 
      class="modal__li-generating"
      v-show="isGenerating"
    >{{ text.generating }}</span>

    <a 
      class="modal__li-download"
      :href="url"  
      v-show="isReady"
    >{{ text.download }}</a>

    <span 
      class="modal__li-delete" 
      @click="deleteItem"
    />
  </li>
</template>
<script>
import axios from 'axios'
import mixinAxiosHelpers from '../../mixins/mixin-axios-helpers'

export default {
  name: 'download-item',

  mixins: [ mixinAxiosHelpers ],

  props: {
    endpointCreate: {
      required: true,
      type: String
    },
    endpointPoll: {
      required: true,
      type: String
    },
    params: {
      required: true,
      type: Object //{ domain: String, token: String }
    },
    text: {
      required: true,
      type: Object //{ download: String, failed: String, generating: String }
    },
  },

  data () {
    return {
      fakeItem: false,
      fakeItemData: {
        hasFailed: true,
        url: ''
      },
      hasFailed: false,
      id: '',
      interval: null,
      title: '',
      url: ''
    }
  },

  computed: {
    isGenerating () {
      return !this.hasFailed && this.url == ''
    },
    
    isReady () {
      return this.url != ''
    },

    titleTrimmed () {
      return this.title.length <= 30 ? this.title : this.title.substring(0,27) + '...'
    }
  },

  mounted () {
    this.axiosSetHeaders()
    this.ajaxRequestDownload()
  },

{'fraction_non_alphanumeric': 0.15985467756584923, 'fraction_numerical': 0.003027550711474417, 'mean_word_length': 2.0009082652134422, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6641250', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1095, 'n_words': 212}