<commit_before>'use strict';

const PROFILE_CATEGORY_COMPONENT_NAME = 'profileCategory';

const profileCategoryComponent = {
  bindings: {
    options: '<',
    profile: '<'
  },
  templateUrl: 'components/profile/profile-category.html',
  controllerAs: 'profileCategoryCtrl',
  controller: class demoController {
    constructor($state) {
      const { title, subhead, content, icon, model, action } = this.options;

      this.$state = $state;
      this.title = title;
      this.subhead = subhead;
      this.content = content;
      this.icon = icon;
      this.action = action;

      this.section = _.property(model)(this.profile);
      this.updatedAt = this.section && this.section.updatedAt;
      this.completion = this.computeCompletion();
    }

    go() {
      this.$state.go(this.action.sref);
    }

    getActionLabel() {
      switch (this.completion) {
        case 'empty':
          return 'Commencer';
        case 'complete':
          return 'Modifier';
        case 'half':
          return 'Reprendre';
      }
    }

    computeCompletion() {
      if (!this.section) {
        return 'empty';
      } else if (this.section.__completion) {
        return 'complete';
      } else {
        return 'half';
      }
    }
  }
};

angular.module('impactApp')
  .component(PROFILE_CATEGORY_COMPONENT_NAME, profileCategoryComponent);
<commit_msg>Add explicit inject<commit_after>'use strict';

const PROFILE_CATEGORY_COMPONENT_NAME = 'profileCategory';

const profileCategoryComponent = {
  bindings: {
    options: '<',
    profile: '<'
  },
  templateUrl: 'components/profile/profile-category.html',
  controllerAs: 'profileCategoryCtrl',
  controller: class demoController {
    constructor($state) {
      const { title, subhead, content, icon, model, action } = this.options;

      this.$state = $state;
      this.title = title;
      this.subhead = subhead;
      this.content = content;
      this.icon = icon;
      this.action = action;

      this.section = _.property(model)(this.profile);
      this.updatedAt = this.section && this.section.updatedAt;
      this.completion = this.computeCompletion();
    }

    go() {
      this.$state.go(this.action.sref);
    }

    getActionLabel() {
      switch (this.completion) {
        case 'empty':
          return 'Commencer';
        case 'complete':
          return 'Modifier';
        case 'half':
          return 'Reprendre';
      }
    }

    computeCompletion() {
      if (!this.section) {
        return 'empty';
      } else if (this.section.__completion) {
        return 'complete';
      } else {
        return 'half';
      }
    }

    static get $inject() {
      return [
        '$state'
      ];
    }
	}
};

angular.module('impactApp')
  .component(PROFILE_CATEGORY_COMPONENT_NAME, profileCategoryComponent);

{'fraction_non_alphanumeric': 0.12890625, 'fraction_numerical': 0.0, 'mean_word_length': 2.443765281173594, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6436054', 'n_tokens_mistral': 847, 'n_tokens_neox': 829, 'n_words': 163}