All files / src/app/components/signals-table signals-table.component.html

97.36% Statements 74/76
100% Branches 8/8
80% Functions 4/5
100% Lines 34/34

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 51935x 14x   1870x 14x     686x     14x 14x 14x   14x 1372x 2x 2x 2x 2x 2x 2x   14x   1386x     14x       14x 14x 14x 14x 14x 14x   14x 7484x 15623x 7484x 15623x 15623x 15623x 655x   14x    
@if (!signals) {
  <div class="skeleton-block"></div>
}
@if (signals) {
  <p-table #signals_table [value]="signals.items" [tableStyle]="{ 'min-width': '50rem' }" [paginator]="true" [rows]="rows"
    [rowsPerPageOptions]="filteredRowsPerPageOptions" [showCurrentPageReport]="true" [first]="offset" [totalRecords]="signals.total"
    currentPageReportTemplate="{first} - {last} of {totalRecords} signals" [rowHover]="true" [lazy]="true"
    [globalFilterFields]="['ticker']" (onPage)="onTableEvent($event)" (onLazyLoad)="loadEvents($event)">
    <ng-template pTemplate="caption">
      <div class="columns">
        <div class="column">
          Signals
        </div>
        <div class="column is-flex is-justify-content-right">
          <span>
            @if (searchValue && searchValue.length>0) {
              <button class="button" (click)="clearFilter()">
                <span class="icon is-small center">
                  <i class="iconoir-xmark-circle"></i>
                </span>
                <span>Clear filter</span>
              </button>
            }
          </span>
          <span>
            <input class="input" type="text" (input)="applyFilterGlobal($event)" placeholder="Filter" [(ngModel)]="searchValue"/>
          </span>
        </div>
      </div>
    </ng-template>
    <ng-template pTemplate="header">
      <tr>
        <th pSortableColumn="signal_id">Ticker <p-sortIcon field="signal_id"></p-sortIcon></th>
        <th pSortableColumn="status">Status <p-sortIcon field="status"></p-sortIcon></th>
        <th pSortableColumn="unit">Unit <p-sortIcon field="unit"></p-sortIcon></th>
        <th pSortableColumn="type">Type <p-sortIcon field="type"></p-sortIcon></th>
        <th pSortableColumn="frequency">Frequency <p-sortIcon field="frequency"></p-sortIcon></th>
      </tr>
    </ng-template>
    <ng-template pTemplate="body" let-signal>
      <tr [routerLink]="['/signals', signal.signal_id]">
        <td>{{ signal.ticker }}</td>
        <td><p-tag [value]="signal.status.status" [severity]="getSeverity(signal.status.status)"></p-tag></td>
        <td>{{ signal.unit }}</td>
        <td>{{ signal.type }}</td>
        <td>{{ signal.frequency }}</td>
      </tr>
    </ng-template>
  </p-table>
}