All files / src/app/pages/checkout-address/checkout-address-anonymous checkout-address-anonymous.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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 942x                                                                                                                                                                                          
<div class="row">
  <!-- Error message -->
  <div class="col-md-12">
    <ish-error-message [error]="error" [toast]="false" />
  </div>
 
  <!-- login -->
  <div class="col-lg-6">
    <h2>{{ 'checkout.account.login.returning_customer.heading' | translate }}</h2>
    <ish-identity-provider-login />
  </div>
 
  <div class="col-lg-6">
    <!-- registration -->
    <div class="section">
      <h2>{{ 'account.new_user.heading' | translate }}</h2>
      <p>{{ 'account.create.benefit.text' | translate }}</p>
      <ul>
        <li>{{ 'account.create.benefit1.text' | translate }}</li>
        <li>{{ 'account.create.benefit2.text' | translate }}</li>
        <li>{{ 'account.create.benefit3.text' | translate }}</li>
        <li>{{ 'account.create.benefit4.text' | translate }}</li>
        <li>{{ 'account.create.benefit5.text' | translate }}</li>
      </ul>
      <a
        class="btn btn-secondary"
        data-testing-id="registration-link"
        routerLink="/register"
        [queryParams]="{ returnUrl: '/checkout', cancelUrl: '/checkout' }"
        >{{ 'account.create.button.label' | translate }}
      </a>
    </div>
 
    <!-- checkout as guest -->
    <ng-container *ishFeature="'guestCheckout'">
      @if (!isRecurringOrder()) {
        <div data-testing-id="guest-checkout">
          <h2>{{ 'checkout.addresses.checkout_as_guest.heading' | translate }}</h2>
          <p>{{ 'checkout.address.anonymous.guestcheckout.text' | translate }}</p>
          @if (isAddressFormCollapsed) {
            <button
              aria-controls="collapseBasic"
              class="btn btn-secondary"
              data-testing-id="guest-checkout-button"
              type="button"
              [attr.aria-expanded]="!isAddressFormCollapsed"
              (click)="showAddressForm()"
            >
              {{ 'checkout.addresses.checkout_as_guest.heading' | translate }}
            </button>
          }
          <!-- create address form -->
          <div
            class="section"
            data-testing-id="create-address-form"
            id="collapseBasic"
            [ngbCollapse]="isAddressFormCollapsed"
          >
            <form
              #addressForm="ngForm"
              class="form-horizontal"
              ishFormSubmit
              novalidate
              [formGroup]="form"
              (ngSubmit)="submitAddressForm()"
            >
              <ish-checkout-address-anonymous-form [parentForm]="form" />
              <div [ngClass]="{ 'row form-group': isShippingAddressFormExpanded }">
                <div [ngClass]="{ 'offset-md-4 col-md-8': isShippingAddressFormExpanded }">
                  @if (form.invalid && addressForm.submitted) {
                    <div aria-live="polite" class="visually-hidden" id="checkout-button-help">
                      {{ 'checkout.continue.validation.message' | translate }}
                    </div>
                  }
                  <button
                    class="btn btn-primary"
                    type="submit"
                    [attr.aria-describedby]="form.invalid && addressForm.submitted ? 'checkout-button-help' : null"
                  >
                    {{ 'checkout.button.label' | translate }}
                  </button>
                  <button class="btn btn-secondary" type="button" (click)="cancelAddressForm()">
                    {{ 'checkout.address.cancel.button.label' | translate }}
                  </button>
                </div>
              </div>
            </form>
          </div>
        </div>
      }
    </ng-container>
  </div>
</div>