<commit_before>import Resource from 'ember-api-store/models/resource';
import { reference } from 'ember-api-store/utils/denormalize';
import { computed, get } from '@ember/object';
import { parseHelmExternalId } from 'ui/utils/parse-externalid';
import StateCounts from 'ui/mixins/state-counts';
import { inject as service } from '@ember/service';

const App = Resource.extend(StateCounts, {
  catalog: service(),
  router: service(),
  clusterStore: service(),

  namespace: reference('targetNamespace', 'namespace', 'clusterStore'),
  pods: computed('namespace.pods', 'workloads', function() {
    return (get(this, 'namespace.pods') || []).filter((item) => {
      if ( item['labels'] ) {
        const inApp = item['labels']['io.cattle.field/appId'] === get(this, 'name');
        if ( inApp ) {
          return true;
        }
      }

      const workload = get(item, 'workload');
      if ( workload ) {
        const found = get(this, 'workloads').filterBy('id', get(workload, 'id'));
        return found.length > 0;
      }
    });
  }),
  services: computed('namespace.services', function() {
    return (get(this, 'namespace.services') || []).filter((item) => {
      if ( item['labels'] ) {
        return item['labels']['io.cattle.field/appId'] === get(this, 'name');
      }
    });
  }),
  workloads: computed('namespace.workloads', function() {
    return (get(this, 'namespace.workloads') || []).filter((item) => {
      if ( item['workloadLabels'] ) {
        return item['workloadLabels']['io.cattle.field/appId'] === get(this, 'name');
      }
    });
  }),
  secrets: computed('namespace.secrets', function() {
    return (get(this, 'namespace.secrets') || []).filter((item) => {<commit_msg>Fix catalog bug<commit_after>import Resource from 'ember-api-store/models/resource';
import { reference } from 'ember-api-store/utils/denormalize';
import { computed, get } from '@ember/object';
import { parseHelmExternalId } from 'ui/utils/parse-externalid';
import StateCounts from 'ui/mixins/state-counts';
import { inject as service } from '@ember/service';

const App = Resource.extend(StateCounts, {
  catalog: service(),
  router: service(),
  clusterStore: service(),

  namespace: reference('targetNamespace', 'namespace', 'clusterStore'),
  pods: computed('namespace.pods.@each.workloadId', 'workloads.@each.workloadLabels', function() {
    return (get(this, 'namespace.pods') || []).filter((item) => {
      if ( item['labels'] ) {
        const inApp = item['labels']['io.cattle.field/appId'] === get(this, 'name');
        if ( inApp ) {
          return true;
        }
      }

      const workload = get(item, 'workload');
      if ( workload ) {
        const found = get(this, 'workloads').filterBy('id', get(workload, 'id'));
        return found.length > 0;
      }
    });
  }),
  services: computed('namespace.services', function() {
    return (get(this, 'namespace.services') || []).filter((item) => {
      if ( item['labels'] ) {
        return item['labels']['io.cattle.field/appId'] === get(this, 'name');
      }
    });
  }),
  workloads: computed('namespace.workloads', function() {
    return (get(this, 'namespace.workloads') || []).filter((item) => {
      if ( item['workloadLabels'] ) {
        return item['workloadLabels']['io.cattle.field/appId'] === get(this, 'name');
      }
    });
  }),
  secrets: computed('namespace.secrets', function() {
    return (get(this, 'namespace.secrets') || []).filter((item) => {
{'fraction_non_alphanumeric': 0.19319492502883506, 'fraction_numerical': 0.0005767012687427913, 'mean_word_length': 3.5465268676277852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1020814', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1064, 'n_words': 216}