Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add * to b2b forms required fields #19462

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
></cx-message>
</div>
</ng-container>
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<p class="cx-import-entries-subtitle">
{{ 'importEntriesDialog.importProductsNewSavedCartSubtitle' | cxTranslate }}
</p>
<p>
{{ 'importEntriesDialog.importProductFileDetails' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</p>
<label>
<cx-file-upload
Expand All @@ -37,6 +41,7 @@
<label>
<span class="cx-import-entries-label label-content">
{{ 'importEntriesDialog.savedCartName' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
[maxLength]="nameMaxLength"
Expand Down Expand Up @@ -90,3 +95,13 @@
</button>
</div>
</form>

<ng-template #requiredAsterisk>
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@
<div class="form-group">
<form (ngSubmit)="applyQuickOrder()" [formGroup]="quickOrderForm">
<div class="cx-cart-quick-order-form-container">
<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
<ng-container
*cxFeature="
'!a11yDisabledCouponAndQuickOrderActionButtonsInsteadOfRequiredFields'
"
>
<!-- TODO: (CXSPA-5953) Remove feature flags next major -->
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
</ng-container>
<span class="cx-cart-quick-order-form-productID">
<label class="cx-cart-quick-order-form-label">
{{ 'quickOrderCartForm.productCodeLabel' | cxTranslate }}
<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
<ng-container
*cxFeature="
'!a11yDisabledCouponAndQuickOrderActionButtonsInsteadOfRequiredFields'
"
>
<!-- TODO: (CXSPA-5953) Remove feature flags next major -->
<abbr
*cxFeature="'a11yRequiredAsterisks'"
aria-hidden="true"
class="text-decoration-none"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-container>
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</label>

<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
Expand Down Expand Up @@ -72,13 +69,15 @@
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityFullLabel' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</label>

<label
*cxFeature="'!a11yQTY2Quantity'"
class="cx-cart-quick-order-form-label"
>
{{ 'quickOrderCartForm.quantityLabel' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</label>

<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
Expand Down Expand Up @@ -180,3 +179,21 @@
</form>
</div>
</ng-container>

<ng-template #requiredAsterisk>
<!-- TODO: (CXSPA-7479) Remove feature flags next major -->
<ng-container
*cxFeature="
'!a11yDisabledCouponAndQuickOrderActionButtonsInsteadOfRequiredFields'
"
>
<!-- TODO: (CXSPA-5953) Remove feature flags next major -->
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-container>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@
<!-- TODO:#future-checkout do we really want this? We can always pass more inputs to the copied address form component to make it more modular -->
<ng-template #billingAddress>
<div [formGroup]="billingAddressForm">
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<div class="form-group" formGroupName="country">
<ng-container *ngIf="countries$ | async as countries">
<div *ngIf="countries.length !== 0">
<label>
<span class="label-content required">{{
'addressForm.country' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.country' | cxTranslate }}
<ng-template
[ngTemplateOutlet]="requiredAsterisk"
></ng-template>
</span>
<ng-select
[inputAttrs]="{ required: 'true' }"
[searchable]="true"
Expand All @@ -71,9 +77,10 @@
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.firstName.label' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.firstName.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
class="form-control"
Expand All @@ -90,9 +97,10 @@
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.lastName.label' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.lastName.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="text"
Expand All @@ -107,9 +115,10 @@
</div>
<div class="form-group">
<label>
<span class="label-content required">{{
'addressForm.address1' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.address1' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="text"
Expand Down Expand Up @@ -138,9 +147,10 @@
<div class="row">
<div class="form-group col-md-6">
<label>
<span class="label-content required">{{
'addressForm.city.label' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.city.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="text"
Expand All @@ -155,9 +165,10 @@
</div>
<div class="form-group col-md-6">
<label>
<span class="label-content required">{{
'addressForm.zipCode.label' | cxTranslate
}}</span>
<span class="label-content required">
{{ 'addressForm.zipCode.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="text"
Expand Down Expand Up @@ -209,3 +220,13 @@
</div>
</ng-template>
</div>

<ng-template #requiredAsterisk>
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<form (ngSubmit)="onSubmit()" [formGroup]="checkoutLoginForm">
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<div class="form-group">
<label>
<span class="label-content">{{
'checkoutLogin.emailAddress.label' | cxTranslate
}}</span>
<span class="label-content">
{{ 'checkoutLogin.emailAddress.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="email"
Expand Down Expand Up @@ -33,9 +37,10 @@

<div class="form-group">
<label>
<span class="label-content">{{
'checkoutLogin.confirmEmail.label' | cxTranslate
}}</span>
<span class="label-content">
{{ 'checkoutLogin.confirmEmail.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
type="email"
Expand Down Expand Up @@ -67,3 +72,13 @@
{{ 'checkoutLogin.continue' | cxTranslate }}
</button>
</form>

<ng-template #requiredAsterisk>
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-template>
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<form class="cx-place-order-form form-check" [formGroup]="checkoutSubmitForm">
<div class="form-group">
<label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@

<div class="cx-customer-ticket-form-body">
<div class="cx-customer-ticket-form-row">
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<label>
<span class="cx-customer-ticket-label label-content">
{{ 'createCustomerTicket.subject' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<textarea
[maxLength]="inputCharactersForSubject"
Expand All @@ -48,6 +52,7 @@
<label *ngIf="ticketCategories$ | async as ticketCategories">
<span class="cx-customer-ticket-label label-content">
{{ 'createCustomerTicket.category' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<select class="form-control" formControlName="ticketCategory">
<option value="" disabled selected>
Expand Down Expand Up @@ -98,6 +103,7 @@
<label>
<span class="cx-customer-ticket-label label-content">
{{ 'customerTicketing.message' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<textarea
[maxLength]="inputCharactersLimit"
Expand Down Expand Up @@ -165,3 +171,13 @@
</div>
</form>
</div>

<ng-template #requiredAsterisk>
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { I18nModule } from '@spartacus/core';
import { I18nModule, FeaturesConfigModule } from '@spartacus/core';
import {
FileUploadModule,
FormErrorsModule,
Expand All @@ -26,6 +26,7 @@ import { CustomerTicketingCreateComponent } from './customer-ticketing-create.co
ReactiveFormsModule,
FormErrorsModule,
FileUploadModule,
FeaturesConfigModule,
],
declarations: [
CustomerTicketingCreateComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ <h3>{{ 'checkoutOrderConfirmation.createAccount' | cxTranslate }}</h3>
</p>

<form (ngSubmit)="submit()" [formGroup]="guestRegisterForm">
<p *cxFeature="'a11yRequiredAsterisks'" class="form-legend">
{{ 'formLegend.required' | cxTranslate }}
</p>
<div class="form-group">
<label>
<span class="label-content">{{
'register.password.label' | cxTranslate
}}</span>
<span class="label-content">
{{ 'register.password.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
class="form-control"
Expand Down Expand Up @@ -43,9 +47,10 @@ <h3>{{ 'checkoutOrderConfirmation.createAccount' | cxTranslate }}</h3>

<div class="form-group">
<label>
<span class="label-content">{{
'register.confirmPassword.label' | cxTranslate
}}</span>
<span class="label-content">
{{ 'register.confirmPassword.label' | cxTranslate }}
<ng-template [ngTemplateOutlet]="requiredAsterisk"></ng-template>
</span>
<input
required="true"
class="form-control"
Expand Down Expand Up @@ -83,3 +88,13 @@ <h3>{{ 'checkoutOrderConfirmation.createAccount' | cxTranslate }}</h3>
</form>
</div>
</div>

<ng-template #requiredAsterisk>
<abbr
*cxFeature="'a11yRequiredAsterisks'"
class="text-decoration-none"
aria-hidden="true"
title="{{ 'common.required' | cxTranslate }}"
>*</abbr
>
</ng-template>
Loading