-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a remove project button on the project settings page #15316
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
Conversation
started the job as gitpod-build-bmh-delete-project-settings.2 because the annotations in the pull request description changed |
@@ -107,3 +107,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => { | |||
}; | |||
|
|||
export { FeatureFlagContext, FeatureFlagContextProvider }; | |||
|
|||
export const useFeatureFlags = () => { |
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.
Makes it just a bit simpler to access feature flags from a component.
@@ -61,33 +65,52 @@ export default function () { | |||
} | |||
}, [team]); | |||
|
|||
if (!project) return null; | |||
const updateProjectSettings = useCallback( |
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.
Wrapped each of these functions with useCallback()
to avoid creating new references for each render. The guts of each function shouldn't have changed at all.
}, [history, team]); | ||
|
||
// TODO: Render a generic error screen for when an entity isn't found | ||
if (!project) return null; |
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.
This should live after all hooks, so bumped it down since I added a few useCallback() wrappers on the fns that weren't there before.
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.
Thank you! TIL about useCallback
🙈
I wonder what the implications of removing a project are. We have other resources that reference projects such as workspaces and prebuilds. One could argue that those are even owned by a project, but deleting all this together with a project would seem like a quite impactful operation. So we probably don't want to do that, but then we should indicate to users when a workspace references a deleted project.
Also, do we need to make sure that prebuilds created for the removed project are no longer used when starting new workspaces?
/hold
The change, as presented in this PR only improves the UI aspect of project deletion. As such, the above feels not directly relevant to this change. Were you referring to also deleting stored (cached/state) resources which relate to the project? Or were you referring to the workflow on what happens when you delete a project on the server-side? |
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.
Nice! Really like the cleanup you're doing alongside the improvements themselves. For me, this change does exactly what it should, and what was specified in the original issue.
LGTM
Feel free to land, if you feel the conversations have been resolved.
Indeed 🙏 I had somehow the impression it would introduce the removal of projects. /unhold |
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.
Hey @selfcontained!
Coming a bit late here but UX LGTM. 🏁
- Left some minor non-blocking comments below.
- Also, closed Delete projects from project settings #14251 in favor of Move project removal action under project settings #7273 which also contains some design specs that could be helpful here, see Move project removal action under project settings #7273 (comment).
@@ -237,6 +260,22 @@ export default function () { | |||
</Alert> | |||
)} | |||
</div> | |||
<div> | |||
<h3 className="mt-12">Delete Project</h3> |
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.
suggestion: What do you think of using a different verb here to avoid causing any confusion whether this is also going to delete a project or repository on the provider?
<h3 className="mt-12">Delete Project</h3> | |
<h3 className="mt-12">Remove Project</h3> |
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 like it. I’ll include this change in a follow up pr
return ( | ||
<ConfirmationModal | ||
title="Remove Project" | ||
areYouSureText="Are you sure you want to remove this project from this team? Team members will also lose access to this project." |
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.
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.
Got it, I'll update the confirmation modal in the follow up too.
Description
Adds a "Remove Project" button on the project settings page.
Clicking the button brings up the same modal that is shown from the Projects list page when using the context menu action for removing.

Followup
To help keep this PR small I'll open a followup one that updates the Projects list page use the new
<RemoveProjectModal/>
component, along with a few other improvements for that page.Related Issue(s)
Fixes #14251
How to test
Preivew Env: https://bmh-deleted93c550a0b.preview.gitpod-dev.com/
Remove Project
buttonRelease Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh