-
-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update description on project deletion #7539
Merged
+50
−16
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,41 +36,55 @@ 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 ( | ||
<StyledContainer> | ||
<p> | ||
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' | ||
: ''} | ||
. | ||
</p> | ||
<ConditionallyRender | ||
condition={isEnterprise() && automatedActionsEnabled} | ||
condition={featureCount > 0 || actionsCount > 0} | ||
show={ | ||
<p> | ||
Additionally, all configured actions for this project | ||
will no longer be executed as they will be permanently | ||
deleted. | ||
</p> | ||
<> | ||
<p> | ||
Currently there are{' '} | ||
<strong>{featureCount} feature flags active</strong> | ||
</p> | ||
<ConditionallyRender | ||
condition={ | ||
isEnterprise() && automatedActionsEnabled | ||
} | ||
show={ | ||
<p> | ||
Currently there are{' '} | ||
<strong> | ||
{actionsCount} enabled actions | ||
</strong> | ||
</p> | ||
} | ||
/> | ||
</> | ||
} | ||
/> | ||
<p> | ||
Currently there are{' '} | ||
<strong>{featureCount} feature flags active</strong> | ||
Keep in mind that deleting a project{' '} | ||
<strong>will permanently remove</strong> | ||
<ul> | ||
<li>all archived feature flags in this project</li> | ||
<li>API keys configured to access only this project</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depending on how the API key deletion works, we might want to be a little more explicit (here or in the docs), but I don't have a clear suggestion for that yet. Let's see how the rest of this shakes out first. |
||
<ConditionallyRender | ||
condition={isEnterprise() && automatedActionsEnabled} | ||
show={<li>all actions configured for this project</li>} | ||
/> | ||
</ul> | ||
and they <strong>cannot be recovered</strong> once deleted. | ||
</p> | ||
<ConditionallyRender | ||
condition={isEnterprise() && automatedActionsEnabled} | ||
show={ | ||
<p> | ||
Currently there are{' '} | ||
<strong> | ||
{actions.filter(({ enabled }) => enabled).length}{' '} | ||
enabled actions | ||
</strong> | ||
</p> | ||
} | ||
/> | ||
<StyledButtonContainer> | ||
<PermissionButton | ||
permission={DELETE_PROJECT} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be a bit weird in some edge cases:
We would only show "0 feature flags active", which I'm not sure is the intended behavior. I don't think it matters much, but I would pick one of:
featureCount
andactionsCount
totals, show them even if they are 0. This means we simply remove theConditionallyRender
withfeatureCount > 0 || actionsCount > 0
.ConditionallyRender
wrapper around each paragraph where we check the individual count for each along with any other conditions:featureCount > 0
actionsCount > 0 && isEnterprise() && automatedActionsEnabled