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

33.33% Statements 47/141
43.24% Branches 16/37
0% Functions 0/9
53.57% Lines 30/56

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 932x 2x 2x         1x 1x 2x 2x 1x   1x 1x 2x 1x   1x   2x 1x   1x   2x 1x   1x 2x 1x   2x 1x   1x   2x                                   1x 1x                                                   1x   1x       2x        
<div class="link" [class.remote]="!local" [title]="plugin.config?.description || ''">
  <a [routerLink]="['/tag', qualifiedTag]">{{ plugin.name || plugin.tag }}</a>
  @if (plugin.name) {
    <span class="host">({{ qualifiedTag }})</span>
  } @else if (origin) {
    <span class="host">({{ origin }})</span>
  }
</div>
<div class="info">
  <span [title]="plugin.modified?.toISO()" i18n>modified {{ plugin.modified?.toRelative() }}</span>
  @if (!local) {
    &nbsp;<span i18n>on</span>&nbsp;<a [routerLink]="['/tag', plugin.origin]">{{ plugin.origin }}</a>
  }
</div>
<div class="actions">
  @if (!created && store.account.admin) {
    <app-confirm-action #action [action]="copy$" i18n>install</app-confirm-action>
  } @else if (!local) {
    <app-inline-button #action [action]="copy$" i18n>copy</app-inline-button>
  }
  @if (created && local && store.account.admin) {
    <a class="fake-link" (click)="editing = !editing" i18n>@if (editForm.dirty) {*edit*} @else {edit}</a>
  } @else {
    <a class="fake-link" (click)="viewSource = !viewSource" i18n>source</a>
  }
  @if (canDiff) {
    <a class="fake-link diff-link" (click)="toggleDiff()" i18n>diff</a>
  }
  <a class="fake-link" (click)="download()" i18n>download</a>
  @if (plugin.config?.export) {
    <a class="fake-link" (click)="export()" i18n>export</a>
  }
  @if (created && store.account.admin) {
    <app-confirm-action #action [action]="delete$" i18n>delete</app-confirm-action>
  }
</div>
 
@if (editing) {
  <form class="form" [formGroup]="editForm" (ngSubmit)="save()">
 
    <app-plugin-form [group]="editForm"
                     [configErrors]="configErrors"
                     [defaultsErrors]="defaultsErrors"
                     [schemaErrors]="schemaErrors"></app-plugin-form>
 
    @for (e of serverError; track e) {
      <span><!-- Unexpected Error --></span>
      <div class="error">{{ e }}</div>
    }
 
    <span><!-- Buttons --></span>
    <span class="buttons right">
      @if (saving) {
        <app-loading [inline]="true"></app-loading>
      }
      <button type="submit" [disabled]="saving || submitted && !editForm.valid" i18n>save</button>
      <button type="button" (click)="editing = false" i18n>cancel</button>
    </span>
  </form>
}  @else if (viewSource) {
  <form class="form" [formGroup]="editForm">
    <app-plugin-form [group]="editForm"></app-plugin-form>
  </form>
} @else if (diffing && diffLocal && diffRemote) {
  <div class="diff-view form">
    <app-diff #diffEditor
              [original]="diffLocal"
              [modified]="diffRemote"
              [readOnly]="!store.account.admin">
    </app-diff>
 
    @for (e of serverError; track e) {
      <span><!-- Unexpected Error --></span>
      <div class="error">{{ e }}</div>
    }
 
    <span><!-- Buttons --></span>
    <span class="buttons right">
      @if (saving) {
        <app-loading [inline]="true"></app-loading>
      }
      @if (store.account.admin) {
        <button type="button" class="save-diff" [disabled]="saving" (click)="saveDiff()" i18n>save</button>
      }
      <button type="button" (click)="diffing = false" i18n>cancel</button>
    </span>
  </div>
} @else {
  @for (e of serverError; track e) {
    <div class="error">{{ e }}</div>
  }
}