diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx index fff4372c8a..745d552200 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListTable.tsx @@ -59,6 +59,7 @@ const { value: storedParams, setValue: setStoredParams } = createLocalStorage( export const FeatureToggleListTable: VFC = () => { const theme = useTheme(); const { environments } = useEnvironments(); + const enabledEnvironment = environments.filter(env => env.enabled); const isSmallScreen = useMediaQuery(theme.breakpoints.down('md')); const isMediumScreen = useMediaQuery(theme.breakpoints.down('lg')); const [showExportDialog, setShowExportDialog] = useState(false); @@ -386,7 +387,7 @@ export const FeatureToggleListTable: VFC = () => { showExportDialog={showExportDialog} data={data} onClose={() => setShowExportDialog(false)} - environments={environments} + environments={enabledEnvironment} /> } /> diff --git a/frontend/src/component/project/Project/Import/configure/ImportOptions.tsx b/frontend/src/component/project/Project/Import/configure/ImportOptions.tsx index 0a73810a4f..4b50879333 100644 --- a/frontend/src/component/project/Project/Import/configure/ImportOptions.tsx +++ b/frontend/src/component/project/Project/Import/configure/ImportOptions.tsx @@ -1,9 +1,9 @@ import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect'; import { KeyboardArrowDownOutlined } from '@mui/icons-material'; import React, { FC, useEffect } from 'react'; -import { useProjectEnvironments } from 'hooks/api/getters/useProjectEnvironments/useProjectEnvironments'; import { Box, styled, Typography } from '@mui/material'; import { IMPORT_ENVIRONMENT } from 'utils/testIds'; +import useProject from 'hooks/api/getters/useProject/useProject'; const ImportOptionsContainer = styled(Box)(({ theme }) => ({ backgroundColor: theme.palette.secondaryContainer, @@ -31,14 +31,12 @@ export const ImportOptions: FC = ({ environment, onChange, }) => { - const { environments } = useProjectEnvironments(project); - const environmentOptions = environments - .filter(environment => environment.enabled) - .map(environment => ({ - key: environment.name, - label: environment.name, - title: environment.name, - })); + const { project: projectInfo } = useProject(project); + const environmentOptions = projectInfo.environments.map(environment => ({ + key: environment, + label: environment, + title: environment, + })); useEffect(() => { if (environment === '' && environmentOptions[0]) {