diff --git a/core-libs/assets/src/translations/en/myAccount.json b/core-libs/assets/src/translations/en/myAccount.json
index f370006eed1..cb8efdfc4d2 100644
--- a/core-libs/assets/src/translations/en/myAccount.json
+++ b/core-libs/assets/src/translations/en/myAccount.json
@@ -24,7 +24,8 @@
},
"bothPasswordMustMatch": "Both password must match",
"passwordUpdateSuccess": "Password updated with success",
- "accessDeniedError": "Access is denied"
+ "accessDeniedError": "Access is denied",
+ "heading": "Update Password"
},
"updateProfileForm": {
"title": "Title",
@@ -40,11 +41,13 @@
},
"lastNameIsRequired": "Last name is required.",
"profileUpdateSuccess": "Personal details successfully updated",
- "customerId": "Customer #"
+ "customerId": "Customer #",
+ "heading": "Update Personal Details"
},
"consentManagementForm": {
"clearAll": "Clear all",
"selectAll": "Select all",
+ "heading": "Privacy Consent Management",
"message": {
"success": {
"given": "Consent successfully given.",
diff --git a/core-libs/core/src/features-config/feature-toggles/config/feature-toggles.ts b/core-libs/core/src/features-config/feature-toggles/config/feature-toggles.ts
index 21426f8f028..122ad390443 100644
--- a/core-libs/core/src/features-config/feature-toggles/config/feature-toggles.ts
+++ b/core-libs/core/src/features-config/feature-toggles/config/feature-toggles.ts
@@ -395,6 +395,17 @@ export interface FeatureTogglesInterface {
*/
a11yDeliveryModeFocusPreservation?: boolean;
+ /**
+ * When enabled, wraps form controls in a `
diff --git a/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.spec.ts b/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.spec.ts
index 0fa072fb523..b61db4f1a0d 100644
--- a/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.spec.ts
+++ b/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.spec.ts
@@ -12,7 +12,11 @@ import {
} from '@angular/forms';
import { By } from '@angular/platform-browser';
import { NgSelectModule } from '@ng-select/ng-select';
-import { FeaturesConfigModule, I18nTestingModule } from '@spartacus/core';
+import {
+ FeaturesConfig,
+ FeaturesConfigModule,
+ I18nTestingModule,
+} from '@spartacus/core';
import { FormErrorsModule } from '@spartacus/storefront';
import { UrlTestingModule } from 'core-libs/core/src/routing/configurable-routes/url-translation/testing/url-testing.module';
import { BehaviorSubject, Subject, of } from 'rxjs';
@@ -75,6 +79,12 @@ describe('MyAccountV2ProfileComponent', () => {
provide: UpdateProfileComponentService,
useClass: MockProfileService,
},
+ {
+ provide: FeaturesConfig,
+ useValue: {
+ features: { level: '7.0', a11yFormFieldSectionLegend: true },
+ },
+ },
],
})
.overrideComponent(MyAccountV2ProfileComponent, {
@@ -162,4 +172,14 @@ describe('MyAccountV2ProfileComponent', () => {
expect(submitBtn).toBeNull();
});
});
+
+ describe('Accessibility', () => {
+ it('should render a fieldset with a visually-hidden legend inside the form when editing', () => {
+ component.onEdit();
+ fixture.detectChanges();
+ const legend = el.query(By.css('fieldset legend'));
+ expect(legend).toBeTruthy();
+ expect(legend.nativeElement.classList).toContain('cx-visually-hidden');
+ });
+ });
});
diff --git a/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.ts b/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.ts
index d28ec4912ed..94a8f0a8fa0 100644
--- a/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.ts
+++ b/feature-libs/user/profile/components/update-profile/my-account-v2-profile.component.ts
@@ -17,7 +17,7 @@ import {
UntypedFormGroup,
} from '@angular/forms';
import { NgOptionComponent, NgSelectComponent } from '@ng-select/ng-select';
-import { TranslatePipe } from '@spartacus/core';
+import { FeatureDirective, TranslatePipe } from '@spartacus/core';
import {
FormErrorsComponent,
NgSelectA11yDirective,
@@ -45,6 +45,7 @@ import { UpdateProfileComponentService } from './update-profile-component.servic
FormErrorsComponent,
AsyncPipe,
TranslatePipe,
+ FeatureDirective,
TruncationTooltipDirective,
],
})
diff --git a/feature-libs/user/profile/components/update-profile/update-profile.component.html b/feature-libs/user/profile/components/update-profile/update-profile.component.html
index 89d847f60ab..27aea06952b 100644
--- a/feature-libs/user/profile/components/update-profile/update-profile.component.html
+++ b/feature-libs/user/profile/components/update-profile/update-profile.component.html
@@ -1,119 +1,249 @@
diff --git a/feature-libs/user/profile/components/update-profile/update-profile.component.spec.ts b/feature-libs/user/profile/components/update-profile/update-profile.component.spec.ts
index 5d41fdc871e..be8b80df937 100644
--- a/feature-libs/user/profile/components/update-profile/update-profile.component.spec.ts
+++ b/feature-libs/user/profile/components/update-profile/update-profile.component.spec.ts
@@ -86,7 +86,7 @@ describe('UpdateProfileComponent', () => {
{
provide: FeaturesConfig,
useValue: {
- features: { level: '5.2' },
+ features: { level: '5.2', a11yFormFieldSectionLegend: true },
},
},
{ provide: RoutingService, useClass: MockRoutingService },
@@ -175,4 +175,12 @@ describe('UpdateProfileComponent', () => {
expect(routingService.go).toHaveBeenCalledWith({ cxRoute: 'home' });
});
});
+
+ describe('Accessibility', () => {
+ it('should render a fieldset with a visually-hidden legend inside the form', () => {
+ const legend = el.query(By.css('fieldset legend'));
+ expect(legend).toBeTruthy();
+ expect(legend.nativeElement.classList).toContain('cx-visually-hidden');
+ });
+ });
});
diff --git a/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts b/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts
index 7504b05c3e8..482911c1440 100644
--- a/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts
+++ b/projects/storefrontapp/src/app/spartacus/spartacus-features.module.ts
@@ -343,6 +343,7 @@ if (environment.cpq) {
a11yCartQuickOrderFormEnableSubmitAndAddValidation: true,
a11yConsentManagementFocusPreservation: true,
a11yDeliveryModeFocusPreservation: true,
+ a11yFormFieldSectionLegend: true,
a11yVocalizeDropdownItemCount: true,
a11yRestoreFocusOnNgSelect: true,
a11yKeepFocusOnConsentManagementButtons: true,