Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(ui): use sub-org scope color for sub-org actions (#8690)

Andrew Huang42e19961a348
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupLinkForm.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupLinkForm.tsx
index 97346af719..37615d2535 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupLinkForm.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupLinkForm.tsx
@@ -15,6 +15,7 @@ import {
FilterableSelect
} from "@app/components/v3";
import { useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { useGetOrgRoles } from "@app/hooks/api";
import { useCreateOrgGroupMembership } from "@app/hooks/api/orgGroupMembership";
import { orgGroupMembershipQuery } from "@app/hooks/api/orgGroupMembership/queries";
@@ -33,6 +34,7 @@ type Props = {
};
export const OrgGroupLinkForm = ({ onClose }: Props) => {
+ const scopeVariant = useScopeVariant();
const navigate = useNavigate();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
@@ -124,7 +126,12 @@ export const OrgGroupLinkForm = ({ onClose }: Props) => {
<Button variant="ghost" type="button" onClick={() => onClose()}>
Cancel
</Button>
- <Button variant="org" type="submit" isPending={isSubmitting} isDisabled={isSubmitting}>
+ <Button
+ variant={scopeVariant}
+ type="submit"
+ isPending={isSubmitting}
+ isDisabled={isSubmitting}
+ >
Link
</Button>
</DialogFooter>
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
index cef36ae0d4..b7cdddc805 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgGroupsTab/components/OrgGroupsSection/OrgGroupModal.tsx
@@ -29,6 +29,7 @@ import {
} from "@app/components/v3";
import { useOrganization } from "@app/context";
import { findOrgMembershipRole } from "@app/helpers/roles";
+import { useScopeVariant } from "@app/hooks";
import { useCreateGroup, useGetOrgRoles, useUpdateGroup } from "@app/hooks/api";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -64,6 +65,7 @@ export const OrgGroupModal = ({
setWizardStep,
isSubOrganization
}: Props) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const { data: roles } = useGetOrgRoles(currentOrg?.id || "");
const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateGroup();
@@ -199,7 +201,7 @@ export const OrgGroupModal = ({
Cancel
</Button>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={createIsLoading || updateIsLoading}
isDisabled={createIsLoading || updateIsLoading}
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/CreateOrgIdentitySheet.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/CreateOrgIdentitySheet.tsx
index f6538fe9b8..1ebc172502 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/CreateOrgIdentitySheet.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/CreateOrgIdentitySheet.tsx
@@ -27,6 +27,7 @@ import {
} from "@app/components/v3";
import { useOrganization, useSubscription } from "@app/context";
import { findOrgMembershipRole, isCustomOrgRole } from "@app/helpers/roles";
+import { useScopeVariant } from "@app/hooks";
import { useCreateOrgIdentity, useGetOrgRoles } from "@app/hooks/api";
import { useAddIdentityUniversalAuth } from "@app/hooks/api/identities";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -51,8 +52,9 @@ type Props = {
};
const CreateOrgIdentityForm = ({ onClose }: { onClose: () => void }) => {
+ const scopeVariant = useScopeVariant();
const navigate = useNavigate();
- const { currentOrg, isSubOrganization } = useOrganization();
+ const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
const { subscription } = useSubscription();
const {
@@ -178,7 +180,7 @@ const CreateOrgIdentityForm = ({ onClose }: { onClose: () => void }) => {
</Button>
<Button
type="submit"
- variant={isSubOrganization ? "sub-org" : "org"}
+ variant={scopeVariant}
isPending={isSubmitting}
isDisabled={isSubmitting}
>
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
index 3015535167..dfb96b8fa1 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/AddOrgMemberModal.tsx
@@ -8,6 +8,7 @@ import { Button, Field, FieldError, FieldLabel, SheetClose, TextArea } from "@ap
import { useOrganization } from "@app/context";
import { emailListSchema, parseEmailList } from "@app/helpers/email";
import { findOrgMembershipRole } from "@app/helpers/roles";
+import { useScopeVariant } from "@app/hooks";
import {
useAddUsersToOrg,
useAddUserToWsNonE2EE,
@@ -59,6 +60,7 @@ export const AddOrgMemberModal = ({
completeInviteLinks,
setCompleteInviteLinks
}: Props) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const { data: organizationRoles, isPending: isOrganizationRolesPending } = useGetOrgRoles(
@@ -223,7 +225,7 @@ export const AddOrgMemberModal = ({
</MemberFormSheetBody>
<MemberFormSheetFooter>
<SheetClose asChild>
- <Button type="button" variant="org">
+ <Button type="button" variant={scopeVariant}>
Done
</Button>
</SheetClose>
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
index 56ae465e4b..41a2b72ef0 100644
--- a/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/AddGroupMemberModal.tsx
@@ -19,7 +19,7 @@ import {
FieldLabel,
FilterableSelect
} from "@app/components/v3";
-import { useDebounce } from "@app/hooks";
+import { useDebounce, useScopeVariant } from "@app/hooks";
import {
useAddIdentityToGroup,
useAddUserToGroup,
@@ -99,6 +99,7 @@ export const AddGroupMembersModal = ({
handlePopUpToggle,
isOidcManageGroupMembershipsEnabled
}: Props) => {
+ const scopeVariant = useScopeVariant();
const popUpData = popUp?.addGroupMembers?.data as { groupId: string; slug: string } | undefined;
const groupId = popUpData?.groupId ?? "";
const groupSlug = popUpData?.slug ?? "";
@@ -288,7 +289,7 @@ export const AddGroupMembersModal = ({
Cancel
</Button>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={isSubmitting}
isDisabled={isSubmitting || selectedCount === 0}
diff --git a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupCreateUpdateModal.tsx b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupCreateUpdateModal.tsx
index d3a06a742b..1cb8c9f898 100644
--- a/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupCreateUpdateModal.tsx
+++ b/frontend/src/pages/organization/GroupDetailsByIDPage/components/GroupCreateUpdateModal.tsx
@@ -20,6 +20,7 @@ import {
} from "@app/components/v3";
import { useOrganization } from "@app/context";
import { findOrgMembershipRole } from "@app/helpers/roles";
+import { useScopeVariant } from "@app/hooks";
import { useCreateGroup, useGetOrgRoles, useUpdateGroup } from "@app/hooks/api";
import { UsePopUpState } from "@app/hooks/usePopUp";
@@ -45,6 +46,7 @@ type Props = {
};
export const GroupCreateUpdateModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const { data: roles } = useGetOrgRoles(currentOrg?.id || "");
const { mutateAsync: createMutateAsync, isPending: createIsLoading } = useCreateGroup();
@@ -190,7 +192,7 @@ export const GroupCreateUpdateModal = ({ popUp, handlePopUpClose, handlePopUpTog
Cancel
</Button>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={createIsLoading || updateIsLoading}
isDisabled={createIsLoading || updateIsLoading}
diff --git a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
index 626d3a65f2..366d6b0241 100644
--- a/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/GatewayDetailsByIDPage/components/GatewayDeploySection/GatewayDeploySection.tsx
@@ -34,6 +34,7 @@ import {
OrgPermissionSubjects
} from "@app/context/OrgPermissionContext/types";
import { isInfisicalCloud } from "@app/helpers/platform";
+import { useScopeVariant } from "@app/hooks";
import { useMintGatewayToken } from "@app/hooks/api/gateways-v2";
import { GatewayAuthMethodView, TGatewayEnrollmentToken } from "@app/hooks/api/gateways-v2/types";
@@ -79,6 +80,7 @@ export const GatewayDeploySection = ({
relayId,
authMethod
}: Props) => {
+ const scopeVariant = useScopeVariant();
const isCloud = isInfisicalCloud();
const isKubernetes = authMethod.method === "kubernetes";
const isGcp = authMethod.method === "gcp";
@@ -189,12 +191,12 @@ export const GatewayDeploySection = ({
<Field>
<FieldLabel>Connection Mode</FieldLabel>
<RadioGroup value={connectionMode} onValueChange={handleConnectionModeChange}>
- <FieldLabel htmlFor="gateway-connection-mode-direct" variant="org">
+ <FieldLabel htmlFor="gateway-connection-mode-direct" variant={scopeVariant}>
<Field orientation="horizontal">
<FieldContent>
<FieldTitle>
Direct Listen
- <Badge variant="org">Recommended</Badge>
+ <Badge variant={scopeVariant}>Recommended</Badge>
</FieldTitle>
<FieldDescription>
Infisical opens the connection to the gateway. Choose this when your
@@ -204,7 +206,7 @@ export const GatewayDeploySection = ({
<RadioGroupItem value="direct" id="gateway-connection-mode-direct" />
</Field>
</FieldLabel>
- <FieldLabel htmlFor="gateway-connection-mode-relay" variant="org">
+ <FieldLabel htmlFor="gateway-connection-mode-relay" variant={scopeVariant}>
<Field orientation="horizontal">
<FieldContent>
<FieldTitle>Relay</FieldTitle>
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
index 975728fdf5..a07ec503eb 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
@@ -73,7 +73,7 @@ import {
} from "@app/context/OrgPermissionContext/types";
import { useSubscription } from "@app/context/SubscriptionContext";
import { withPermission } from "@app/hoc";
-import { usePopUp } from "@app/hooks";
+import { usePopUp, useScopeVariant } from "@app/hooks";
import { useListGatewayPools } from "@app/hooks/api/gateway-pools";
import { TGatewayPool } from "@app/hooks/api/gateway-pools/types";
import { gatewaysQueryKeys } from "@app/hooks/api/gateways";
@@ -90,6 +90,7 @@ import { PoolDetailSheet } from "./components/PoolDetailSheet";
export const GatewayTab = withPermission(
() => {
+ const scopeVariant = useScopeVariant();
const navigate = useNavigate();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
@@ -194,7 +195,7 @@ export const GatewayTab = withPermission(
>
{(isAllowed: boolean) => (
<Button
- variant="org"
+ variant={scopeVariant}
onClick={() => handlePopUpOpen("deployGateway")}
isDisabled={!isAllowed}
>
@@ -210,7 +211,7 @@ export const GatewayTab = withPermission(
>
{(isAllowed: boolean) => (
<Button
- variant="org"
+ variant={scopeVariant}
onClick={() => {
if (!subscription?.gatewayPool) {
handlePopUpOpen("upgradePlan");
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx
index 1c7fa87b5d..f9674af677 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/CreateGatewayPoolModal.tsx
@@ -15,6 +15,7 @@ import {
FieldLabel,
Input
} from "@app/components/v3";
+import { useScopeVariant } from "@app/hooks";
import { useCreateGatewayPool, useListGatewayPools } from "@app/hooks/api/gateway-pools";
import { slugSchema } from "@app/lib/schemas";
@@ -28,6 +29,7 @@ type Props = {
};
export const CreateGatewayPoolModal = ({ isOpen, onToggle }: Props) => {
+ const scopeVariant = useScopeVariant();
const createPool = useCreateGatewayPool();
const { data: pools } = useListGatewayPools();
const [name, setName] = useState("");
@@ -104,7 +106,7 @@ export const CreateGatewayPoolModal = ({ isOpen, onToggle }: Props) => {
<Button variant="ghost" onClick={() => onToggle(false)} type="button">
Cancel
</Button>
- <Button variant="org" onClick={handleSubmit} isPending={createPool.isPending}>
+ <Button variant={scopeVariant} onClick={handleSubmit} isPending={createPool.isPending}>
Create Pool
</Button>
</DialogFooter>
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx
index 3e505d6983..dc150ec939 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/EditGatewayPoolModal.tsx
@@ -15,6 +15,7 @@ import {
FieldLabel,
Input
} from "@app/components/v3";
+import { useScopeVariant } from "@app/hooks";
import { useListGatewayPools, useUpdateGatewayPool } from "@app/hooks/api/gateway-pools";
import { TGatewayPool } from "@app/hooks/api/gateway-pools/types";
import { slugSchema } from "@app/lib/schemas";
@@ -30,6 +31,7 @@ type Props = {
};
export const EditGatewayPoolModal = ({ isOpen, onToggle, pool }: Props) => {
+ const scopeVariant = useScopeVariant();
const updatePool = useUpdateGatewayPool();
const { data: pools } = useListGatewayPools();
const [name, setName] = useState("");
@@ -99,7 +101,7 @@ export const EditGatewayPoolModal = ({ isOpen, onToggle, pool }: Props) => {
<Button variant="ghost" onClick={() => onToggle(false)} type="button">
Cancel
</Button>
- <Button variant="org" onClick={handleSubmit} isPending={updatePool.isPending}>
+ <Button variant={scopeVariant} onClick={handleSubmit} isPending={updatePool.isPending}>
Save Changes
</Button>
</DialogFooter>
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx
index e705be9d30..a2eb6dc6e8 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayDeployModal.tsx
@@ -21,6 +21,7 @@ import {
} from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import { useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { gatewaysQueryKeys } from "@app/hooks/api/gateways";
import { useCreateGateway } from "@app/hooks/api/gateways-v2";
import { slugSchema } from "@app/lib/schemas";
@@ -37,6 +38,7 @@ type Props = {
};
const Content = ({ onClose }: { onClose: () => void }) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
const navigate = useNavigate({ from: ROUTE_PATHS.Organization.NetworkingPage.path });
@@ -105,7 +107,7 @@ const Content = ({ onClose }: { onClose: () => void }) => {
</Button>
</DialogClose>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={isPending || isSubmitting}
isDisabled={!isNameProvided}
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoliciesSection.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoliciesSection.tsx
index 5cda76f24c..5cd6089d54 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoliciesSection.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayPoliciesSection.tsx
@@ -23,10 +23,11 @@ import {
useOrganization,
useSubscription
} from "@app/context";
-import { usePopUp } from "@app/hooks";
+import { usePopUp, useScopeVariant } from "@app/hooks";
import { useUpdateOrg } from "@app/hooks/api/organization/queries";
export const GatewayPoliciesSection = () => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const { subscription } = useSubscription();
const { mutateAsync: updateOrg, isPending } = useUpdateOrg();
@@ -79,7 +80,7 @@ export const GatewayPoliciesSection = () => {
{(isAllowed) => (
<Toggle
id="require-gateway-pools"
- variant="org"
+ variant={scopeVariant}
checked={isPoolRequired}
onCheckedChange={handleToggle}
disabled={!isAllowed || isPending}
diff --git a/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx
index 1d4f1192bf..20ee28dc49 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/NetworkingAuthMethodForm.tsx
@@ -21,6 +21,7 @@ import {
} from "@app/components/v3";
import { GatewayPicker } from "@app/components/v3/platform/GatewayPicker/GatewayPicker";
import { useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import {
NETWORKING_AUTH_METHOD_OPTIONS,
@@ -247,6 +248,7 @@ export const NetworkingAuthMethodForm = ({
currentGatewayId,
onUpdate
}: Props) => {
+ const scopeVariant = useScopeVariant();
const { isSubOrganization, currentOrg } = useOrganization();
const initialMethod: NetworkingAuthMethod = currentMethod.method;
const initialAws = currentMethod.method === "aws" ? currentMethod.config : undefined;
@@ -838,7 +840,7 @@ export const NetworkingAuthMethodForm = ({
<div className="flex items-center gap-2">
<Toggle
id="gateway-k8s-verify-tls"
- variant="org"
+ variant={scopeVariant}
checked={field.value}
onCheckedChange={field.onChange}
disabled={isDisabled || isSaving}
diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
index af5ac9834e..b7f7912fe8 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
@@ -65,7 +65,7 @@ import {
OrgRelayPermissionActions
} from "@app/context/OrgPermissionContext/types";
import { withPermission } from "@app/hoc";
-import { usePopUp } from "@app/hooks";
+import { usePopUp, useScopeVariant } from "@app/hooks";
import { useDeleteRelayById, useGetRelays } from "@app/hooks/api/relays";
import { RelayDeployModal } from "./components/RelayDeployModal";
@@ -101,6 +101,7 @@ const RelayHealthStatus = ({ heartbeat }: { heartbeat?: string }) => {
export const RelayTab = withPermission(
() => {
+ const scopeVariant = useScopeVariant();
const [search, setSearch] = useState("");
const { data: relays, isPending: isRelaysLoading } = useGetRelays();
const { currentOrg } = useOrganization();
@@ -159,7 +160,7 @@ export const RelayTab = withPermission(
</CardTitle>
<CardDescription>Create and manage network relays from Infisical</CardDescription>
<CardAction>
- <Button variant="org" onClick={() => handlePopUpOpen("deployRelay")}>
+ <Button variant={scopeVariant} onClick={() => handlePopUpOpen("deployRelay")}>
<PlusIcon />
Create Relay
</Button>
diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx
index 6ef136a8e5..7b32a5ce2b 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/components/RelayDeployModal.tsx
@@ -18,6 +18,7 @@ import {
Input
} from "@app/components/v3";
import { useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { useCreateRelay } from "@app/hooks/api/relays";
import { slugSchema } from "@app/lib/schemas";
@@ -34,6 +35,7 @@ type Props = {
};
export const RelayDeployModal = ({ isOpen, onOpenChange }: Props) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
const navigate = useNavigate();
@@ -129,7 +131,7 @@ export const RelayDeployModal = ({ isOpen, onOpenChange }: Props) => {
</Button>
</DialogClose>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={isCreating || isSubmitting}
isDisabled={isCreating || isSubmitting || !areRequiredFieldsProvided}
diff --git a/frontend/src/pages/organization/NetworkingPage/components/RenameGatewayModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/RenameGatewayModal.tsx
index ac573ef417..9a6d3cf78a 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/RenameGatewayModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/RenameGatewayModal.tsx
@@ -17,6 +17,7 @@ import {
FieldLabel,
Input
} from "@app/components/v3";
+import { useScopeVariant } from "@app/hooks";
import { useUpdateGateway } from "@app/hooks/api/gateways-v2";
import { TGatewayV2 } from "@app/hooks/api/gateways-v2/types";
import { slugSchema } from "@app/lib/schemas";
@@ -34,6 +35,7 @@ type Props = {
};
export const RenameGatewayModal = ({ isOpen, onToggle, gateway }: Props) => {
+ const scopeVariant = useScopeVariant();
const updateGateway = useUpdateGateway();
const { control, handleSubmit, reset } = useForm<TFormData>({
@@ -94,7 +96,7 @@ export const RenameGatewayModal = ({ isOpen, onToggle, gateway }: Props) => {
</Button>
</DialogClose>
<Button
- variant="org"
+ variant={scopeVariant}
type="submit"
isPending={updateGateway.isPending}
isDisabled={updateGateway.isPending}
diff --git a/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx b/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
index 7e5aee465c..879a689862 100644
--- a/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
+++ b/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
@@ -22,6 +22,7 @@ import {
PageLoader
} from "@app/components/v3";
import { useOrganization, useSubscription } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { useCreateOrgRole, useGetOrgRole } from "@app/hooks/api";
import { TOrgRole } from "@app/hooks/api/roles/types";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -49,6 +50,7 @@ type ContentProps = {
};
const Content = ({ role, onClose }: ContentProps) => {
+ const scopeVariant = useScopeVariant();
const {
control,
handleSubmit,
@@ -157,7 +159,12 @@ const Content = ({ role, onClose }: ContentProps) => {
Cancel
</Button>
</DialogClose>
- <Button type="submit" variant="org" isPending={isSubmitting} isDisabled={isSubmitting}>
+ <Button
+ type="submit"
+ variant={scopeVariant}
+ isPending={isSubmitting}
+ isDisabled={isSubmitting}
+ >
Duplicate Role
</Button>
</DialogFooter>
diff --git a/frontend/src/pages/organization/RoleByIDPage/components/RoleModal.tsx b/frontend/src/pages/organization/RoleByIDPage/components/RoleModal.tsx
index 5eabe3801b..d90a193942 100644
--- a/frontend/src/pages/organization/RoleByIDPage/components/RoleModal.tsx
+++ b/frontend/src/pages/organization/RoleByIDPage/components/RoleModal.tsx
@@ -21,6 +21,7 @@ import {
Input
} from "@app/components/v3";
import { useOrganization, useSubscription } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { useCreateOrgRole, useGetOrgRole, useUpdateOrgRole } from "@app/hooks/api";
import { usePopUp, UsePopUpState } from "@app/hooks/usePopUp";
import { slugSchema } from "@app/lib/schemas";
@@ -41,6 +42,7 @@ type Props = {
};
export const RoleModal = ({ popUp, handlePopUpToggle }: Props) => {
+ const scopeVariant = useScopeVariant();
const navigate = useNavigate();
const { currentOrg } = useOrganization();
const orgId = currentOrg?.id || "";
@@ -210,7 +212,7 @@ export const RoleModal = ({ popUp, handlePopUpToggle }: Props) => {
</DialogClose>
<Button
type="submit"
- variant="org"
+ variant={scopeVariant}
isPending={isSubmitting}
isDisabled={isSubmitting}
>
diff --git a/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/RolePermissionsSection.tsx b/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/RolePermissionsSection.tsx
index 2ff600bc8a..7db6cc5279 100644
--- a/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/RolePermissionsSection.tsx
+++ b/frontend/src/pages/organization/RoleByIDPage/components/RolePermissionsSection/RolePermissionsSection.tsx
@@ -13,6 +13,7 @@ import {
EmptyTitle
} from "@app/components/v3";
import { OrgPermissionSubjects, useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import { useGetOrgRole, useUpdateOrgRole } from "@app/hooks/api";
import {
GeneralPermissionPolicies,
@@ -43,6 +44,7 @@ type Props = {
};
export const RolePermissionsSection = ({ roleId }: Props) => {
+ const scopeVariant = useScopeVariant();
const { currentOrg, isRootOrganization } = useOrganization();
const orgId = currentOrg?.id || "";
@@ -126,7 +128,7 @@ export const RolePermissionsSection = ({ roleId }: Props) => {
Discard
</Button>
)}
- <Button variant="org" type="submit" disabled={isSubmitting || !isDirty}>
+ <Button variant={scopeVariant} type="submit" disabled={isSubmitting || !isDirty}>
<SaveIcon className="size-4" />
Save
</Button>
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
index fd5997402b..4e184aebab 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/ExternalMigrationsTab.tsx
@@ -3,7 +3,7 @@ import { Plus } from "lucide-react";
import { Button, DocumentationLinkBadge } from "@app/components/v3";
import { useOrgPermission } from "@app/context";
import { OrgMembershipRole } from "@app/helpers/roles";
-import { usePopUp } from "@app/hooks";
+import { usePopUp, useScopeVariant } from "@app/hooks";
import { SelectImportFromPlatformModal } from "./components/SelectImportFromPlatformModal";
@@ -11,6 +11,7 @@ const EXTERNAL_MIGRATIONS_DOCS_HREF =
"https://infisical.com/docs/documentation/platform/external-migrations/overview";
export const ExternalMigrationsTab = () => {
+ const scopeVariant = useScopeVariant();
const { hasOrgRole } = useOrgPermission();
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["selectImportPlatform"] as const);
@@ -37,7 +38,7 @@ export const ExternalMigrationsTab = () => {
</div>
<Button
- variant="org"
+ variant={scopeVariant}
type="button"
className="gap-1.5"
onClick={() => {
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
index be497b2d5d..3393ee785f 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/EnvKeyPlatformModal.tsx
@@ -5,6 +5,7 @@ import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { Button, Field, FieldContent, FieldError, FieldLabel, Input } from "@app/components/v3";
+import { useScopeVariant } from "@app/hooks";
import { useImportEnvKey } from "@app/hooks/api/migration/mutations";
import { GenericDropzone } from "./GenericDropzone";
@@ -15,6 +16,7 @@ type Props = {
};
export const EnvKeyPlatformModal = ({ onClose }: Props) => {
+ const scopeVariant = useScopeVariant();
const formSchema = z.object({
encryptionKey: z.string().min(1),
file: z.instanceof(File)
@@ -99,7 +101,7 @@ export const EnvKeyPlatformModal = ({ onClose }: Props) => {
<div className="flex items-center gap-2 pt-2">
<Button
type="submit"
- variant="org"
+ variant={scopeVariant}
isPending={isLoading || isSubmitting}
isDisabled={!isDirty || isSubmitting || isLoading || !isValid}
>
diff --git a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
index fa4df46f0d..9b1f96c514 100644
--- a/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/ExternalMigrationsTab/components/VaultPlatformModal.tsx
@@ -30,6 +30,7 @@ import {
OrgGatewayPermissionActions,
OrgPermissionSubjects
} from "@app/context/OrgPermissionContext/types";
+import { useScopeVariant } from "@app/hooks";
import { gatewaysQueryKeys } from "@app/hooks/api";
import { useHasCustomMigrationAvailable } from "@app/hooks/api/migration";
import { useImportVault } from "@app/hooks/api/migration/mutations";
@@ -156,6 +157,7 @@ const MAPPING_TYPE_MENU_ITEMS = [
];
export const VaultPlatformModal = ({ onClose }: Props) => {
+ const scopeVariant = useScopeVariant();
const { data: isCustomMigrationAvailable } = useHasCustomMigrationAvailable(
ExternalMigrationProviders.Vault
);
@@ -364,7 +366,7 @@ export const VaultPlatformModal = ({ onClose }: Props) => {
<div className="flex items-center gap-2 pt-2">
<Button
type="submit"
- variant="org"
+ variant={scopeVariant}
isPending={isLoading || isSubmitting}
isDisabled={!isDirty || isSubmitting || isLoading || !isValid}
>
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx
index 510e322ce8..544e74bb1b 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx
@@ -149,7 +149,12 @@ export const SubOrgNameChangeSection = (): JSX.Element => {
<div className="mt-6 flex justify-end">
<OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>
{(isAllowed) => (
- <Button variant="org" type="submit" isPending={isPending} isDisabled={!isAllowed}>
+ <Button
+ variant="sub-org"
+ type="submit"
+ isPending={isPending}
+ isDisabled={!isAllowed}
+ >
Save
</Button>
)}
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
index 9588e19ce2..4960cc63ca 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/MicrosoftTeamsIntegrationForm.tsx
@@ -18,6 +18,7 @@ import {
Input
} from "@app/components/v3";
import { useOrganization } from "@app/context";
+import { useScopeVariant } from "@app/hooks";
import {
useGetMicrosoftTeamsClientId,
useGetMicrosoftTeamsIntegrationById,
@@ -44,6 +45,7 @@ const microsoftTeamsFormSchema = z.object({
type TMicrosoftTeamsFormData = z.infer<typeof microsoftTeamsFormSchema>;
export const MicrosoftTeamsIntegrationForm = ({ id, onClose, onBack }: Props) => {
+ const scopeVariant = useScopeVariant();
const {
control,
handleSubmit,
@@ -225,7 +227,7 @@ export const MicrosoftTeamsIntegrationForm = ({ id, onClose, onBack }: Props) =>
</DialogClose>
<Button
type="submit"
- variant="org"
+ variant={scopeVariant}
isPending={isSubmitting}
isDisabled={!isDirty || isSubmitting}
>
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx
index a0750d5d24..033072845f 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/OrgWorkflowIntegrationTab.tsx
@@ -45,7 +45,7 @@ import {
} from "@app/components/v3";
import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";
import { withPermission } from "@app/hoc";
-import { usePopUp } from "@app/hooks";
+import { usePopUp, useScopeVariant } from "@app/hooks";
import {
fetchSlackReinstallUrl,
useCheckMicrosoftTeamsIntegrationInstallationStatus,
@@ -75,6 +75,7 @@ const renderStatus = (status: WorkflowIntegrationStatus) => {
export const OrgWorkflowIntegrationTab = withPermission(
() => {
+ const scopeVariant = useScopeVariant();
const { popUp, handlePopUpOpen, handlePopUpToggle, handlePopUpClose } = usePopUp([
"addWorkflowIntegration",
"integrationDetails",
@@ -171,7 +172,7 @@ export const OrgWorkflowIntegrationTab = withPermission(
<OrgPermissionCan I={OrgPermissionActions.Create} an={OrgPermissionSubjects.Settings}>
{(isAllowed) => (
<Button
- variant="org"
+ variant={scopeVariant}
size="sm"
onClick={() => {
handlePopUpOpen("addWorkflowIntegration");
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx
index 035b8404b6..c6de35ebbf 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgWorkflowIntegrationTab/SlackIntegrationForm.tsx
@@ -16,7 +16,7 @@ import {
Input
} from "@app/components/v3";
import { useOrganization } from "@app/context";
-import { useToggle } from "@app/hooks";
+import { useScopeVariant, useToggle } from "@app/hooks";
import {
fetchSlackInstallUrl,
useGetSlackIntegrationById,
@@ -38,6 +38,7 @@ const slackFormSchema = z.object({
type TSlackFormData = z.infer<typeof slackFormSchema>;
export const SlackIntegrationForm = ({ id, onClose, onBack }: Props) => {
+ const scopeVariant = useScopeVariant();
const {
control,
handleSubmit,
@@ -154,7 +155,7 @@ export const SlackIntegrationForm = ({ id, onClose, onBack }: Props) => {
</DialogClose>
<Button
type="submit"
- variant="org"
+ variant={scopeVariant}
isPending={isSubmitting || isConnectLoading}
isDisabled={!isDirty || isConnectLoading || isSubmitting}
>