<commit_before>ManageIQ.angular.app.component('ansibleCredentialOptions', {
  bindings: {
    model: '=',
    options: '<',
    type: '<',
  },

  controllerAs: 'vm',

  controller: ['$scope', function($scope) {
    $scope.__ = __;

    this.setOptions = function() {
      this.current_options = this.options[this.type];
    };

    this.$onInit = function() {
      this.setOptions();
    };

    this.$onChanges = function(changes) {
      this.setOptions();
    };
  }],

  template: [
    '<div class="form-group" ng-repeat="(name, attr) in vm.current_options.attributes">',
      '<label class="control-label col-md-2">',
        '{{ __(attr.label) }}',
       '</label>',
       '<div ng-switch="attr.type" class="text">',
         // password
         '<div ng-switch-when="password" class="col-md-8">',
           '<input type="password" class="form-control" title="{{ __(attr.help_text) }}" ng-model="vm.model[name]">',
         '</div>',
         // select
         '<div ng-switch-when="choice" class="col-md-8">',
            '<select pf-select ng-options="opt as opt for opt in attr.choices" class="form-control" ng-model="vm.model[name]" />',
          '</div>',
         // text
         '<div ng-switch-when="string" class="col-md-8">',<commit_msg>Use textarea for ssh key in Machine Credentials<commit_after>ManageIQ.angular.app.component('ansibleCredentialOptions', {
  bindings: {
    model: '=',
    options: '<',
    type: '<',
  },

  controllerAs: 'vm',

  controller: ['$scope', function($scope) {
    $scope.__ = __;

    this.setOptions = function() {
      this.current_options = this.options[this.type];
    };

    this.$onInit = function() {
      this.setOptions();
    };

    this.$onChanges = function(changes) {
      this.setOptions();
    };
  }],

  template: [
    '<div class="form-group" ng-repeat="(name, attr) in vm.current_options.attributes">',
      '<label class="control-label col-md-2">',
        '{{ __(attr.label) }}',
       '</label>',
       '<div ng-switch="attr.type" class="text">',
         // password or ssh input (must be textarea to prevent EOL getting lost)
         '<div ng-switch-when="password" class="col-md-8">',
           '<input ng-if="!attr.multiline" type="password" class="form-control" title="{{ __(attr.help_text) }}" ng-model="vm.model[name]">',
           '<textarea ng-if="attr.multiline" class="form-control" title="{{ __(attr.help_text) }}" ng-model="vm.model[name]"></textarea>',
         '</div>',
         // select
         '<div ng-switch-when="choice" class="col-md-8">',
            '<select pf-select ng-options="opt as opt for opt in attr.choices" class="form-control" ng-model="vm.model[name]" />',
          '</div>',
         // text
         '<div ng-switch-when="string" class="col-md-8">',
{'fraction_non_alphanumeric': 0.20452099031216361, 'fraction_numerical': 0.0028704700394689632, 'mean_word_length': 2.7123834886817577, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 27, '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': '6719544', 'n_tokens_mistral': 907, 'n_tokens_neox': 918, 'n_words': 158}