-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Refactor setting management to use @angular/aria tabs - issue-24565 #24623
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,41 +2,29 @@ | |||||||||||||
| <div id="SettingManagementWrapper"> | ||||||||||||||
| <div class="card"> | ||||||||||||||
| <div class="card-body"> | ||||||||||||||
| <div class="row"> | ||||||||||||||
| <div class="row" ngTabs> | ||||||||||||||
| <div class="col-12 col-md-3 mb-2 mb-md-0"> | ||||||||||||||
| <ul class="nav flex-column nav-pills" id="nav-tab" role="tablist"> | ||||||||||||||
| <div class="nav flex-column nav-pills" id="nav-tab" ngTabList orientation="vertical" | ||||||||||||||
| [selectedTab]="selected?.name"> | ||||||||||||||
| <ng-container *abpFor="let setting of settings; trackBy: trackByFn"> | ||||||||||||||
| <li | ||||||||||||||
| (click)="selected = setting" | ||||||||||||||
| class="nav-item pointer" | ||||||||||||||
| *abpPermission="setting.requiredPolicy" | ||||||||||||||
| > | ||||||||||||||
| <a | ||||||||||||||
| class="nav-link" | ||||||||||||||
| [id]="setting.name + '-tab'" | ||||||||||||||
| role="tab" | ||||||||||||||
| [class.active]="setting.name === selected.name" | ||||||||||||||
| >{{ setting.name | abpLocalization }}</a | ||||||||||||||
| > | ||||||||||||||
| </li> | ||||||||||||||
| <button ngTab #tab="ngTab" [value]="setting.name" (click)="selected = setting" | ||||||||||||||
| class="nav-link text-start" [class.active]="tab.selected()" *abpPermission="setting.requiredPolicy"> | ||||||||||||||
| {{ setting.name | abpLocalization }} | ||||||||||||||
| </button> | ||||||||||||||
| </ng-container> | ||||||||||||||
| </ul> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| <div class="col-12 col-md-9"> | ||||||||||||||
| @if (settings.length) { | ||||||||||||||
| <div class="tab-content pt-0"> | ||||||||||||||
| <div | ||||||||||||||
| class="tab-pane fade show active" | ||||||||||||||
| [id]="selected.name + '-tab'" | ||||||||||||||
| role="tabpanel" | ||||||||||||||
| > | ||||||||||||||
| <ng-container *ngComponentOutlet="selected.component" /> | ||||||||||||||
| </div> | ||||||||||||||
| <ng-container *abpFor="let setting of settings; trackBy: trackByFn"> | ||||||||||||||
| <div ngTabPanel [value]="setting.name" class="tab-pane" *abpPermission="setting.requiredPolicy"> | ||||||||||||||
| <ng-container *ngComponentOutlet="setting.component" /> | ||||||||||||||
|
Comment on lines
+20
to
+21
|
||||||||||||||
| <div ngTabPanel [value]="setting.name" class="tab-pane" *abpPermission="setting.requiredPolicy"> | |
| <ng-container *ngComponentOutlet="setting.component" /> | |
| <div ngTabPanel [value]="setting.name" class="tab-pane" *abpPermission="setting.requiredPolicy"> | |
| @if (selected?.name === setting.name) { | |
| <ng-container *ngComponentOutlet="setting.component" /> | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
(click)="selected = setting"handler may be redundant since @angular/aria's Tab component should manage tab selection internally via the[selectedTab]="selected?.name"binding on the TabList. If the @angular/aria tabs properly sync with theselectedTabinput, the manual click handler may cause unnecessary state updates. Consider removing the click handler and letting @angular/aria manage the selection state, or if manual tracking is needed, consider using a change event from the @angular/aria tabs instead.