mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 00:17:46 +00:00
feat: battle of ts - unlimited edition
This commit is contained in:
+4
-3
@@ -7,6 +7,7 @@ import { createNotification } from "@app/components/notifications";
|
||||
import { Button, Checkbox, Modal, ModalContent, Tooltip } from "@app/components/v2";
|
||||
import { useOrgPermission } from "@app/context";
|
||||
import { useUpgradePrivilegeSystem } from "@app/hooks/api";
|
||||
import { OrgMembershipRole } from "@app/helpers/roles";
|
||||
|
||||
const formSchema = z.object({
|
||||
isProjectPrivilegesUpdated: z.literal(true),
|
||||
@@ -21,7 +22,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) => {
|
||||
const { membership } = useOrgPermission();
|
||||
const { hasOrgRole } = useOrgPermission();
|
||||
const [step, setStep] = useState<"info" | "upgrade">("info");
|
||||
|
||||
const {
|
||||
@@ -65,7 +66,7 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
|
||||
setStep("info");
|
||||
};
|
||||
|
||||
const isAdmin = membership?.role === "admin";
|
||||
const isAdmin = hasOrgRole(OrgMembershipRole.Admin);
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onOpenChange={handleClose}>
|
||||
@@ -274,7 +275,7 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
|
||||
<Tooltip
|
||||
content={
|
||||
!isAdmin
|
||||
? `You cannot perform this upgrade because you are not an organization admin. (Your current role: ${membership?.role ?? "Unknown"})`
|
||||
? `You cannot perform this upgrade because you are not an organization admin.`
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user