From e34c9bc0bf9ef65dd48a5fe2e8054bb04109b891 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Mon, 22 May 2023 13:31:31 +0200 Subject: [PATCH] feat: disable bulk toggles flag (#3827) --- .../ProjectFeaturesBatchActions.tsx | 43 +++++++++++++------ frontend/src/interfaces/uiConfig.ts | 1 + .../admin-api/project/project-features.ts | 14 +++++- src/lib/types/experimental.ts | 3 +- .../__snapshots__/openapi.e2e.test.ts.snap | 4 +- 5 files changed, 46 insertions(+), 19 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.tsx b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.tsx index f752fb7096..f8386e18dd 100644 --- a/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.tsx +++ b/frontend/src/component/project/Project/ProjectFeatureToggles/ProjectFeaturesBatchActions/ProjectFeaturesBatchActions.tsx @@ -8,6 +8,8 @@ import { ManageTags } from './ManageTags'; import { usePlausibleTracker } from 'hooks/usePlausibleTracker'; import { BulkDisableDialog } from 'component/feature/FeatureToggleList/BulkDisableDialog'; import { BulkEnableDialog } from 'component/feature/FeatureToggleList/BulkEnableDialog'; +import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; interface IProjectFeaturesBatchActionsProps { selectedIds: string[]; @@ -18,6 +20,7 @@ interface IProjectFeaturesBatchActionsProps { export const ProjectFeaturesBatchActions: FC< IProjectFeaturesBatchActionsProps > = ({ selectedIds, data, projectId }) => { + const { uiConfig } = useUiConfig(); const [showExportDialog, setShowExportDialog] = useState(false); const [showBulkEnableDialog, setShowBulkEnableDialog] = useState(false); const [showBulkDisableDialog, setShowBulkDisableDialog] = useState(false); @@ -59,20 +62,32 @@ export const ProjectFeaturesBatchActions: FC< return ( <> - - + setShowBulkEnableDialog(true)} + > + Enable + + } + /> + setShowBulkDisableDialog(true)} + > + Disable + + } + />