All files / src/app/shared/components/product/product-list-toolbar product-list-toolbar.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

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 712x                                                                                                                                            
<div class="filters-row row align-items-center">
  <div class="item-count" [ngClass]="{ 'col-md-7': sortOptions?.length, 'col-md-10': !sortOptions?.length }">
    <div class="row align-items-center">
      <div class="col-sm-3 col-4">
        @if (itemCount >= 0) {
          <div aria-live="polite" class="pagination-total text-nowrap">
            {{ 'product.items.label' | translate: { '0': itemCount } }}
          </div>
        }
      </div>
      <div class="col-sm-9 col-8">
        @if (pageIndices?.length && currentPage) {
          <ish-product-list-paging
            [currentPage]="currentPage"
            [fragmentOnRouting]="fragmentOnRouting"
            [pageIndices]="pageIndices"
          />
        }
      </div>
    </div>
  </div>
  @if (sortOptions?.length) {
    <div class="col-8 col-sm-9 col-md-3 sort-by">
      <select
        class="form-control sort-by-filter"
        [attr.aria-label]="'product.items.sorting.label' | translate"
        (change)="changeSortBy($event.target)"
      >
        <option value="default" [selected]="sortBy === 'default'">
          {{ 'product.items.sorting.default.label' | translate }}
        </option>
        @for (o of sortOptions; track o.value) {
          <option [selected]="o.value === sortBy" [value]="o.value">{{ o.label }}</option>
        }
      </select>
    </div>
  }
  <div class="col-4 col-sm-3 col-md-2 switch-layout">
    <div class="d-flex align-items-center justify-content-end">
      <a
        class="grid-view-link"
        data-testing-id="grid-view-link"
        queryParamsHandling="merge"
        role="button"
        [fragment]="fragmentOnRouting"
        [ngClass]="{ 'grid-active': gridView }"
        [queryParams]="{ view: 'grid' }"
        [replaceUrl]="true"
        [routerLink]="[]"
        [title]="'product.items.view.grid_view.aria_label' | translate"
      >
        <i class="bi bi-grid-3x3-gap-fill"></i>
      </a>
      <a
        class="list-view-link"
        data-testing-id="list-view-link"
        queryParamsHandling="merge"
        role="button"
        [fragment]="fragmentOnRouting"
        [ngClass]="{ 'list-active': listView }"
        [queryParams]="{ view: 'list' }"
        [replaceUrl]="true"
        [routerLink]="[]"
        [title]="'product.items.view.list_view.aria_label' | translate"
      >
        <i class="bi bi-list-ul"></i>
      </a>
    </div>
  </div>
</div>