-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[teams] inactivate Leave Team action for last team owner #6477
Conversation
@@ -46,6 +47,10 @@ export default function() { | |||
})(); | |||
}, [ team ]); | |||
|
|||
useEffect(() => { | |||
setLeaveTeamEnabled(members.length > 1); |
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.
Shouldn't it be filtered by team owners?
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.
absolutely! just updated
637d6e2
to
2064f9e
Compare
Doesn't work for me:
|
@JanKoehnlein, thanks for testing! Sorry, I just confused |
2064f9e
to
27830c7
Compare
customFontStyle: 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300', | ||
onClick: () => removeTeamMember(m.userId) | ||
title: leaveTeamEnabled ? 'Leave Team' : 'Remaining owner', | ||
customFontStyle: leaveTeamEnabled ? 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300' : 'text-gray-400 dark:text-gray-200', |
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.
customFontStyle: leaveTeamEnabled ? 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300' : 'text-gray-400 dark:text-gray-200', | |
customFontStyle: leaveTeamEnabled ? 'text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300' : 'text-gray-400 dark:text-gray-200 cursor-not-allowed', |
How about also adapting the cursor to show that there is no action? E.g. cursor-not-allowed
or cursor-default
.
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.
Given that the label is changed to Remaining owner
, I don't think it's necessary to change the cursor. Also, there is no other example in the dashboard to provide feedback using the "not-allowed" cursor.
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.
Would it make sense to have some server-side validation for this as well?
/werft run 👍 started the job as gitpod-build-at-last-owner-4623.3 |
/lgtm |
LGTM label has been added. Git tree hash: b4c1c8a0076591d28fb42b80cd49323b09f0c5a2
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JanKoehnlein Associated issue: #4623 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #4623