From 6b68a81e88982b5b150e27428f9de96dca388d46 Mon Sep 17 00:00:00 2001 From: Yagnik Date: Wed, 18 Sep 2024 14:15:55 +0530 Subject: [PATCH 1/2] feature flag root table sorting functionality issue fixed --- .../feature-flag-root-section-card-table.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts b/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts index fb79a9c9ec..1e2bfc661c 100644 --- a/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts +++ b/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts @@ -47,6 +47,14 @@ export class FeatureFlagRootSectionCardTableComponent implements OnInit { constructor(private featureFlagsService: FeatureFlagsService) {} ngOnInit() { + this.sortTable(); + } + + ngOnChanges() { + this.sortTable(); + } + + private sortTable() { if (this.dataSource$?.data) { this.dataSource$.sort = this.sort; } From 339a7abccf36da85ed93c1bf23843eb4e8318d3d Mon Sep 17 00:00:00 2001 From: Yagnik Date: Wed, 18 Sep 2024 17:27:24 +0530 Subject: [PATCH 2/2] resolved the review comments --- .../feature-flag-root-section-card-table.component.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts b/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts index 1e2bfc661c..0e898ee4b4 100644 --- a/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts +++ b/frontend/projects/upgrade/src/app/features/dashboard/feature-flags/pages/feature-flag-root-page/feature-flag-root-page-content/feature-flag-root-section-card/feature-flag-root-section-card-table/feature-flag-root-section-card-table.component.ts @@ -56,6 +56,8 @@ export class FeatureFlagRootSectionCardTableComponent implements OnInit { private sortTable() { if (this.dataSource$?.data) { + this.dataSource$.sortingDataAccessor = (item, property) => + property === 'name' ? item.name.toLowerCase() : item[property]; this.dataSource$.sort = this.sort; } }