From 711f4954c10e4437d34bc04d12934f494854887b Mon Sep 17 00:00:00 2001
From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
Date: Wed, 3 Jul 2024 18:19:57 +0200
Subject: [PATCH 1/3] feat: update description on project deletion
---
.../DeleteProject/DeleteProjectDialogue.tsx | 15 ++++-
.../Settings/DeleteProject.tsx | 62 +++++++++++--------
2 files changed, 50 insertions(+), 27 deletions(-)
diff --git a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx
index 15459ccfad5e..adfc8516d149 100644
--- a/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx
+++ b/frontend/src/component/project/Project/DeleteProject/DeleteProjectDialogue.tsx
@@ -4,6 +4,9 @@ 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';
interface IDeleteProjectDialogueProps {
project: string;
@@ -21,6 +24,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 +50,14 @@ 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
+
- 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.
-
- Additionally, all configured actions for this project
- will no longer be executed as they will be permanently
- deleted.
-
+ Before you can delete a project, you must first
+ archive all the feature flags associated with it.
+
+ Currently there are{' '}
+ {featureCount} feature flags active
+
- Currently there are{' '} - {featureCount} feature flags active + Keep in mind that deleting a project{' '} + will permanently remove +
+ Before you can delete a project, you must first archive all the + feature flags associated with it + {isEnterprise() && automatedActionsEnabled + ? 'and disable all actions that are in it' + : ''} + . +
- Before you can delete a project, you must first - archive all the feature flags associated with it. -
Currently there are{' '} {featureCount} feature flags active From 5f904e18db1e3b3e2da01c0aa22f328ff93fac8e Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:31:51 +0200 Subject: [PATCH 3/3] reword delete project active items section --- .../Settings/DeleteProject.tsx | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx index efa02b84aefe..883523efb521 100644 --- a/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/Settings/DeleteProject.tsx @@ -49,27 +49,31 @@ export const DeleteProject = ({ .
- Currently there are{' '} - {featureCount} feature flags active -
-+ Currently there {featureCount <= 1 ? 'is' : 'are'}{' '} + + {featureCount} active feature{' '} + {featureCount === 1 ? 'flag' : 'flags'}. + +
+ } + /> ++ Currently there {actionsCount <= 1 ? 'is' : 'are'}{' '} + + {actionsCount} enabled{' '} + {actionsCount === 1 ? 'action' : 'actions'}. + +
} />