<commit_before>import Resource from 'ember-api-store/models/resource';
import { inject as service } from '@ember/service';
import { computed, get } from '@ember/object';
import { ucFirst } from 'shared/utils/util';
import C from 'ui/utils/constants';

export default Resource.extend({
  modalService: service('modal'),

  displayKind: computed('kind', function() {
    return ucFirst(get(this, 'kind'));
  }),

  canClone: computed('actions.clone', function() {
    const name         = get(this, 'name');
    const catalogNames = get(C, 'CATALOG');
    const builtIn      = [get(catalogNames, 'LIBRARY_KEY'), get(catalogNames, 'HELM_STABLE_KEY'), get(catalogNames, 'HELM_INCUBATOR_KEY')];

    return !builtIn.includes(name);
  }),

  availableActions: computed(() => {
    return [{
      enabled: true,
      label:   'catalogPage.index.refreshBtn',
      icon:    'icon icon-refresh',
      action:  'refresh'
    }];
  }),

  actions: {
    edit() {
      get(this, 'modalService').toggleModal('modal-edit-catalog', {
        model: this,
        scope: 'global'
      });
    },

    clone() {
      const clone = this.cloneForNew();

      get(this, 'modalService').toggleModal('modal-edit-catalog', {
        model: clone,
        scope: 'global'
      });
    }
  },

  refresh() {
    this.doAction('refresh')
  },

});<commit_msg>Global catalog "Refresh" action have no effect https://github.com/rancher/rancher/issues/16661<commit_after>import Resource from 'ember-api-store/models/resource';
import { inject as service } from '@ember/service';
import { computed, get } from '@ember/object';
import { ucFirst } from 'shared/utils/util';
import C from 'ui/utils/constants';

export default Resource.extend({
  modalService: service('modal'),

  displayKind: computed('kind', function() {
    return ucFirst(get(this, 'kind'));
  }),

  canClone: computed('actions.clone', function() {
    const name         = get(this, 'name');
    const catalogNames = get(C, 'CATALOG');
    const builtIn      = [get(catalogNames, 'LIBRARY_KEY'), get(catalogNames, 'HELM_STABLE_KEY'), get(catalogNames, 'HELM_INCUBATOR_KEY')];

    return !builtIn.includes(name);
  }),

  availableActions: computed(() => {
    return [{
      enabled: true,
      label:   'catalogPage.index.refreshBtn',
      icon:    'icon icon-refresh',
      action:  'refresh'
    }];
  }),

  actions: {
    edit() {
      get(this, 'modalService').toggleModal('modal-edit-catalog', {
        model: this,
        scope: 'global'
      });
    },

    clone() {
      const clone = this.cloneForNew();

      get(this, 'modalService').toggleModal('modal-edit-catalog', {
        model: clone,
        scope: 'global'
      });
    },

    refresh() {
      this.doAction('refresh')
    },
  },
});
{'fraction_non_alphanumeric': 0.1635969664138678, 'fraction_numerical': 0.0018057060310581437, 'mean_word_length': 3.1097922848664687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '6234461', 'n_tokens_mistral': 873, 'n_tokens_neox': 849, 'n_words': 181}