All files / projects/organization-management/src/app/pages/user-create/user-csv-import user-csv-import.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 492x                                                                                                
<div class="row mt-4">
  <div class="col-md-12">
    <h2 class="h3">{{ 'user.csv.import.title' | translate }}</h2>
    <p>{{ 'user.csv.import.subtitle' | translate }}</p>
    <form [formGroup]="csvForm" (ngSubmit)="submitUsers()" [attr.aria-label]="'user.csv.import.form.label' | translate">
      <div class="form-group section">
        <input
          #fileInput
          type="file"
          name="csvFile"
          size="35"
          accept=".csv"
          (change)="onFileChange($event)"
          [attr.aria-label]="'user.csv.import.file.upload.aria_label' | translate"
        />
        <div>
          @switch (status) { @case ('InvalidHeader') {
          <small class="has-error">
            <span class="validation-message">{{ 'user.csv.import.file.invalid.input' | translate }}</span>
          </small>
          } @case ('InvalidFormat') {
          <small class="has-error">
            <span class="validation-message">{{ 'user.csv.import.file.invalid.format' | translate }}</span>
          </small>
          } @case ('Valid') {
          <small class="has-success">
            <span class="validation-message">{{ 'user.csv.import.file.uploaded' | translate }}</span>
          </small>
          } @default {
          <small></small>
          } }
        </div>
        <small
          class="form-text"
          [innerHTML]="'user.csv.import.file.sample' | translate : { '0': 'assets/sample-data/users.csv' }"
        ></small>
      </div>
      <div>
        <button type="submit" class="btn btn-primary" name="importUsers" [disabled]="isCsvDisabled">
          {{ 'user.csv.import.create.button.label' | translate }}
        </button>
        <button type="reset" class="btn btn-link" name="reset" (click)="resetInput()">
          {{ 'user.csv.import.reset.button.label' | translate }}
        </button>
      </div>
    </form>
  </div>
</div>