<commit_before><div class="modal-header">
  <h3 class="modal-title"><span translate>{{ 'data_mapping' }}</span> : {{field.local_field}}</h3>
</div>
<div class="modal-body m-lg">
  <div>
    <span translate>{{ 'expected_data_type' }}</span> : {{datatype}}
  </div>
  <form name="mappingForm" class="m-t-md">
    <ng-switch on="datatype">

      <!-- BOOLEAN -->
      <div ng-switch-when="boolean">
        <label for="true_value">true</label>
        <input type="text"
               class="form-control"
               name="true_value"
               id="true_value"
               ng-model="transformation.rules.true_value">

        <label for="false_value">false</label>
        <input type="text"
               class="form-control"
               name="false_value"
               id="false_value"
               ng-model="transformation.rules.false_value">
      </div>

      <!-- DATE -->
      <div ng-switch-when="date">
        <label for="date_format" translate>{{ 'input_format' }}</label>
        <select name="date_format"
                id="date_format"
                class="form-control"
                ng-model="transformation.rules.format"
                ng-options="format.value as format.label for format in formats.date">
        </select>
      </div>

      <!-- INTEGER -->
      <div ng-switch-when="integer">
        <label for="add_mapping" translate>{{ 'mappings' }}</label>
        <button class="btn btn-default pull-right" ng-click="addIntegerMapping()"><i class="fa fa-plus"></i></button>
        <ul>
          <li ng-repeat="map in transformation.rules.mapping" class="m-t-sm">
              <input type="text" class="form-control inline width-35" ng-model="map.from">
              <i class="fa fa-arrows-h"></i>
              <input type="number" class="form-control inline width-35" ng-model="map.to">
          </li>
        </ul>
      </div>
    </ng-switch>
  </form>
</div>
<div class="modal-footer">
  <button class="btn btn-primary" ng-click="ok()" ng-disabled="!mappingForm.$valid" ng-if="datatype != 'string' && datatype != 'text'" translate>{{ 'confirm' }}</button>
  <button class="btn btn-warning" ng-click="cancel()" translate>{{ 'cancel' }}</button>
</div><commit_msg>[SSO] improved boolean mapping interface<commit_after><div class="modal-header">
  <h3 class="modal-title"><span translate>{{ 'data_mapping' }}</span> : {{field.local_field}}</h3>
</div>
<div class="modal-body m-lg">
  <div>
    <span translate>{{ 'expected_data_type' }}</span> : {{datatype}}
  </div>
  <form name="mappingForm" class="m-t-md">
    <ng-switch on="datatype">

      <!-- BOOLEAN -->
      <div ng-switch-when="boolean">
        <label for="add_mapping" translate>{{ 'mappings' }}</label>
        <ul class="list-unstyled">
          <li class="m-t-sm m-l">
            <input type="text"
                   name="true_value"
                   id="true_value"
                   class="form-control inline width-35 m-r "
                   ng-model="transformation.rules.false_value">
            <i class="fa fa-arrows-h"></i>
            <label for="true_value" class="m-l">true</label>
          </li>
          <li class="m-t-sm m-l">
            <input type="text"
                   name="false_value"
                   id="false_value"
                   class="form-control inline width-35 m-r "
                   ng-model="transformation.rules.true_value">
            <i class="fa fa-arrows-h"></i>
            <label for="false_value" class="m-l">false</label>
          </li>
        </ul>
      </div>

      <!-- DATE -->
      <div ng-switch-when="date">
        <label for="date_format" translate>{{ 'input_format' }}</label>
        <select name="date_format"
                id="date_format"
                class="form-control"
                ng-model="transformation.rules.format"
                ng-options="format.value as format.label for format in formats.date">
        </select>
      </div>

      <!-- INTEGER -->
      <div ng-switch-when="integer">
        <label for="add_mapping" translate>{{ 'mappings' }}</label>
        <button class="btn btn-default pull-right" ng-click="addIntegerMapping()"><i class="fa fa-plus"></i></button>
        <ul class="list-unstyled">
          <li ng-repeat="map in transformation.rules.mapping" class="m-t-sm m-l">
              <input type="text" class="form-control inline width-35 m-r " ng-model="map.from">
              <i class="fa fa-arrows-h"></i>
              <input type="number" class="form-control inline width-35 m-l" ng-model="map.to">
          </li>
        </ul>
      </div>
    </ng-switch>
  </form>
</div>
<div class="modal-footer">
  <button class="btn btn-primary" ng-click="ok()" ng-disabled="!mappingForm.$valid" ng-if="datatype != 'string' && datatype != 'text'" translate>{{ 'confirm' }}</button>
  <button class="btn btn-warning" ng-click="cancel()" translate>{{ 'cancel' }}</button>
</div>
{'fraction_non_alphanumeric': 0.18565058775841103, 'fraction_numerical': 0.0032428050263477908, 'mean_word_length': 2.272546419098143, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 125, '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': '532334', 'n_tokens_mistral': 1552, 'n_tokens_neox': 1494, 'n_words': 297}