All files / app/form/user user.component.html

75.22% Statements 82/109
33.33% Branches 5/15
0% Functions 0/4
83.33% Lines 45/54

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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 976x   6x 2x 2x 6x         6x 2x   6x 2x   2x   6x 6x   6x 6x 2x 2x 2x 2x 2x 2x 2x     2x 2x     6x     2x   6x     2x   6x     2x   6x     2x   6x   6x 2x 1x 2x 2x       6x 2x 6x 6x 2x     6x 2x     2x                                      
<ng-container [formGroup]="group">
 
  <label [for]="id + '-tag'" i18n>Tag:</label>
  <div class="form-array">
    <input #tagInput
           [id]="id + '-tag'"
           type="text"
           inputmode="email"
           autocorrect="off"
           autocapitalize="none"
           formControlName="tag"
           (keydown)="$event.key === 'Enter' && validate(tagInput) || true"
           (blur)="blur(tagInput)">
    @if (showClear) {
      <button type="button" (click)="clear.next()" i18n-title title="New User" i18n>🆑️</button>
    }
  </div>
 
  <label [for]="id + '-name'" i18n>Name:</label>
  <input [id]="id + '-name'" type="text" formControlName="name">
 
  <label [for]="id + '-role'" i18n>Role:</label>
  <select [id]="id + '-role'" formControlName="role">
    <option value="ROLE_ADMIN" i18n>admin</option>
    <option value="ROLE_MOD" i18n>mod</option>
    <option value="ROLE_EDITOR" i18n>editor</option>
    <option value="ROLE_USER" i18n>user</option>
    <option value="ROLE_VIEWER" i18n>viewer</option>
    <option value="ROLE_ANONYMOUS" i18n>anon</option>
    <option value="ROLE_BANNED" i18n>banned</option>
  </select>
 
  <app-tags #notifications
            i18n-label label="Notifications:"
            fieldName="notifications"
            emoji="✉️"
            [group]="group"></app-tags>
 
  <app-tags #readAccess
            i18n-label label="Read Access:"
            fieldName="readAccess"
            [group]="group"></app-tags>
 
  <app-tags #writeAccess
            i18n-label label="Write Access:"
            fieldName="writeAccess"
            [group]="group"></app-tags>
 
  <app-tags #tagReadAccess
            i18n-label label="Tag Read Access:"
            fieldName="tagReadAccess"
            [group]="group"></app-tags>
 
  <app-tags #tagWriteAccess
            i18n-label label="Tag Write Access:"
            fieldName="tagWriteAccess"
            [group]="group"></app-tags>
 
  @if (showPubKey) {
    <label [for]="id + '-pubKey'" i18n>SSH Public Key:</label>
    <div>
      <textarea [id]="id + '-pubKey'"
                formControlName="pubKey"></textarea>
    </div>
  }
 
  <label [for]="id + '-authorizedKeys'" i18n>Authorized Keys:</label>
  <div #fill>
    <textarea [id]="id + '-authorizedKeys'"
              formControlName="authorizedKeys"
              [appFillWidth]="fill"></textarea>
  </div>
 
  @if (store.account.mod || external) {
    <label [for]="id + '-external'" i18n>External Config:</label>
    @if (!editingExternal && !external) {
      <div>
        <button type="button" (click)="editingExternal = true" i18n>+ Add Config</button>
      </div>
    } @else {
      <app-json [id]="id + '-external'"
                fieldName="external"
                [style.pointer-events]="store.account.mod ? 'auto' : 'none'"
                [group]="group"></app-json>
      @if (externalErrors.length) {
        <span><!-- Errors --></span>
        @for (e of externalErrors; track e) {
          <div>
            <span class="error">{{ e }}</span>
          </div>
        }
      }
    }
  }
 
</ng-container>