<commit_before><form class="form-horizontal" name="userForm" ng-submit="$modal.saveUser(userForm)" novalidate>
  <div class="modal-header bg-primary">
    <h3 class="modal-title">{{$modal.isEdit ? 'Edit' : 'Add'}} user</h3>
  </div>
  <div class="modal-body">
    <div class="form-group" ng-class="{ 'has-error' : userForm.login.$invalid && !userForm.login.$pristine }">
      <label class="col-sm-3 control-label">
        Login
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <input class="form-control" name="login" placeholder="User's login" ng-disabled="$modal.isEdit" ng-model="$modal.formData.id" required
          type="text" ng-change="$modal.resetLoginError(userForm)">
        <p class="help-block" ng-show="userForm.login.$invalid && !userForm.login.$pristine && userForm.login.$error.required">This field is required.</p>
        <p class="help-block" ng-show="userForm.login.$invalid && userForm.login.$error.exists">This login is already in use.</p>
      </div>
    </div>

    <div class="form-group" ng-class="{ 'has-error' : userForm.name.$invalid && !userForm.name.$pristine }">
      <label class="col-sm-3 control-label">
        Full name
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <input class="form-control" name="name" placeholder="<NAME>" ng-model="$modal.formData.name" required type="text">
        <p class="help-block" ng-show="userForm.name.$invalid && !userForm.name.$pristine">This field is required.</p>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-3 control-label">
        Roles
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <div class="btn-group" uib-dropdown>
          <button class="btn btn-default btn-sm dropdown-toggle" uib-dropdown-toggle type="button">
            {{$modal.formData.roles.join(', ') || 'none'}}&nbsp;&nbsp;
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu" uib-dropdown-menu>
            <li>
              <a ng-click="$modal.formData.roles = []">none</a>
              <a ng-click="$modal.formData.roles = ['read']">read</a>
              <!-- TODO make it available only on cortex organization -->
              <a ng-click="$modal.formData.roles = ['superadmin']" require-roles="superadmin">superadmin</a>
              <a ng-click="$modal.formData.roles = ['read', 'analyze']">read, analyze</a>
              <a ng-click="$modal.formData.roles = ['read', 'analyze','orgadmin']">read, analyze, orgadmin</a>              
            </li>
          </ul>
        </div>
      </div>
    </div>

    <div class="form-group" ng-class="{ 'has-error' : userForm.organization.$invalid && !userForm.organization.$pristine }" ng-show="!$modal.orgId">
      <label class="col-sm-3 control-label">
        Organization
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <!-- <input class="form-control" ng-if="$modal.orgId" name="organization" placeholder="User's organization" ng-disabled="$modal.orgId" ng-model="$modal.formData.organization" required type="text"> -->
        <select class="form-control" name="organization" ng-model="$modal.formData.organization" ng-options="org.id as org.name for org in $modal.organizations"></select>
        <p class="help-block" ng-show="userForm.organization.$invalid && !userForm.organization.$pristine">This field is required.</p>
      </div>
    </div>

  </div>
  <div class="modal-footer text-left">
    <button class="btn btn-default pull-left" ng-click="$modal.cancel()" type="button">Cancel</button>
    <span class="btn pull-left">
      <i class="fa fa-asterisk text-danger"></i>&nbsp;Required field</span><commit_msg>Remove None user role<commit_after><form class="form-horizontal" name="userForm" ng-submit="$modal.saveUser(userForm)" novalidate>
  <div class="modal-header bg-primary">
    <h3 class="modal-title">{{$modal.isEdit ? 'Edit' : 'Add'}} user</h3>
  </div>
  <div class="modal-body">
    <div class="form-group" ng-class="{ 'has-error' : userForm.login.$invalid && !userForm.login.$pristine }">
      <label class="col-sm-3 control-label">
        Login
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <input class="form-control" name="login" placeholder="<NAME>" ng-disabled="$modal.isEdit" ng-model="$modal.formData.id" required
          type="text" ng-change="$modal.resetLoginError(userForm)">
        <p class="help-block" ng-show="userForm.login.$invalid && !userForm.login.$pristine && userForm.login.$error.required">This field is required.</p>
        <p class="help-block" ng-show="userForm.login.$invalid && userForm.login.$error.exists">This login is already in use.</p>
      </div>
    </div>

    <div class="form-group" ng-class="{ 'has-error' : userForm.name.$invalid && !userForm.name.$pristine }">
      <label class="col-sm-3 control-label">
        Full name
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <input class="form-control" name="name" placeholder="<NAME>" ng-model="$modal.formData.name" required type="text">
        <p class="help-block" ng-show="userForm.name.$invalid && !userForm.name.$pristine">This field is required.</p>
      </div>
    </div>

    <div class="form-group">
      <label class="col-sm-3 control-label">
        Roles
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <div class="btn-group" uib-dropdown>
          <button class="btn btn-default btn-sm dropdown-toggle" uib-dropdown-toggle type="button">
            {{$modal.formData.roles.join(', ') || 'none'}}&nbsp;&nbsp;
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu" uib-dropdown-menu>
            <li>
              <a ng-click="$modal.formData.roles = ['read']">read</a>
              <!-- TODO make it available only on cortex organization -->
              <a ng-click="$modal.formData.roles = ['superadmin']" require-roles="superadmin">superadmin</a>
              <a ng-click="$modal.formData.roles = ['read', 'analyze']">read, analyze</a>
              <a ng-click="$modal.formData.roles = ['read', 'analyze','orgadmin']">read, analyze, orgadmin</a>              
            </li>
          </ul>
        </div>
      </div>
    </div>

    <div class="form-group" ng-class="{ 'has-error' : userForm.organization.$invalid && !userForm.organization.$pristine }" ng-show="!$modal.orgId">
      <label class="col-sm-3 control-label">
        Organization
        <i class="fa fa-asterisk text-danger"></i>
      </label>
      <div class="col-sm-9">
        <!-- <input class="form-control" ng-if="$modal.orgId" name="organization" placeholder="User's organization" ng-disabled="$modal.orgId" ng-model="$modal.formData.organization" required type="text"> -->
        <select class="form-control" name="organization" ng-model="$modal.formData.organization" ng-options="org.id as org.name for org in $modal.organizations"></select>
        <p class="help-block" ng-show="userForm.organization.$invalid && !userForm.organization.$pristine">This field is required.</p>
      </div>
    </div>

  </div>
  <div class="modal-footer text-left">
    <button class="btn btn-default pull-left" ng-click="$modal.cancel()" type="button">Cancel</button>
    <span class="btn pull-left">
      <i class="fa fa-asterisk text-danger"></i>&nbsp;Required field</span>
{'fraction_non_alphanumeric': 0.1920147097452062, 'fraction_numerical': 0.002626740215392698, 'mean_word_length': 3.0184696569920844, 'pattern_counts': {'":': 0, '<': 166, '<?xml version=': 0, '>': 166, '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': '2652453', 'n_tokens_mistral': 2439, 'n_tokens_neox': 2373, 'n_words': 454}