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 71 72 73 74 75 761x                                                                                                                                                      
<!-- Error message -->
<ish-error-message [error]="orderTemplateError$ | async" />
 
@if (orderTemplate$ | async; as orderTemplate) {
<ng-container ishProductContext>
  <ish-in-place-edit
    #inPlaceEdit
    (edited)="updateTitle()"
    (aborted)="resetTitle()"
    ariaLabelName="account.order_template.edit.name.label"
    buttonClass="btn-lg"
    [confirmDisabled]="!form.valid"
  >
    <h1 viewModeContent>
      {{ orderTemplate?.title }}
    </h1>
    <div editModeForm class="flex-grow-1 position-relative" style="margin-top: 12px; margin-bottom: 16px">
      <formly-form
        [form]="form"
        [model]="model"
        [fields]="fields"
        (keydown.enter)="inPlaceEdit.confirm()"
        (keydown.esc)="inPlaceEdit.cancel()"
      />
    </div>
  </ish-in-place-edit>
  @if (noOfUnavailableProducts$ | async; as noOfUnavailableProducts) {
  <p 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">
    @if (orderTemplate.itemsCount && orderTemplate.itemsCount > 0) {
    <ng-container 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-end">
          {{ 'shopping_cart.qty.heading' | translate }}
        </div>
        <div class="col-2 list-header-item text-end">
          {{ 'account.order_template.table.header.date_added' | translate }}
        </div>
        <div class="col-2 list-header-item column-price text-end">
          {{ 'account.order_template.table.header.price' | translate }}
        </div>
      </div>
      <div class="list-body">
        @for (item of orderTemplate.items; track item.id; let i = $index) {
        <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>
        }
      </div>
    </ng-container>
    } @else {
    <p>{{ 'account.order_template.no_entries' | translate }}</p>
    }
  </div>
  @if (orderTemplate.itemsCount) {
  <ish-product-add-to-basket [cssClass]="'btn btn-primary float-end'" />
  }
</ng-container>
}
 
<a routerLink="/account/order-templates">{{ 'account.order_template.list.link.back' | translate }}</a>
@if (orderTemplateLoading$ | async) {
<ish-loading />
}