All files / src/app/extensions/order-templates/pages/account-order-template-detail account-order-template-detail-page.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 711x                                                                                                                                            
<!-- Error message -->
<ish-error-message [error]="orderTemplateError$ | async" />
 
<ng-container *ngIf="orderTemplate$ | async as orderTemplate" ishProductContext>
  <h1 class="clearfix">
    {{ orderTemplate?.title }}
    <button
      type="button"
      (click)="editOrderTemplateDialog.show()"
      class="btn btn-secondary float-right"
      [title]="'account.order_template.edit.heading' | translate"
      data-testing-id="order-template-details-edit"
    >
      {{ 'account.order_template.order_template.edit.rename' | translate }}
    </button>
  </h1>
 
  <p
    *ngIf="noOfUnavailableProducts$ | async as noOfUnavailableProducts"
    data-testing-id="out-of-stock-warning"
    class="alert alert-info"
  >
    {{ 'account.order_template.out_of_stock.warning' | translate : { num: noOfUnavailableProducts } }}
  </p>
 
  <div class="section">
    <ng-container *ngIf="orderTemplate.itemsCount && orderTemplate.itemsCount > 0; else noItems" class="section">
      <div class="list-header d-md-flex">
        <div class="col-6 list-header-item">{{ 'account.order_template.table.header.item' | translate }}</div>
        <div class="col-2 list-header-item text-right">
          {{ 'shopping_cart.qty.heading' | translate }}
        </div>
        <div class="col-2 list-header-item text-right">
          {{ 'account.order_template.table.header.date_added' | translate }}
        </div>
        <div class="col-2 list-header-item column-price text-right">
          {{ 'account.order_template.table.header.price' | translate }}
        </div>
      </div>
      <div class="list-body">
        <ng-container *ngFor="let item of orderTemplate.items; let i = index; trackBy: trackByFn">
          <div class="list-item-row list-item-row-big">
            <ish-account-order-template-detail-line-item
              ishProductContext
              [propagateIndex]="i"
              [sku]="item.sku"
              [quantity]="item.desiredQuantity.value"
              [orderTemplateItemData]="item"
              [currentOrderTemplate]="orderTemplate"
            />
          </div>
        </ng-container>
      </div>
    </ng-container>
  </div>
  <ish-product-add-to-basket *ngIf="orderTemplate.itemsCount" [cssClass]="'btn btn-primary float-right'" />
 
  <ng-template #noItems>
    <p>{{ 'account.order_template.no_entries' | translate }}</p>
  </ng-template>
 
  <ish-order-template-preferences-dialog
    #editOrderTemplateDialog
    [orderTemplate]="orderTemplate"
    (submitOrderTemplate)="editPreferences($event, orderTemplate.id)"
  />
</ng-container>
 
<a routerLink="/account/order-templates">{{ 'account.order_template.list.link.back' | translate }}</a>
<ish-loading *ngIf="orderTemplateLoading$ | async" />