Skip to content

Commit

Permalink
fix: add missing role button attribute to the button links (#19535)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Markov <petarmarkov9449>
  • Loading branch information
uroslates authored Nov 25, 2024
1 parent 49ab000 commit fc5e624
Show file tree
Hide file tree
Showing 43 changed files with 228 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
[routerLink]="{ cxRoute: 'cart' } | cxUrl"
(click)="dismissModal('View Cart click')"
class="btn btn-primary"
cxBtnLikeLink
autofocus
>{{ 'addToCart.viewCart' | cxTranslate }}</a
>
Expand All @@ -130,6 +131,7 @@
[routerLink]="{ cxRoute: 'checkout' } | cxUrl"
(click)="dismissModal('Proceed To Checkout click')"
class="btn btn-secondary"
cxBtnLikeLink
>{{ 'addToCart.proceedToCheckout' | cxTranslate }}</a
>
</ng-container>
Expand Down Expand Up @@ -273,6 +275,7 @@
[routerLink]="{ cxRoute: 'cart' } | cxUrl"
(click)="dismissModal('View Cart click')"
class="btn btn-primary"
cxBtnLikeLink
autofocus
>{{ 'addToCart.viewCart' | cxTranslate }}</a
>
Expand All @@ -281,6 +284,7 @@
[routerLink]="{ cxRoute: 'checkout' } | cxUrl"
(click)="dismissModal('Proceed To Checkout click')"
class="btn btn-secondary"
cxBtnLikeLink
>{{ 'addToCart.proceedToCheckout' | cxTranslate }}</a
>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
UrlModule,
} from '@spartacus/core';
import {
BtnLikeLinkModule,
IconModule,
ItemCounterModule,
KeyboardFocusModule,
Expand All @@ -40,6 +41,7 @@ import { defaultAddedToCartLayoutConfig } from './default-added-to-cart-layout.c
ItemCounterModule,
KeyboardFocusModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [provideDefaultConfig(defaultAddedToCartLayoutConfig)],
declarations: [AddedToCartDialogComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<a
class="btn btn-link button-add-link cx-action-link"
[routerLink]="{ cxRoute: 'login' } | cxUrl"
cxBtnLikeLink
>
<cx-icon aria-hidden="true" [type]="iconTypes.EMPTY_HEART"></cx-icon>
<span class="button-text">{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import {
provideDefaultConfig,
UrlModule,
} from '@spartacus/core';
import { AtMessageModule, IconModule } from '@spartacus/storefront';
import {
AtMessageModule,
BtnLikeLinkModule,
IconModule,
} from '@spartacus/storefront';
import { AddToWishListComponent } from './add-to-wish-list.component';

@NgModule({
Expand All @@ -26,6 +30,7 @@ import { AddToWishListComponent } from './add-to-wish-list.component';
UrlModule,
AtMessageModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="col-xs-12 col-md-4 col-lg-3">
<a
role="button"
[routerLink]="
{
cxRoute: backRoute,
params: { code: orderCode },
} | cxUrl
"
cxBtnLikeLink
class="btn btn-block btn-secondary"
>
{{ 'common.back' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { I18nModule, UrlModule } from '@spartacus/core';
import { AmendOrderActionsComponent } from './amend-order-actions.component';
import { BtnLikeLinkModule } from '@spartacus/storefront';

@NgModule({
imports: [CommonModule, RouterModule, UrlModule, I18nModule],
imports: [
CommonModule,
RouterModule,
UrlModule,
I18nModule,
BtnLikeLinkModule,
],
declarations: [AmendOrderActionsComponent],
exports: [AmendOrderActionsComponent],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@

<div class="col-xs-12 col-md-4 col-lg-3">
<a
role="button"
*ngIf="order.cancellable"
[routerLink]="
{
cxRoute: 'orderCancel',
params: order,
} | cxUrl
"
cxBtnLikeLink
class="btn btn-block btn-secondary"
>
{{ 'orderDetails.cancellationAndReturn.cancelAction' | cxTranslate }}
</a>

<a
role="button"
*ngIf="order.returnable"
[routerLink]="
{
cxRoute: 'orderReturn',
params: order,
} | cxUrl
"
cxBtnLikeLink
class="btn btn-block btn-secondary"
>
{{ 'orderDetails.cancellationAndReturn.returnAction' | cxTranslate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
PromotionsModule,
ProvideOutletOptions,
SpinnerModule,
BtnLikeLinkModule,
} from '@spartacus/storefront';
import {
MyAccountV2ConsignmentTrackingComponent,
Expand Down Expand Up @@ -110,6 +111,7 @@ const moduleComponents = [
IconModule,
MyAccountV2DownloadInvoicesModule,
AbstractOrderContextModule,
BtnLikeLinkModule,
],
providers: [
OrderOverviewComponentService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ <h2 *ngIf="!type.replenishmentOrder">
[routerLink]="{ cxRoute: 'home' } | cxUrl"
routerLinkActive="active"
class="btn btn-primary btn-block"
cxBtnLikeLink
>{{ 'orderHistory.startShopping' | cxTranslate }}</a
>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
UrlModule,
} from '@spartacus/core';
import {
BtnLikeLinkModule,
ListNavigationModule,
MediaModule,
SpinnerModule,
Expand Down Expand Up @@ -56,6 +57,7 @@ const moduleComponents = [
I18nModule,
SpinnerModule,
MediaModule,
BtnLikeLinkModule,
],
declarations: [OrderHistoryComponent, ...moduleComponents],
exports: [OrderHistoryComponent, ...moduleComponents],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="cx-cancel-replenishment-btns row">
<div class="col-xs-12 col-md-5 col-lg-4">
<a
role="button"
class="btn btn-block btn-secondary"
[routerLink]="
{
cxRoute: 'replenishmentOrders',
} | cxUrl
"
cxBtnLikeLink
>
{{ 'common.back' | cxTranslate }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
UrlModule,
} from '@spartacus/core';
import {
BtnLikeLinkModule,
CardModule,
ListNavigationModule,
PromotionsModule,
Expand Down Expand Up @@ -42,6 +43,7 @@ const moduleComponents = [ReplenishmentOrderCancellationComponent];
SpinnerModule,
ListNavigationModule,
RouterModule,
BtnLikeLinkModule,
],
providers: [
provideDefaultConfig(defaultReplenishmentOrderCancellationLayoutConfig),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ <h3>
[routerLink]="{ cxRoute: 'home' } | cxUrl"
routerLinkActive="active"
class="btn btn-primary btn-block"
cxBtnLikeLink
>{{ 'orderHistory.startShopping' | cxTranslate }}</a
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
provideDefaultConfig,
UrlModule,
} from '@spartacus/core';
import { ListNavigationModule } from '@spartacus/storefront';
import { BtnLikeLinkModule, ListNavigationModule } from '@spartacus/storefront';
import { defaultReplenishmentOrderCancellationLayoutConfig } from '../replenishment-order-details/default-replenishment-order-cancellation-layout.config';
import { ReplenishmentOrderHistoryComponent } from './replenishment-order-history.component';

Expand All @@ -26,6 +26,7 @@ import { ReplenishmentOrderHistoryComponent } from './replenishment-order-histor
ListNavigationModule,
UrlModule,
I18nModule,
BtnLikeLinkModule,
FeaturesConfigModule,
],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
<div class="form-group row">
<div class="col-lg-4 col-md-12">
<a
role="button"
[routerLink]="{ cxRoute: 'orderApprovals' } | cxUrl"
class="btn btn-block btn-secondary"
cxBtnLikeLink
>{{ 'orderApprovalDetails.back' | cxTranslate }}</a
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ import {
OrderDetailsService,
OrderOverviewComponent,
} from '@spartacus/order/components';
import { FormErrorsModule, SpinnerModule } from '@spartacus/storefront';
import {
BtnLikeLinkModule,
FormErrorsModule,
SpinnerModule,
} from '@spartacus/storefront';
import { ApproverGuard } from '../../core/guards/approver.guard';
import { OrderApprovalDetailFormComponent } from './order-approval-detail-form/order-approval-detail-form.component';
import { OrderApprovalDetailService } from './order-approval-detail.service';
Expand All @@ -37,6 +41,7 @@ import { OrderDetailPermissionResultsComponent } from './order-detail-permission
FormErrorsModule,
SpinnerModule,
RouterModule,
BtnLikeLinkModule,
ConfigModule.withConfig(<CmsConfig>{
cmsComponents: {
OrderApprovalDetailTotalsComponent: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
[routerLink]="{ cxRoute: 'home' } | cxUrl"
routerLinkActive="active"
class="btn btn-primary btn-block"
cxBtnLikeLink
>{{ 'unitLevelOrderHistory.startShopping' | cxTranslate }}</a
>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
provideDefaultConfig,
UrlModule,
} from '@spartacus/core';
import { BtnLikeLinkModule, ListNavigationModule } from '@spartacus/storefront';
import { UnitLevelOrdersViewerGuard } from '@spartacus/organization/unit-order/core';
import { ListNavigationModule } from '@spartacus/storefront';
import { UnitLevelOrderHistoryFilterModule } from './filter/unit-level-order-history-filter.module';
import { UnitLevelOrderHistoryComponent } from './unit-level-order-history.component';

Expand All @@ -32,6 +32,7 @@ import { UnitLevelOrderHistoryComponent } from './unit-level-order-history.compo
UrlModule,
I18nModule,
UnitLevelOrderHistoryFilterModule,
BtnLikeLinkModule,
FeaturesConfigModule,
],
declarations: [UnitLevelOrderHistoryComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
}"
class="btn btn-primary btn-block"
cxAutoFocus
cxBtnLikeLink
[attr.aria-label]="
getAriaLabelTranslationKey(product.configuratorType) | cxTranslate
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
UrlModule,
} from '@spartacus/core';
import {
BtnLikeLinkModule,
IconModule,
OutletPosition,
ProductListOutlets,
Expand All @@ -37,6 +38,7 @@ import { ConfigureProductComponent } from './configure-product.component';
I18nModule,
IconModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [
provideOutlet({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from '@spartacus/core';
import { StoreFinderCoreModule } from '@spartacus/storefinder/core';
import {
BtnLikeLinkModule,
IconModule,
ListNavigationModule,
OutletModule,
Expand Down Expand Up @@ -47,6 +48,7 @@ import { StoreFinderComponent } from './store-finder/store-finder.component';
IconModule,
OutletModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [
provideDefaultConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
rel="noopener noreferrer"
*cxFeature="'!a11yStyleExternalLinksAsLinks'"
class="btn btn-sm btn-secondary btn-block cx-button"
cxBtnLikeLink
(click)="$event.stopPropagation()"
[attr.aria-label]="'storeFinder.ariaLabelGetDirections' | cxTranslate"
>{{ 'storeFinder.getDirections' | cxTranslate }}</a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<ng-container *cxFeature="'!a11yUseButtonsForBtnLinks'">
<ng-container *ngIf="!loginAsGuest">
<a
role="button"
[routerLink]="{ cxRoute: 'register' } | cxUrl"
class="btn btn-block btn-secondary btn-register"
cxBtnLikeLink
>{{ 'loginForm.register' | cxTranslate }}</a
>
</ng-container>

<ng-container *ngIf="loginAsGuest">
<a
role="button"
[routerLink]="{ cxRoute: 'checkoutLogin' } | cxUrl"
class="btn btn-block btn-secondary btn-guest"
cxBtnLikeLink
>{{ 'loginForm.guestCheckout' | cxTranslate }}</a
>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
provideDefaultConfig,
UrlModule,
} from '@spartacus/core';
import { PageSlotModule } from '@spartacus/storefront';
import { BtnLikeLinkModule, PageSlotModule } from '@spartacus/storefront';
import { LoginRegisterComponent } from './login-register.component';

@NgModule({
Expand All @@ -26,6 +26,7 @@ import { LoginRegisterComponent } from './login-register.component';
PageSlotModule,
I18nModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
UrlModule,
} from '@spartacus/core';
import {
BtnLikeLinkModule,
IconModule,
KeyboardFocusModule,
SpinnerModule,
Expand All @@ -34,6 +35,7 @@ import { CloseAccountComponent } from './components/close-account/close-account.
SpinnerModule,
KeyboardFocusModule,
FeaturesConfigModule,
BtnLikeLinkModule,
],
providers: [
provideDefaultConfig(<CmsConfig>{
Expand Down
Loading

0 comments on commit fc5e624

Please sign in to comment.