All files / src/app/extensions/wishlists/pages/account-wishlist/account-wishlist-list account-wishlist-list.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 612x                                                                                                                        
@if (wishlists?.length > 0) {
  <div class="list-body">
    <ng-container *ngTemplateOutlet="wishlistRow; context: { wishlist: preferredWishlist }" />
    @for (wishlist of wishlists; track wishlist.id) {
      @if (!preferredWishlist || wishlist.id !== preferredWishlist.id) {
        <ng-container *ngTemplateOutlet="wishlistRow; context: { wishlist: wishlist }" />
      }
    }
  </div>
} @else {
  <p>{{ 'account.wishlists.no_wishlists' | translate }}</p>
}
<ng-template #wishlistRow let-wishlist="wishlist">
  @if (wishlist) {
    <div class="list-item-row row mx-0" data-testing-id="wishlist-list-item-container">
      <div class="col-7 list-item" data-testing-id="wishlist-list-item">
        <a data-testing-id="wishlist-list-title" [routerLink]="'/account/wishlists/' + wishlist.id">{{
          wishlist.title
        }}</a>
        @if (wishlist.preferred) {
          <span class="input-help ps-3">{{ 'account.wishlists.table.preferred' | translate }}</span>
        }
        @if (wishlist.shared) {
          <span
            class="input-help"
            [ngClass]="{ 'link-separator': wishlist.preferred && wishlist.shared, 'ps-3': !wishlist.preferred }"
            >{{ 'account.wishlists.table.shared' | translate }}</span
          >
        }
      </div>
      <div class="col-2 list-item">
        {{ 'account.wishlists.items' | translate: { '0': wishlist.itemsCount } }}
      </div>
      <div class="col-3 list-item text-end">
        <button
          class="btn-tool btn-link"
          data-testing-id="delete-wishlist"
          type="button"
          title="{{ 'account.wishlist.list.remove' | translate }}"
          (click)="openDeleteConfirmationDialog(wishlist, deleteDialog)"
        >
          <i class="bi bi-trash-fill"></i>
        </button>
      </div>
    </div>
  }
</ng-template>
 
<!-- the title will be set dynamically -->
<ish-modal-dialog
  #deleteDialog
  [options]="{
    titleText: 'undefined',
    confirmText: 'account.wishlists.delete_wishlist_dialog.delete_button.text' | translate,
    rejectText: 'account.wishlists.delete_wishlist_dialog.cancel_button.text' | translate,
  }"
  (confirmed)="delete($event)"
>
  {{ 'account.wishlists.delete_wishlist_dialog.are_you_sure_paragraph' | translate }}
</ish-modal-dialog>