<commit_before>import { not, sort } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { task } from 'ember-concurrency';

export default Component.extend({
  flashMessages: service(),
  router: service(),
  store: service(),
  isDisabled: not(
    'model.permissions.write',
  ),
  sortedEntriesProperties: [
    'statusSort:desc',
  ],
  sortedEntries: sort(
    'model.entries',
    'sortedEntriesProperties'
  ),
  sessionCall: computed(
    'model',
    function() {
      let kinds = {
        'Chorus': 32,
        'Quartet': 41,
      };
      return this.get('store').query('session', {
        'status': 4, // TODO HARDCODED
        'kind': kinds[this.get('model.kind')],
        'is_invitational': false,
        'page_size': 100
    });
  }),
  sessionSortProperties: [
    'nomen',
  ],
  sessionOptions: sort(
    'sessionCall',
    'sessionSortProperties'
  ),
  saveEntry: task(function* (entry){
    try {
      yield entry.save();
      entry.get('contestants').then(function(contestants) {
        return contestants.reload();
      });
      this.get('flashMessages').success('Saved');
      this.get('router').transitionTo('dashboard.group-manager.group.entries.entry', entry);<commit_msg>Add filtering to Entry component<commit_after>import { not, sort, filterBy } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import Component from '@ember/component';
import { computed } from '@ember/object';
import { task } from 'ember-concurrency';

export default Component.extend({
  flashMessages: service(),
  router: service(),
  store: service(),
  isDisabled: not(
    'model.permissions.write',
  ),
  filteredEntries: filterBy(
    'model.entries',
    'notArchived'
  ),
  sortedEntriesProperties: [
    'statusSort:desc',
  ],
  sortedEntries: sort(
    'filteredEntries',
    'sortedEntriesProperties'
  ),
  sessionCall: computed(
    'model',
    function() {
      let kinds = {
        'Chorus': 32,
        'Quartet': 41,
      };
      return this.get('store').query('session', {
        'status': 4, // TODO HARDCODED
        'kind': kinds[this.get('model.kind')],
        'is_invitational': false,
        'page_size': 100
    });
  }),
  sessionSortProperties: [
    'nomen',
  ],
  sessionOptions: sort(
    'sessionCall',
    'sessionSortProperties'
  ),
  saveEntry: task(function* (entry){
    try {
      yield entry.save();
      entry.get('contestants').then(function(contestants) {
        return contestants.reload();
      });
      this.get('flashMessages').success('Saved');
      this.get('router').transitionTo('dashboard.group-manager.group.entries.entry', entry);
{'fraction_non_alphanumeric': 0.15740072202166064, 'fraction_numerical': 0.005776173285198556, 'mean_word_length': 3.230534351145038, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5085200', 'n_tokens_mistral': 848, 'n_tokens_neox': 841, 'n_words': 170}