All files / src/app/components/campaigns campaigns.component.html

100% Statements 41/41
100% Branches 4/4
100% Functions 0/0
100% Lines 20/20

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 2915x   656x 14x   656x   234x     14x 14x 14x 14x 14x   14x 1556x 3204x 3204x 3204x 92x 92x   14x 468x 14x    
<h1 class="title">Campaigns</h1>
 
@if (!campaigns) {
  <app-loader elementName="campaigns"></app-loader>
}
@if (campaigns) {
  <div class="container">
    <p-table [value]="campaigns" [paginator]="true" [rows]="10" [rowsPerPageOptions]="[10, 20, 50]" [showCurrentPageReport]="true" currentPageReportTemplate="{first} - {last} of {totalRecords} campaigns" [rowHover]="true">
      <ng-template pTemplate="header">
        <tr>
          <th pSortableColumn="campaign_id">id</th>
          <th pSortableColumn="name">Campaign name</th>
          <th >Campaign description</th>
          <th pSortableColumn="phaseCount">Number of phases</th>
        </tr>
      </ng-template>
      <ng-template pTemplate="body" let-campaign let-i="rowIndex">
        <tr [routerLink]="['/campaigns/', campaign.id]">
          <td>{{ campaign.id.substr(campaign.id.length - 4) }}</td>
          <td>{{ campaign.name }}</td>
          <td>{{ campaign.description }}</td>
          <td></td>
        </tr>
      </ng-template>
    </p-table>
    <button class="button is-rounded" [routerLink]="['/campaigns/new']" id="addCampaign">Add new campaign</button>
  </div>
}