diff --git a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx index 15459ccfad5e..a163647c4a16 100644 --- a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx +++ b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx @@ -4,6 +4,10 @@ import { formatUnknownError } from 'utils/formatUnknownError'; import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi'; import useProjects from 'hooks/api/getters/useProjects/useProjects'; import useToast from 'hooks/useToast'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; +import { useUiFlag } from 'hooks/useUiFlag'; +import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; +import { Typography } from '@mui/material'; interface IDeleteProjectDialogueProps { project: string; @@ -21,6 +25,8 @@ export const DeleteProjectDialogue = ({ const { deleteProject } = useProjectApi(); const { refetch: refetchProjectOverview } = useProjects(); const { setToastData, setToastApiError } = useToast(); + const { isEnterprise } = useUiConfig(); + const automatedActionsEnabled = useUiFlag('automatedActions'); const onClick = async (e: React.SyntheticEvent) => { e.preventDefault(); @@ -45,6 +51,16 @@ export const DeleteProjectDialogue = ({ onClick={onClick} onClose={onClose} title='Really delete project' - /> + > + + This will irreversibly remove the project, all feature flags + archived in it, all API keys scoped to only this project + + . + + ); }; diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx index 9802c20a2a92..883523efb521 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx @@ -36,41 +36,59 @@ export const DeleteProject = ({ const automatedActionsEnabled = useUiFlag('automatedActions'); const { actions } = useActions(projectId); const [showDelDialog, setShowDelDialog] = useState(false); + const actionsCount = actions.filter(({ enabled }) => enabled).length; const navigate = useNavigate(); return (

Before you can delete a project, you must first archive all the - feature flags associated with it. Keep in mind that deleting a - project will permanently remove all the archived feature flags, - and they cannot be recovered once deleted. + feature flags associated with it + {isEnterprise() && automatedActionsEnabled + ? 'and disable all actions that are in it' + : ''} + .

0} show={

- Additionally, all configured actions for this project - will no longer be executed as they will be permanently - deleted. + Currently there {featureCount <= 1 ? 'is' : 'are'}{' '} + + {featureCount} active feature{' '} + {featureCount === 1 ? 'flag' : 'flags'}. +

} /> -

- Currently there are{' '} - {featureCount} feature flags active -

0 + } show={

- Currently there are{' '} + Currently there {actionsCount <= 1 ? 'is' : 'are'}{' '} - {actions.filter(({ enabled }) => enabled).length}{' '} - enabled actions + {actionsCount} enabled{' '} + {actionsCount === 1 ? 'action' : 'actions'}.

} /> +

+ Keep in mind that deleting a project{' '} + will permanently remove +

    +
  • all archived feature flags in this project
  • +
  • API keys configured to access only this project
  • + all actions configured for this project} + /> +
+ and they cannot be recovered once deleted. +