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

55% Statements 55/100
40.9% Branches 9/22
0% Functions 0/4
46.15% Lines 24/52

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 942x 2x 2x   2x 2x   2x 1x   2x         2x     2x   1x                           1x 2x 2x 1x 1x                               2x 2x 1x 1x                               2x 2x 1x 1x                                  
<ng-container [formGroup]="group">
  <label [for]="id + '-tag'" i18n>Tag:</label>
  <input [id]="id + '-tag'" type="text" formControlName="tag" [attr.disabled]="true">
 
  <label [for]="id + '-title'" i18n>Name:</label>
  <input [id]="id + '-title'"
         type="text"
         [formControl]="name"
         (blur)="validate($any($event.target))">
 
  @if (adminForm.length) {
    <app-admin-config class="admin-form"
                      [group]="group"
                      [fields]="adminForm"></app-admin-config>
  } @else {
    <ng-container *ngTemplateOutlet="jsonEditors"></ng-container>
  }
 
  @if (adminForm.length || advancedAdminForm.length) {
    <details class="advanced admin-advanced" [open]="!!adminForm.length && jsonErrors">
      <summary><span i18n>Advanced</span></summary>
      <div class="form">
        @if (advancedAdminForm.length) {
          <app-admin-config class="advanced-admin-form"
                            [group]="group"
                            [fields]="advancedAdminForm"></app-admin-config>
        }
        @if (adminForm.length) {
          <ng-container *ngTemplateOutlet="jsonEditors"></ng-container>
        }
      </div>
    </details>
  }
 
  <ng-template #jsonEditors>
    <label [for]="id + '-config'" i18n>Config:</label>
    @if (!editingConfig && !config) {
      <div>
        <button type="button" (click)="editingConfig = true" i18n>+ Add Config</button>
      </div>
    } @else {
      <app-json [id]="id + '-config'"
                fieldName="config"
                [group]="group"></app-json>
      @if (configErrors.length) {
        <span><!-- Errors --></span>
        @for (e of configErrors; track e) {
          <div>
            <span class="error">{{ e }}</span>
          </div>
        }
      }
    }
 
    <label [for]="id + '-defaults'" i18n>Defaults:</label>
    @if (!editingDefaults && !defaults) {
      <div>
        <button type="button" (click)="editingDefaults = true" i18n>+ Add Defaults</button>
      </div>
    } @else {
      <app-json [id]="id + '-defaults'"
                fieldName="defaults"
                [group]="group"></app-json>
      @if (defaultsErrors.length) {
        <span><!-- Errors --></span>
        @for (e of defaultsErrors; track e) {
          <div>
            <span class="error">{{ e }}</span>
          </div>
        }
      }
    }
 
    <label [for]="id + '-schema'" i18n>Schema:</label>
    @if (!editingSchema && !schema) {
      <div>
        <button type="button" (click)="editingSchema = true" i18n>+ Add Schema</button>
      </div>
    } @else {
      <app-json [id]="id + '-schema'"
                fieldName="schema"
                [group]="group"></app-json>
      @if (schemaErrors.length) {
        <span><!-- Errors --></span>
        @for (e of schemaErrors; track e) {
          <div>
            <span class="error">{{ e }}</span>
          </div>
        }
      }
    }
  </ng-template>
</ng-container>