<commit_before><script>
import { connect } from 'vuex-connect'
import HistoryListUI from '@/components/History/HistoryListUI'

export default connect({
  gettersToProps: {
    history: 'history/all',
    status: 'history/receiveStatus',
    canLoadMore: 'history/canLoadMore',
  },
  actionsToProps: {
    fetchMore: 'history/fetchMore',
  },
  lifecycle: {
    mounted ({ dispatch }) {
      if (this.user) dispatch('history/fetchForUser', this.user)
      else if (this.group) dispatch('history/fetchForGroup', this.group)
      else if (this.store) dispatch('history/fetchForStore', this.store)
    },
    destroyed: ({ dispatch }) => dispatch('history/clear'),
  },
})('HistoryList', HistoryListUI)
</script>
<commit_msg>manual HistoryList wrapper (fixes #678)<commit_after><template>
  <HistoryListUI
    :history="history"
    :status="status"
    :canLoadMore="canLoadMore"
    :fetchMore="fetchMore"
    />
</template>
<script>
import HistoryListUI from '@/components/History/HistoryListUI'
import { mapActions, mapGetters } from 'vuex'
export default {
  props: {
    user: { required: false },
    store: { required: false },
    group: { required: false },
  },
  computed: mapGetters({
    history: 'history/all',
    status: 'history/receiveStatus',
    canLoadMore: 'history/canLoadMore',
  }),
  methods: mapActions({
    fetchMore: 'history/fetchMore',
    fetchForUser: 'history/fetchForUser',
    fetchForGroup: 'history/fetchForGroup',
    fetchForStore: 'history/fetchForStore',
  }),
  mounted () {
    if (this.user) this.fetchForUser(this.user)
    else if (this.group) this.fetchForGroup(this.group)
    else if (this.store) this.fetchForStore(this.store)
  },
  watch: {
    user () { this.fetchForUser(this.user) },
    group () { this.fetchForGroup(this.group) },
    store () { this.fetchForGroup(this.store) },
  },
  components: { HistoryListUI },
}
</script>

{'fraction_non_alphanumeric': 0.15079365079365079, 'fraction_numerical': 0.0015873015873015873, 'mean_word_length': 3.9894459102902373, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, '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': '1995736', 'n_tokens_mistral': 603, 'n_tokens_neox': 598, 'n_words': 118}