mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 19:28:16 +00:00
Merge pull request #3660 from Infisical/misc/add-proper-notice-for-non-admin-privilege-upgrade-1
misc: added proper notice for non-admins doing privilege upgrade
This commit is contained in:
+21
-12
@@ -4,7 +4,7 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import { Button, Checkbox, Modal, ModalContent } from "@app/components/v2";
|
import { Button, Checkbox, Modal, ModalContent, Tooltip } from "@app/components/v2";
|
||||||
import { useOrgPermission } from "@app/context";
|
import { useOrgPermission } from "@app/context";
|
||||||
import { useUpgradePrivilegeSystem } from "@app/hooks/api";
|
import { useUpgradePrivilegeSystem } from "@app/hooks/api";
|
||||||
|
|
||||||
@@ -262,7 +262,6 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form onSubmit={handleSubmit(handlePrivilegeSystemUpgrade)}>
|
<form onSubmit={handleSubmit(handlePrivilegeSystemUpgrade)}>
|
||||||
<div className="mt-6 flex items-center justify-end gap-4">
|
<div className="mt-6 flex items-center justify-end gap-4">
|
||||||
<button
|
<button
|
||||||
@@ -272,17 +271,27 @@ export const UpgradePrivilegeSystemModal = ({ isOpen, onOpenChange }: Props) =>
|
|||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<Button
|
<Tooltip
|
||||||
type="submit"
|
content={
|
||||||
variant="solid"
|
!isAdmin
|
||||||
colorSchema="primary"
|
? `You cannot perform this upgrade because you are not an organization admin. (Your current role: ${membership?.role ?? "Unknown"})`
|
||||||
size="md"
|
: undefined
|
||||||
className="w-[120px] bg-primary hover:bg-primary-600"
|
}
|
||||||
isDisabled={!isAllChecksCompleted || !isAdmin}
|
|
||||||
isLoading={isSubmitting}
|
|
||||||
>
|
>
|
||||||
Upgrade
|
<div>
|
||||||
</Button>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="solid"
|
||||||
|
colorSchema="primary"
|
||||||
|
size="md"
|
||||||
|
className="w-[120px] bg-primary hover:bg-primary-600"
|
||||||
|
isDisabled={!isAllChecksCompleted || !isAdmin}
|
||||||
|
isLoading={isSubmitting}
|
||||||
|
>
|
||||||
|
Upgrade
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user