Ontica/Empiria.Land.Intranet

View on GitHub
src/app/views/transactions/workflow-commander/workflow-command-config.component.html

Summary

Maintainability
Test Coverage
<form [formGroup]="form" empNgFormKeyDownEnter autocomplete="off" class="form-section">

  <div class="fx-column-container fx-gap-half">

    <div class="fx-row-container sm-fx-column-container">

      <div class="fx-item-third sm-fx-item">
        <label>Operación:</label>
        <emp-ng-select formControlName="command"
          [items]="applicableCommandsList"
          [showError]="formHelper.isControlInvalid(form.controls.command)"
          bindValue="type"
          (changes)="onCommandChanges($event)">
        </emp-ng-select>
      </div>

      <div *ngIf="requiredNextStatusField"
        class="fx-item-third sm-fx-item">
        <label>Nuevo estado:</label>
        <emp-ng-select formControlName="nextStatus"
          [items]="commandSelected.nextStatus"
          [showError]="formHelper.isControlInvalid(form.controls.nextStatus)"
          bindValue="type"
          (changes)="onStatusChanges($event)">
        </emp-ng-select>
      </div>

      <div *ngIf="requiredNextUserField"
        class="fx-item-third sm-fx-item">
        <label>{{labelNextUser}}</label>
        <emp-ng-select formControlName="nextUser"
          [items]="statusSelected.users"
          [placeholder]="statusSelected.type === 'None' ? 'Seleccione el nuevo estado' : 'Seleccione'"
          [showError]="formHelper.isControlInvalid(form.controls.nextUser)">
        </emp-ng-select>
      </div>

      <div *ngIf="requiredAuthorizationField"
        class="fx-item-third sm-fx-item">
        <label>Firma electrónica:</label>
        <input formControlName="authorization" class="text-box" type="password" autocomplete="new-password"
          [class.invalid-control]="formHelper.isControlInvalid(form.controls.authorization)">
      </div>

    </div>

    <ng-container *ngIf="commandSelected.type !== 'None'">

      <div class="fx-row-container sm-fx-column-container">

        <div class="fx-item">
          <label>Observaciones:</label>
          <textarea formControlName="note" empNgTextareaAutoresize rows="1" class="text-area"></textarea>
        </div>

      </div>

    </ng-container>

  </div>

</form>