From eaab9db60d4194b242acc799156ffb4ddc3849ea Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Mon, 28 Oct 2024 15:39:20 +0200 Subject: [PATCH] fix: now feature table does not dissapear (#8554) Feature table does not dissapear when onboarding and filter settings hides all features --- .../ProjectFeatureToggles.test.tsx | 6 ++---- .../ProjectFeatureToggles.tsx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.test.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.test.tsx index 9a9867e70d9e..c74f7b02a031 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.test.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.test.tsx @@ -82,8 +82,7 @@ test('selects project features', async () => { expect(screen.queryByTestId(BATCH_SELECTED_COUNT)).not.toBeInTheDocument(); }); -// TODO: stopped working after react v18 upgrade -test.skip('filters by tag', async () => { +test('filters by tag', async () => { setupApi(); render( @@ -134,8 +133,7 @@ test('filters by flag type', async () => { await screen.findByText('Operational'); }); -// TODO: stopped working after react v18 upgrade -test.skip('filters by flag author', async () => { +test('filters by flag author', async () => { setupApi(); render( diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx index cfdf04472a3c..c4320494118d 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureToggles.tsx @@ -134,8 +134,8 @@ export const ProjectFeatureToggles = ({ onboardingUIEnabled && project.onboardingStatus.status !== 'onboarded' && onboardingFlow === 'visible'; - const showFeaturesTable = - (total !== undefined && total > 0) || notOnboarding; + const noFeaturesExistInProject = project.featureTypeCounts?.length === 0; + const showFeaturesTable = !noFeaturesExistInProject || notOnboarding; const trackOnboardingFinish = (sdkName: string) => { if (!isOnboarding) {