mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 22:28:47 +00:00
Merge pull request #3481 from Infisical/fix/AddDeleteProjectProtectedTooltip
fix(delete-project): Add tooltip for delete project button when it has protection enabled
This commit is contained in:
+7
-1
@@ -3,7 +3,7 @@ import { useNavigate } from "@tanstack/react-router";
|
|||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal, Tooltip } from "@app/components/v2";
|
||||||
import { LeaveProjectModal } from "@app/components/v2/LeaveProjectModal";
|
import { LeaveProjectModal } from "@app/components/v2/LeaveProjectModal";
|
||||||
import {
|
import {
|
||||||
ProjectPermissionActions,
|
ProjectPermissionActions,
|
||||||
@@ -142,6 +142,11 @@ export const DeleteProjectSection = () => {
|
|||||||
<div className="space-x-4">
|
<div className="space-x-4">
|
||||||
<ProjectPermissionCan I={ProjectPermissionActions.Delete} a={ProjectPermissionSub.Project}>
|
<ProjectPermissionCan I={ProjectPermissionActions.Delete} a={ProjectPermissionSub.Project}>
|
||||||
{(isAllowed) => (
|
{(isAllowed) => (
|
||||||
|
<Tooltip
|
||||||
|
className="max-w-sm"
|
||||||
|
content="This project is protected from deletion. To delete it, disable delete protection first."
|
||||||
|
isDisabled={!currentWorkspace?.hasDeleteProtection}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
isLoading={isDeleting}
|
isLoading={isDeleting}
|
||||||
isDisabled={!isAllowed || isDeleting || currentWorkspace?.hasDeleteProtection}
|
isDisabled={!isAllowed || isDeleting || currentWorkspace?.hasDeleteProtection}
|
||||||
@@ -152,6 +157,7 @@ export const DeleteProjectSection = () => {
|
|||||||
>
|
>
|
||||||
{`Delete ${currentWorkspace?.name}`}
|
{`Delete ${currentWorkspace?.name}`}
|
||||||
</Button>
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</ProjectPermissionCan>
|
</ProjectPermissionCan>
|
||||||
{!isOnlyAdminMember && (
|
{!isOnlyAdminMember && (
|
||||||
|
|||||||
Reference in New Issue
Block a user