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

feat: (CXSPA-8988) - Add missing labels for Combo boxes in Order Summary #19659

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -9,6 +9,7 @@
"recurrencePeriodType_MONTHLY": "Month",
"dayOfMonth": "On day",
"startOn": "Start on",
"repeatOnDays": "Repeat on the following days"
"repeatOnDays": "Repeat on the following days",
"duration": "Duration"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,36 @@
>
<div class="cx-replenishment-form-data-container">
<div *ngIf="!isMonthly" class="cx-days">
<span class="form-data-label">{{
'checkoutScheduledReplenishment.every' | cxTranslate
}}</span>
<span
class="form-data-label"
*cxFeature="'!a11yScheduleReplenishment'"
>{{ 'checkoutScheduledReplenishment.every' | cxTranslate }}</span
>
<label
class="form-data-label"
*cxFeature="'a11yScheduleReplenishment'"
for="order-replenishment-period-type"
>{{ 'checkoutScheduledReplenishment.every' | cxTranslate }}</label
>
<ng-container *ngIf="isWeekly; else isDaily">
<select
*cxFeature="'!a11yScheduleReplenishment'"
class="form-control"
(change)="changeNumberOfWeeks($event.target.value)"
>
<option
*ngFor="let nWeeks of numberOfWeeks"
[value]="nWeeks"
[selected]="
nWeeks === scheduleReplenishmentFormData.numberOfWeeks
"
>
{{ nWeeks }}
</option>
</select>
<select
*cxFeature="'a11yScheduleReplenishment'"
id="order-replenishment-period-type"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can introduce id attributes without a feature toggle because its not a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just updated it.

class="form-control"
(change)="changeNumberOfWeeks($event.target.value)"
>
Expand All @@ -71,6 +96,21 @@
</ng-container>
<ng-template #isDaily>
<select
*cxFeature="'!a11yScheduleReplenishment'"
class="form-control"
(change)="changeNumberOfDays($event.target.value)"
>
<option
*ngFor="let nDays of numberOfDays"
[value]="nDays"
[selected]="nDays === scheduleReplenishmentFormData.numberOfDays"
>
{{ nDays }}
</option>
</select>
<select
*cxFeature="'a11yScheduleReplenishment'"
id="order-replenishment-period-type"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can introduce id attributes without a feature toggle because its not a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just updated it.

class="form-control"
(change)="changeNumberOfDays($event.target.value)"
>
Expand All @@ -85,10 +125,29 @@
</ng-template>
</div>
<div class="cx-month">
<span *ngIf="isMonthly" class="form-data-label">{{
'checkoutScheduledReplenishment.every' | cxTranslate
}}</span>
<div *cxFeature="'!a11yScheduleReplenishment'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use <ng-container> to avoid the extra div

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just updated it.

<span *ngIf="isMonthly" class="form-data-label">{{
'checkoutScheduledReplenishment.every' | cxTranslate
}}</span>
</div>
<div *cxFeature="'a11yScheduleReplenishment'">
<label
*ngIf="isMonthly"
class="form-data-label"
for="order-replenishment-recurrence-period"
>{{ 'checkoutScheduledReplenishment.every' | cxTranslate }}</label
>
<label
*ngIf="!isMonthly"
class="form-data-label"
for="order-replenishment-recurrence-period"
>{{
'checkoutScheduledReplenishment.duration' | cxTranslate
}}</label
>
</div>
<select
id="order-replenishment-recurrence-period"
class="form-control"
(change)="changeRecurrencePeriodType($event.target.value)"
>
Expand All @@ -105,11 +164,36 @@
</select>
</div>
<div *ngIf="isMonthly" class="cx-dayMonth">
<span class="form-data-label">{{
'checkoutScheduledReplenishment.dayOfMonth' | cxTranslate
}}</span>
<span
class="form-data-label"
*cxFeature="'!a11yScheduleReplenishment'"
>{{ 'checkoutScheduledReplenishment.dayOfMonth' | cxTranslate }}</span
>
<label
class="form-data-label"
*cxFeature="'a11yScheduleReplenishment'"
for="order-replenishment-day-of-month"
>{{
'checkoutScheduledReplenishment.dayOfMonth' | cxTranslate
}}</label
>
<div class="cx-day-of-month">
<select
*cxFeature="'!a11yScheduleReplenishment'"
class="form-control"
(change)="changeDayOfTheMonth($event.target.value)"
>
<option
*ngFor="let nDays of numberOfDays"
[value]="nDays"
[selected]="nDays === scheduleReplenishmentFormData.nthDayOfMonth"
>
{{ nDays }}
</option>
</select>
<select
*cxFeature="'a11yScheduleReplenishment'"
id="order-replenishment-day-of-month"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can introduce id attributes without a feature toggle because its not a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just updated it.

class="form-control"
(change)="changeDayOfTheMonth($event.target.value)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export interface FeatureTogglesInterface {
a11yPopoverFocus?: boolean;

/**
* Adds Datepicker label and corrects heading order for 'CheckoutScheduleReplenishmentOrderComponent'.
* Adds Datepicker and Combobox label and corrects heading order for 'CheckoutScheduleReplenishmentOrderComponent'.
*/
a11yScheduleReplenishment?: boolean;

Expand Down
Loading