mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 07:27:43 +00:00
Add condition to hide Instance Admins on cloud instances
This commit is contained in:
+34
-28
@@ -36,6 +36,7 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { envConfig } from "@app/config/env";
|
import { envConfig } from "@app/config/env";
|
||||||
import { useOrganization, useSubscription, useUser } from "@app/context";
|
import { useOrganization, useSubscription, useUser } from "@app/context";
|
||||||
|
import { isInfisicalCloud } from "@app/helpers/platform";
|
||||||
import { usePopUp, useToggle } from "@app/hooks";
|
import { usePopUp, useToggle } from "@app/hooks";
|
||||||
import {
|
import {
|
||||||
useGetOrganizations,
|
useGetOrganizations,
|
||||||
@@ -419,34 +420,39 @@ export const MinimizedOrgSidebar = () => {
|
|||||||
side="right"
|
side="right"
|
||||||
className="p-1"
|
className="p-1"
|
||||||
>
|
>
|
||||||
{INFISICAL_SUPPORT_OPTIONS.map(([icon, text, url]) => (
|
{INFISICAL_SUPPORT_OPTIONS.map(([icon, text, url]) => {
|
||||||
<DropdownMenuItem key={url as string}>
|
if (url === "server-admins" && isInfisicalCloud()) {
|
||||||
{url === "server-admins" ? (
|
return null;
|
||||||
<button
|
}
|
||||||
type="button"
|
return (
|
||||||
onClick={() => setShowAdminsModal(true)}
|
<DropdownMenuItem key={url as string}>
|
||||||
className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
|
{url === "server-admins" ? (
|
||||||
>
|
<button
|
||||||
<div className="relative flex w-full cursor-pointer select-none items-center justify-start rounded-md">
|
type="button"
|
||||||
{icon}
|
onClick={() => setShowAdminsModal(true)}
|
||||||
<div className="text-sm">{text}</div>
|
className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
|
||||||
</div>
|
>
|
||||||
</button>
|
<div className="relative flex w-full cursor-pointer select-none items-center justify-start rounded-md">
|
||||||
) : (
|
{icon}
|
||||||
<a
|
<div className="text-sm">{text}</div>
|
||||||
target="_blank"
|
</div>
|
||||||
rel="noopener noreferrer"
|
</button>
|
||||||
href={String(url)}
|
) : (
|
||||||
className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
|
<a
|
||||||
>
|
target="_blank"
|
||||||
<div className="relative flex w-full cursor-pointer select-none items-center justify-start rounded-md">
|
rel="noopener noreferrer"
|
||||||
{icon}
|
href={String(url)}
|
||||||
<div className="text-sm">{text}</div>
|
className="flex w-full items-center rounded-md font-normal text-mineshaft-300 duration-200"
|
||||||
</div>
|
>
|
||||||
</a>
|
<div className="relative flex w-full cursor-pointer select-none items-center justify-start rounded-md">
|
||||||
)}
|
{icon}
|
||||||
</DropdownMenuItem>
|
<div className="text-sm">{text}</div>
|
||||||
))}
|
</div>
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
{envConfig.PLATFORM_VERSION && (
|
{envConfig.PLATFORM_VERSION && (
|
||||||
<div className="mb-2 mt-2 w-full cursor-default pl-5 text-sm duration-200 hover:text-mineshaft-200">
|
<div className="mb-2 mt-2 w-full cursor-default pl-5 text-sm duration-200 hover:text-mineshaft-200">
|
||||||
<FontAwesomeIcon icon={faInfo} className="mr-4 px-[0.1rem]" />
|
<FontAwesomeIcon icon={faInfo} className="mr-4 px-[0.1rem]" />
|
||||||
|
|||||||
Reference in New Issue
Block a user