Angular Aria Implementation for ABP Packages - Issue 24684#24689
Angular Aria Implementation for ABP Packages - Issue 24684#24689oykuermann merged 9 commits intodevfrom
Conversation
Replaces ng-bootstrap nav components with @angular/aria tab components in the feature management UI for improved accessibility and alignment with Angular's latest standards. Updates dependencies and imports accordingly, and adds @angular/aria as a peer dependency.
Migrates the users component from ng-bootstrap's NgbNav to @angular/aria tab components for tab navigation. Updates the HTML structure and imports, adds a selectedTab property for tab state, and ensures the tab resets when opening the modal. Also updates peerDependencies for @angular/aria in package.json files.
Refactored the permission management component to use @angular/aria tab components for group navigation, improving accessibility and structure. Updated the template and styles to support ngTabs, TabList, Tab, TabPanel, and TabContent. Added @angular/aria as a peer dependency in package.json.
Changed @angular/aria dependency from a range to a fixed version (21.0.0) in both root and setting-management package.json files for consistency and compatibility.
Changed the @angular/aria dependency from a tilde range to an exact version (21.0.0) in all Angular template package.json files for consistency and to avoid unexpected minor updates.
There was a problem hiding this comment.
Pull request overview
This PR implements Angular Aria directives across multiple ABP Angular packages to improve accessibility by replacing ng-bootstrap navigation components with Angular Aria tabs. The changes affect feature-management, identity, permission-management, and setting-management packages.
Changes:
- Added
@angular/ariaas a peer dependency to four packages - Replaced ng-bootstrap
ngbNavcomponents with Angular AriangTabsin feature-management, identity, and permission-management - Updated CSS selectors to match the new div-based tab structure instead of ul/li elements
- Implemented keyboard navigation support through
selectionMode="follow"
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| npm/ng-packs/packages/setting-management/package.json | Added @angular/aria peer dependency with exact version |
| npm/ng-packs/packages/permission-management/package.json | Added @angular/aria peer dependency |
| npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts | Imported Angular Aria tab components, updated CSS selectors from ul to .nav-pills, added onTabChange method |
| npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.html | Refactored from ngbNav to ngTabs with vertical orientation, duplicated tab panel content for each group |
| npm/ng-packs/packages/identity/package.json | Added @angular/aria peer dependency |
| npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts | Imported Angular Aria tab components, added selectedTab property, initialized to '0' in openModal |
| npm/ng-packs/packages/identity/src/lib/components/users/users.component.html | Replaced ngbNav with ngTabs using string-based tab values |
| npm/ng-packs/packages/feature-management/package.json | Added @angular/aria peer dependency |
| npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts | Imported Angular Aria tab components and NgStyle |
| npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.html | Replaced ngbNav with ngTabs vertical layout, moved template positioning, duplicated tab panels for each group |
| npm/ng-packs/package.json | Changed @angular/aria from ~21.0.0 to exact 21.0.0 version |
| id="select-all-in-this-tabs" | ||
| name="select-all-in-this-tabs" | ||
| class="form-check-input" | ||
| [(ngModel)]="selectThisTab" | ||
| [disabled]="disableSelectAllTab" | ||
| (click)="onClickSelectThisTab()" | ||
| /> | ||
| <label class="form-check-label" for="select-all-in-this-tabs">{{ | ||
| 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization | ||
| }}</label> |
There was a problem hiding this comment.
The id attribute "select-all-in-this-tabs" is now used multiple times within the @for loop (once per tab panel). HTML id attributes must be unique within the document. Consider using a dynamic id like "select-all-in-tab-{{group.name}}" and update the corresponding label's for attribute to match.
| id="select-all-in-this-tabs" | |
| name="select-all-in-this-tabs" | |
| class="form-check-input" | |
| [(ngModel)]="selectThisTab" | |
| [disabled]="disableSelectAllTab" | |
| (click)="onClickSelectThisTab()" | |
| /> | |
| <label class="form-check-label" for="select-all-in-this-tabs">{{ | |
| 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization | |
| }}</label> | |
| [attr.id]="'select-all-in-tab-' + group.name" | |
| name="select-all-in-this-tabs" | |
| class="form-check-input" | |
| [(ngModel)]="selectThisTab" | |
| [disabled]="disableSelectAllTab" | |
| (click)="onClickSelectThisTab()" | |
| /> | |
| <label | |
| class="form-check-label" | |
| [attr.for]="'select-all-in-tab-' + group.name" | |
| >{{ | |
| 'AbpPermissionManagement::SelectAllInThisTab' | abpLocalization | |
| }}</label | |
| > |
...packs/packages/permission-management/src/lib/components/permission-management.component.html
Show resolved
Hide resolved
...g-packs/packages/permission-management/src/lib/components/permission-management.component.ts
Show resolved
Hide resolved
| <div class="col-md-4"> | ||
| <div ngTabList orientation="vertical" selectionMode="follow" [(selectedTab)]="selectedGroupDisplayName" class="nav nav-pills flex-column"> | ||
| @for (group of groups; track group.name) { | ||
| <button ngTab #tab="ngTab" [value]="group.displayName" class="nav-link text-start" [class.active]="tab.selected()"> |
There was a problem hiding this comment.
The button element with ngTab directive should include an explicit type="button" attribute to prevent it from being treated as a submit button within a form context. While this is shown in line 66, verify that all tab buttons consistently specify type="button".
| <button ngTab #tab="ngTab" [value]="group.displayName" class="nav-link text-start" [class.active]="tab.selected()"> | |
| <button ngTab #tab="ngTab" type="button" [value]="group.displayName" class="nav-link text-start" [class.active]="tab.selected()"> |
npm/ng-packs/packages/identity/src/lib/components/users/users.component.html
Outdated
Show resolved
Hide resolved
Updated all occurrences of the @angular/aria dependency from an exact version (21.0.0) to a compatible version (~21.0.0) in package.json files across npm packages and Angular templates. This allows for patch updates and improves compatibility with future releases.
Changed tab values in UsersComponent from numeric ('0', '1') to descriptive string identifiers ('user-info', 'roles') for improved readability and maintainability.
Set type="button" on group tab buttons to ensure correct behavior and prevent unintended form submissions.
Resolves #24684 (write the related issue number if available)
Angular Aria Implementation for ABP Packages
This PR introduces Angular Aria directives to improve accessibility across several ABP Angular packages.
Packages Affected
1.
@abp/ng.feature-managementfeature-management.component.htmlto use Angular AriangTabs(Vertical).ngbNavwithngTabsstructure.selectionMode="follow"for better keyboard navigation.2.
@abp/ng.identityngTabs.'0','1') compatible with Angular Aria.3.
@abp/ng.permission-managementnav-pillswith Angular AriangTabs(Vertical).onTabChangemethod to bridge the gap between string-based tab selection and object-based Permission Group state.4.
@abp/ng.setting-managementngTabs.Technical Details
@angular/ariaas apeerDependencyto relevant packages (identity,permission-management,theme-basic,setting-management).How to test it?
you have to change branch issue-24684 on abp
you have to run dev-app and test it.
note : you have to remove symlinks files.