From 0bbad6bf3398074adcf3a921b12219f9530f2347 Mon Sep 17 00:00:00 2001 From: Gitar Date: Thu, 15 Aug 2024 10:41:23 +0000 Subject: [PATCH] [Gitar] Updating TSX files --- .../ApplicationIssues/ApplicationIssues.tsx | 27 ++------- .../ProjectFeatureTogglesHeader.tsx | 56 ++++++------------- 2 files changed, 24 insertions(+), 59 deletions(-) diff --git a/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx b/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx index 8d747a0b7d7d..99313c69df40 100644 --- a/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx +++ b/frontend/src/component/application/ApplicationIssues/ApplicationIssues.tsx @@ -9,7 +9,6 @@ import { } from 'component/providers/AccessProvider/permissions'; import { useContext } from 'react'; import AccessContext from 'contexts/AccessContext'; -import { useUiFlag } from 'hooks/useUiFlag'; const WarningContainer = styled(Box)(({ theme }) => ({ display: 'flex', @@ -109,7 +108,6 @@ type ApplicationIssues = const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { const { hasAccess } = useContext(AccessContext); - const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow'); const length = features.length; if (length === 0) { @@ -130,25 +128,12 @@ const FeaturesMissing = ({ features }: IFeaturesMissingProps) => { - Create feature flag - - } - elseShow={ - - Create feature flag - - } - /> + + Create feature flag + } /> diff --git a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx index 0f018024b32f..edc7b28b161e 100644 --- a/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx +++ b/frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFeatureTogglesHeader/ProjectFeatureTogglesHeader.tsx @@ -16,9 +16,8 @@ import Add from '@mui/icons-material/Add'; import FileDownload from '@mui/icons-material/FileDownload'; import { styled } from '@mui/material'; import ResponsiveButton from 'component/common/ResponsiveButton/ResponsiveButton'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useSearchParams } from 'react-router-dom'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; -import { getCreateTogglePath } from 'utils/routePathHelpers'; import { CREATE_FEATURE } from 'component/providers/AccessProvider/permissions'; import { ExportDialog } from 'component/feature/FeatureToggleList/ExportDialog'; import type { FeatureSchema } from 'openapi'; @@ -48,44 +47,25 @@ const FlagCreationButton: FC = () => { const showCreateDialog = Boolean(searchParams.get('create')); const [openCreateDialog, setOpenCreateDialog] = useState(showCreateDialog); const { loading } = useUiConfig(); - const navigate = useNavigate(); - const improveCreateFlagFlow = useUiFlag('improveCreateFlagFlow'); return ( - - setOpenCreateDialog(true)} - maxWidth='960px' - Icon={Add} - projectId={projectId} - disabled={loading} - permission={CREATE_FEATURE} - data-testid='NAVIGATE_TO_CREATE_FEATURE' - > - New feature flag - - setOpenCreateDialog(false)} - /> - - } - elseShow={ - navigate(getCreateTogglePath(projectId))} - maxWidth='960px' - Icon={Add} - projectId={projectId} - permission={CREATE_FEATURE} - data-testid='NAVIGATE_TO_CREATE_FEATURE' - > - New feature flag - - } - /> + <> + setOpenCreateDialog(true)} + maxWidth='960px' + Icon={Add} + projectId={projectId} + disabled={loading} + permission={CREATE_FEATURE} + data-testid='NAVIGATE_TO_CREATE_FEATURE' + > + New feature flag + + setOpenCreateDialog(false)} + /> + ); };