Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
improvement(ui): move org general and security settings cards to footer layout (#8725)
Andrew Huangce8f2c52933c
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgDeleteSection/OrgDeleteSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgDeleteSection/OrgDeleteSection.tsxindex 3bbc783c88..a7ac46ce38 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgDeleteSection/OrgDeleteSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgDeleteSection/OrgDeleteSection.tsx@@ -1,6 +1,6 @@import { useState } from "react";import { useNavigate } from "@tanstack/react-router";-import { TriangleAlert } from "lucide-react";+import { Trash2Icon, TriangleAlert } from "lucide-react";import { createNotification } from "@app/components/notifications";import {@@ -15,14 +15,10 @@ import {AlertDialogTitle,Button,Card,- CardContent,CardDescription,+ CardFooter,CardHeader,CardTitle,- Field,- FieldContent,- FieldDescription,- FieldTitle,Input,Label} from "@app/components/v3";@@ -63,33 +59,25 @@ export const OrgDeleteSection = () => {};return (- <Card>- <CardHeader>- <CardTitle>- <TriangleAlert className="size-4 text-danger" />- Danger Zone- </CardTitle>- <CardDescription>Irreversible and destructive actions.</CardDescription>+ <Card className="gap-0 overflow-hidden border-danger/25 p-0">+ <CardHeader className="p-6">+ <CardTitle>Danger Zone</CardTitle>+ <CardDescription>+ Permanently delete this organization and all of its data. This action cannot be undone.+ </CardDescription></CardHeader>- <CardContent>- <Field orientation="horizontal">- <FieldContent>- <FieldTitle>Delete this organization</FieldTitle>- <FieldDescription>- Permanently remove {currentOrg?.name} and all of its data. This action cannot be- undone.- </FieldDescription>- </FieldContent>- <Button- variant="danger"- isPending={isPending}- isDisabled={!isAdmin}- onClick={() => handlePopUpOpen("deleteOrg")}- >- Delete Organization- </Button>- </Field>- </CardContent>+ <CardFooter className="min-h-8 justify-end border-t border-danger/15 bg-danger/5 p-4">+ <Button+ size="sm"+ variant="danger"+ isPending={isPending}+ isDisabled={!isAdmin}+ onClick={() => handlePopUpOpen("deleteOrg")}+ >+ <Trash2Icon />+ Delete Organization+ </Button>+ </CardFooter><AlertDialogopen={popUp.deleteOrg.isOpen}onOpenChange={(isOpen) => {diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgIncidentContactsSection/OrgIncidentContactsSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgIncidentContactsSection/OrgIncidentContactsSection.tsxindex a100876619..c052f97e51 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgIncidentContactsSection/OrgIncidentContactsSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgIncidentContactsSection/OrgIncidentContactsSection.tsx@@ -1,4 +1,4 @@-import { Plus, Siren } from "lucide-react";+import { Plus } from "lucide-react";import { OrgPermissionCan, PermissionDeniedBanner } from "@app/components/permissions";import {@@ -24,12 +24,9 @@ export const OrgIncidentContactsSection = () => {return (<>- <Card>- <CardHeader>- <CardTitle>- <Siren className="size-4 text-accent" />- Incident Contacts- </CardTitle>+ <Card className="gap-0 overflow-hidden p-0">+ <CardHeader className="p-6">+ <CardTitle>Incident Contacts</CardTitle><CardDescription>Contacts notified in the unlikely event of a severe incident.</CardDescription>@@ -41,6 +38,7 @@ export const OrgIncidentContactsSection = () => {{(isAllowed) => (<Buttonvariant="outline"+ size="sm"isDisabled={!isAllowed}onClick={() => handlePopUpOpen("addContact")}>@@ -51,7 +49,7 @@ export const OrgIncidentContactsSection = () => {</OrgPermissionCan></CardAction></CardHeader>- <CardContent>+ <CardContent className="px-6 pb-6">{permission.can(OrgPermissionActions.Read, OrgPermissionSubjects.IncidentAccount) ? (<OrgIncidentContactsTable />) : (diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/OrgNameChangeSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/OrgNameChangeSection.tsxindex 84fadbdf7b..dc0230193d 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/OrgNameChangeSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/OrgNameChangeSection.tsx@@ -1,7 +1,6 @@import { useEffect, useState } from "react";import { Controller, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";-import { Building2 } from "lucide-react";import { z } from "zod";import { createNotification } from "@app/components/notifications";@@ -11,6 +10,7 @@ import {Card,CardContent,CardDescription,+ CardFooter,CardHeader,CardTitle,CopyButton,@@ -54,7 +54,12 @@ export const OrgNameChangeSection = (): JSX.Element => {const { currentOrg } = useOrganization();const { permission } = useOrgPermission();- const { handleSubmit, control, reset } = useForm<FormData>({+ const {+ handleSubmit,+ control,+ reset,+ formState: { isDirty }+ } = useForm<FormData>({resolver: zodResolver(formSchema)});const { mutateAsync, isPending } = useUpdateOrg();@@ -93,28 +98,26 @@ export const OrgNameChangeSection = (): JSX.Element => {text: "Successfully updated organization details",type: "success"});+ reset({ name, slug, defaultMembershipRole }, { keepDirtyValues: true });};return (- <Card>- <CardHeader>- <CardTitle>- <Building2 className="size-4 text-accent" />- Organization Details- </CardTitle>- <CardDescription>- Update your organization's name, slug, and default member role.- </CardDescription>- </CardHeader>- <CardContent>- {!isFormInitialized ? (- <FieldGroup>- <Skeleton className="h-9 w-full" />- <Skeleton className="h-9 w-full" />- <Skeleton className="h-9 w-full" />- </FieldGroup>- ) : (- <form onSubmit={handleSubmit(onFormSubmit)}>+ <form onSubmit={handleSubmit(onFormSubmit)}>+ <Card className="gap-0 overflow-hidden p-0">+ <CardHeader className="p-6">+ <CardTitle>Organization Details</CardTitle>+ <CardDescription>+ Update your organization's name, slug, and default member role.+ </CardDescription>+ </CardHeader>+ <CardContent className="max-w-md px-6 pb-6">+ {!isFormInitialized ? (+ <FieldGroup>+ <Skeleton className="h-9 w-full" />+ <Skeleton className="h-9 w-full" />+ <Skeleton className="h-9 w-full" />+ </FieldGroup>+ ) : (<FieldGroup><ControllerdefaultValue=""@@ -201,18 +204,24 @@ export const OrgNameChangeSection = (): JSX.Element => {/>)}</FieldGroup>- <div className="mt-6 flex">- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>- {(isAllowed) => (- <Button variant="org" type="submit" isPending={isPending} isDisabled={!isAllowed}>- Save- </Button>- )}- </OrgPermissionCan>- </div>- </form>- )}- </CardContent>- </Card>+ )}+ </CardContent>+ <CardFooter className="min-h-8 justify-end border-t border-neutral/15 bg-neutral/5 p-4">+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>+ {(isAllowed) => (+ <Button+ variant="org"+ size="sm"+ type="submit"+ isPending={isPending}+ isDisabled={!isAllowed || !isDirty}+ >+ Save Changes+ </Button>+ )}+ </OrgPermissionCan>+ </CardFooter>+ </Card>+ </form>);};diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsxindex 544e74bb1b..8b079330e5 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgNameChangeSection/SubOrgNameChangeSection.tsx@@ -3,7 +3,6 @@ import { Controller, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";import { useQueryClient } from "@tanstack/react-query";import { useNavigate, useRouter } from "@tanstack/react-router";-import { Building2 } from "lucide-react";import { z } from "zod";import { createNotification } from "@app/components/notifications";@@ -13,6 +12,7 @@ import {Card,CardContent,CardDescription,+ CardFooter,CardHeader,CardTitle,Field,@@ -45,7 +45,12 @@ export const SubOrgNameChangeSection = (): JSX.Element => {const router = useRouter();const queryClient = useQueryClient();- const { handleSubmit, control, reset } = useForm<FormData>({+ const {+ handleSubmit,+ control,+ reset,+ formState: { isDirty }+ } = useForm<FormData>({resolver: zodResolver(formSchema),defaultValues: {name: currentOrg?.name || "",@@ -87,18 +92,15 @@ export const SubOrgNameChangeSection = (): JSX.Element => {};return (- <Card>- <CardHeader>- <CardTitle>- <Building2 className="size-4 text-accent" />- Sub-Organization Details- </CardTitle>- <CardDescription>- Update your sub-organization's display name and slug.- </CardDescription>- </CardHeader>- <CardContent>- <form onSubmit={handleSubmit(onFormSubmit)}>+ <form onSubmit={handleSubmit(onFormSubmit)}>+ <Card className="gap-0 overflow-hidden p-0">+ <CardHeader className="p-6">+ <CardTitle>Sub-Organization Details</CardTitle>+ <CardDescription>+ Update your sub-organization's display name and slug.+ </CardDescription>+ </CardHeader>+ <CardContent className="max-w-md px-6 pb-6"><FieldGroup><ControllerdefaultValue=""@@ -146,22 +148,23 @@ export const SubOrgNameChangeSection = (): JSX.Element => {)}/></FieldGroup>- <div className="mt-6 flex justify-end">- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>- {(isAllowed) => (- <Button- variant="sub-org"- type="submit"- isPending={isPending}- isDisabled={!isAllowed}- >- Save- </Button>- )}- </OrgPermissionCan>- </div>- </form>- </CardContent>- </Card>+ </CardContent>+ <CardFooter className="min-h-8 justify-end border-t border-neutral/15 bg-neutral/5 p-4">+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>+ {(isAllowed) => (+ <Button+ variant="sub-org"+ size="sm"+ type="submit"+ isPending={isPending}+ isDisabled={!isAllowed || !isDirty}+ >+ Save Changes+ </Button>+ )}+ </OrgPermissionCan>+ </CardFooter>+ </Card>+ </form>);};diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgGenericAuthSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgGenericAuthSection.tsxindex 8242bbb28a..78d5dd76f4 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgGenericAuthSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgGenericAuthSection.tsx@@ -1,21 +1,17 @@-import { Fingerprint } from "lucide-react";-import { MfaEnforcementUpgradeIntent, UpgradeGate } from "@app/components/license/UpgradeGate";import { createNotification } from "@app/components/notifications";import { OrgPermissionCan } from "@app/components/permissions";import {Badge,Card,+ CardAction,CardContent,CardDescription,+ CardFooter,CardHeader,CardTitle,Field,- FieldContent,- FieldDescription,- FieldGroup,FieldLabel,- FieldTitle,Select,SelectContent,SelectItem,@@ -78,64 +74,63 @@ export const OrgGenericAuthSection = () => {return (<>- <Card>- <CardHeader>+ <Card className="gap-0 overflow-hidden p-0">+ <CardHeader className="p-6"><CardTitle>- <Fingerprint className="size-4 text-accent" />Multi-Factor Authentication{currentOrg?.enforceMfa && <Badge variant="success">Enforced</Badge>}</CardTitle><CardDescription>Require members to authenticate with MFA to access the organization.</CardDescription>+ <CardAction className="@xs:self-center">+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Sso}>+ {(isAllowed) => (+ <Toggle+ id="enforce-org-mfa"+ variant="org"+ checked={currentOrg?.enforceMfa ?? false}+ onCheckedChange={handleEnforceMfaToggle}+ disabled={!isAllowed}+ aria-label="Toggle MFA enforcement"+ />+ )}+ </OrgPermissionCan>+ </CardAction></CardHeader>- <CardContent>- <FieldGroup>- <Field orientation="horizontal">- <FieldContent>- <FieldTitle>Enforce MFA</FieldTitle>- <FieldDescription>- Members must complete a second authentication factor to sign in.- </FieldDescription>- </FieldContent>- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Sso}>- {(isAllowed) => (- <Toggle- id="enforce-org-mfa"- variant="org"- checked={currentOrg?.enforceMfa ?? false}- onCheckedChange={handleEnforceMfaToggle}- disabled={!isAllowed}- />- )}- </OrgPermissionCan>+ {currentOrg?.enforceMfa && (+ <CardContent className="max-w-md px-6 pb-6">+ <Field>+ <FieldLabel htmlFor="org-mfa-method">MFA Method</FieldLabel>+ <Select+ value={currentOrg.selectedMfaMethod ?? MfaMethod.EMAIL}+ onValueChange={(value) => handleUpdateSelectedMfa(value as MfaMethod)}+ >+ <SelectTrigger id="org-mfa-method" className="w-full max-w-sm">+ <SelectValue />+ </SelectTrigger>+ <SelectContent position="popper">+ <SelectItem value={MfaMethod.EMAIL} key="mfa-method-email">+ </SelectItem>+ <SelectItem value={MfaMethod.TOTP} key="mfa-method-totp">+ Mobile Authenticator+ </SelectItem>+ <SelectItem value={MfaMethod.WEBAUTHN} key="mfa-method-webauthn">+ Passkey (WebAuthn)+ </SelectItem>+ </SelectContent>+ </Select></Field>- {currentOrg?.enforceMfa && (- <Field>- <FieldLabel htmlFor="org-mfa-method">MFA Method</FieldLabel>- <Select- value={currentOrg.selectedMfaMethod ?? MfaMethod.EMAIL}- onValueChange={(value) => handleUpdateSelectedMfa(value as MfaMethod)}- >- <SelectTrigger id="org-mfa-method" className="w-full max-w-sm">- <SelectValue />- </SelectTrigger>- <SelectContent position="popper">- <SelectItem value={MfaMethod.EMAIL} key="mfa-method-email">- </SelectItem>- <SelectItem value={MfaMethod.TOTP} key="mfa-method-totp">- Mobile Authenticator- </SelectItem>- <SelectItem value={MfaMethod.WEBAUTHN} key="mfa-method-webauthn">- Passkey (WebAuthn)- </SelectItem>- </SelectContent>- </Select>- </Field>- )}- </FieldGroup>- </CardContent>+ </CardContent>+ )}+ <CardFooter className="min-h-8 border-t border-neutral/15 bg-neutral/5 p-4 pl-6">+ <p className="text-sm text-muted">+ {currentOrg?.enforceMfa+ ? "MFA is enforced. Members must complete a second authentication factor to sign in."+ : "MFA is not enforced. Members choose whether to set up a second factor."}+ </p>+ </CardFooter></Card><UpgradeGatepaywallKey="organization.org-generic-auth"diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgUserAccessTokenLimitSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgUserAccessTokenLimitSection.tsxindex 8fe904ce34..ddecbaaaa3 100644--- a/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgUserAccessTokenLimitSection.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/OrgSecurityTab/OrgUserAccessTokenLimitSection.tsx@@ -1,6 +1,5 @@import { Controller, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";-import { Clock } from "lucide-react";import { z } from "zod";import { createNotification } from "@app/components/notifications";@@ -10,6 +9,7 @@ import {Card,CardContent,CardDescription,+ CardFooter,CardHeader,CardTitle,Field,@@ -22,7 +22,12 @@ import {SelectTrigger,SelectValue} from "@app/components/v3";-import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@app/context";+import {+ OrgPermissionActions,+ OrgPermissionSubjects,+ useOrganization,+ useOrgPermission+} from "@app/context";import { useUpdateOrg } from "@app/hooks/api";const formSchema = z.object({@@ -55,6 +60,8 @@ const formatDuration = (value: number, unit: string): string => {export const OrgUserAccessTokenLimitSection = () => {const { mutateAsync: updateUserTokenExpiration } = useUpdateOrg();const { currentOrg } = useOrganization();+ const { permission } = useOrgPermission();+ const isAllowed = permission.can(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);// Parse the current duration or use defaultconst currentDuration = parseDuration(currentOrg?.userTokenExpiration || "30d");@@ -62,7 +69,8 @@ export const OrgUserAccessTokenLimitSection = () => {const {control,formState: { isSubmitting, isDirty },- handleSubmit+ handleSubmit,+ reset} = useForm<TForm>({resolver: zodResolver(formSchema),defaultValues: {@@ -85,6 +93,7 @@ export const OrgUserAccessTokenLimitSection = () => {text: "Successfully updated user token expiration",type: "success"});+ reset(formData, { keepDirtyValues: true });};// Units for the dropdown with readable labels@@ -96,87 +105,78 @@ export const OrgUserAccessTokenLimitSection = () => {];return (- <Card>- <CardHeader>- <CardTitle>- <Clock className="size-4 text-accent" />- Session Length- </CardTitle>- <CardDescription>- Specify the duration of each login session for users in this organization.- </CardDescription>- </CardHeader>- <CardContent>- <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>- {(isAllowed) => (- <form onSubmit={handleSubmit(handleUserTokenExpirationSubmit)} autoComplete="off">- <div className="flex max-w-sm gap-4">- <Controller- control={control}- name="expirationValue"- render={({ field, fieldState: { error } }) => (- <Field className="flex-1">- <FieldLabel htmlFor="expiration-value">Expiration Value</FieldLabel>- <Input- {...field}- id="expiration-value"- type="number"- min={1}- step={1}- value={field.value}- onChange={(e) => field.onChange(parseInt(e.target.value, 10))}- isError={Boolean(error)}- disabled={!isAllowed}- />- <FieldError>{error?.message}</FieldError>- </Field>- )}- />+ <form onSubmit={handleSubmit(handleUserTokenExpirationSubmit)} autoComplete="off">+ <Card className="gap-0 overflow-hidden p-0">+ <CardHeader className="p-6">+ <CardTitle>Session Length</CardTitle>+ <CardDescription>+ Specify the duration of each login session for users in this organization.+ </CardDescription>+ </CardHeader>+ <CardContent className="max-w-md px-6 pb-6">+ <div className="flex gap-4">+ <Controller+ control={control}+ name="expirationValue"+ render={({ field, fieldState: { error } }) => (+ <Field className="flex-1">+ <FieldLabel htmlFor="expiration-value">Expiration Value</FieldLabel>+ <Input+ {...field}+ id="expiration-value"+ type="number"+ min={1}+ step={1}+ value={field.value}+ onChange={(e) => field.onChange(parseInt(e.target.value, 10))}+ isError={Boolean(error)}+ disabled={!isAllowed}+ />+ <FieldError>{error?.message}</FieldError>+ </Field>+ )}+ />- <Controller- control={control}- name="expirationUnit"- render={({ field, fieldState: { error } }) => (- <Field className="flex-1">- <FieldLabel htmlFor="expiration-unit">Time Unit</FieldLabel>- <Select- value={field.value}- onValueChange={field.onChange}- disabled={!isAllowed}- >- <SelectTrigger- id="expiration-unit"- className="w-full"- isError={Boolean(error)}- >- <SelectValue placeholder="Select time unit" />- </SelectTrigger>- <SelectContent position="popper">- {timeUnits.map(({ value, label }) => (- <SelectItem key={value} value={value}>- {label}- </SelectItem>- ))}- </SelectContent>- </Select>- <FieldError>{error?.message}</FieldError>- </Field>- )}- />- </div>+ <Controller+ control={control}+ name="expirationUnit"+ render={({ field, fieldState: { error } }) => (+ <Field className="flex-1">+ <FieldLabel htmlFor="expiration-unit">Time Unit</FieldLabel>+ <Select value={field.value} onValueChange={field.onChange} disabled={!isAllowed}>+ <SelectTrigger id="expiration-unit" className="w-full" isError={Boolean(error)}>+ <SelectValue placeholder="Select time unit" />+ </SelectTrigger>+ <SelectContent position="popper">+ {timeUnits.map(({ value, label }) => (+ <SelectItem key={value} value={value}>+ {label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <FieldError>{error?.message}</FieldError>+ </Field>+ )}+ />+ </div>+ </CardContent>+ <CardFooter className="min-h-8 justify-end border-t border-neutral/15 bg-neutral/5 p-4">+ <OrgPermissionCan I={OrgPermissionActions.Edit} a={OrgPermissionSubjects.Settings}>+ {(canEdit) => (<Buttonvariant="org"+ size="sm"type="submit"isPending={isSubmitting}- isDisabled={!isAllowed || !isDirty}- className="mt-4"+ isDisabled={!canEdit || !isDirty}>- Save+ Save Changes</Button>- </form>- )}- </OrgPermissionCan>- </CardContent>- </Card>+ )}+ </OrgPermissionCan>+ </CardFooter>+ </Card>+ </form>);};