Browse Source
Fix feature toggle cascade when group display name differs from name
pull/26241/head
maliming
1 month ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
7 additions and
7 deletions
-
npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.html
-
npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
|
|
|
@ -18,7 +18,7 @@ |
|
|
|
ngTabList |
|
|
|
orientation="vertical" |
|
|
|
selectionMode="follow" |
|
|
|
[(selectedTab)]="selectedGroupDisplayName" |
|
|
|
[(selectedTab)]="selectedGroupName" |
|
|
|
class="nav nav-pills flex-column" |
|
|
|
> |
|
|
|
@for (group of groups(); track group.name) { |
|
|
|
@ -26,7 +26,7 @@ |
|
|
|
ngTab |
|
|
|
#tab="ngTab" |
|
|
|
type="button" |
|
|
|
[value]="group.displayName" |
|
|
|
[value]="group.name" |
|
|
|
class="nav-link text-start" |
|
|
|
[class.active]="tab.selected()" |
|
|
|
> |
|
|
|
@ -43,9 +43,9 @@ |
|
|
|
|
|
|
|
<div class="col-md-8"> |
|
|
|
@for (group of groups(); track group.name) { |
|
|
|
<div ngTabPanel [value]="group.displayName"> |
|
|
|
<div ngTabPanel [value]="group.name"> |
|
|
|
<ng-template ngTabContent> |
|
|
|
<h4>{{ selectedGroupDisplayName() }}</h4> |
|
|
|
<h4>{{ group.displayName }}</h4> |
|
|
|
<hr class="mt-2 mb-3" /> |
|
|
|
|
|
|
|
@for ( |
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ export class FeatureManagementComponent { |
|
|
|
// Internal state
|
|
|
|
protected readonly _visible = signal(false); |
|
|
|
|
|
|
|
protected readonly selectedGroupDisplayName = signal<string | undefined>(undefined); |
|
|
|
protected readonly selectedGroupName = signal<string | undefined>(undefined); |
|
|
|
|
|
|
|
protected readonly groups = signal<Pick<FeatureGroupDto, 'name' | 'displayName'>[]>([]); |
|
|
|
|
|
|
|
@ -147,7 +147,7 @@ export class FeatureManagementComponent { |
|
|
|
if (!res.groups?.length) return; |
|
|
|
const groups = res.groups.map(({ name, displayName }) => ({ name, displayName })); |
|
|
|
this.groups.set(groups); |
|
|
|
this.selectedGroupDisplayName.set(groups[0].displayName); |
|
|
|
this.selectedGroupName.set(groups[0].name); |
|
|
|
this.features.set( |
|
|
|
res.groups.reduce( |
|
|
|
(acc, val) => ({ |
|
|
|
@ -292,7 +292,7 @@ export class FeatureManagementComponent { |
|
|
|
} |
|
|
|
|
|
|
|
private getCurrentGroup() { |
|
|
|
const selectedGroup = this.selectedGroupDisplayName(); |
|
|
|
const selectedGroup = this.selectedGroupName(); |
|
|
|
return selectedGroup ? this.features()[selectedGroup] ?? [] : []; |
|
|
|
} |
|
|
|
|
|
|
|
|