Skip to content

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

Merge branch 'main' into auto-capitalization-toggle

Hasan Mansoor3ec68daf2e18
diff --cc frontend/src/components/dashboard/DashboardInputField.tsx
index 6969b04d8a,c3f7e9a65e..00c9c0de70
--- a/frontend/src/components/dashboard/DashboardInputField.tsx
+++ b/frontend/src/components/dashboard/DashboardInputField.tsx
@@@ -10,11 -12,12 +12,13 @@@ interface DashboardInputFieldProps
position: number;
onChangeHandler: (value: string, position: number) => void;
value: string | undefined;
- type: 'varName' | 'value';
+ type: 'varName' | 'value' | 'comment';
blurred?: boolean;
isDuplicate?: boolean;
- override?: boolean;
+ isCapitalized?: boolean;
+ overrideEnabled?: boolean;
+ modifyValueOverride?: (value: string | undefined, position: number) => void;
+ isSideBarOpen?: boolean;
}
/**
@@@ -37,8 -42,9 +43,10 @@@ const DashboardInputField = (
value,
blurred,
isDuplicate,
- override,
- isCapitalized
++ isCapitalized,
+ overrideEnabled,
+ modifyValueOverride,
+ isSideBarOpen
}: DashboardInputFieldProps) => {
const ref = useRef<HTMLDivElement | null>(null);
const syncScroll = (e: SyntheticEvent<HTMLDivElement>) => {
@@@ -53,18 -59,22 +61,22 @@@
const error = startsWithNumber || isDuplicate;
return (
- <div className="flex-col w-full">
+ <div className={`relative flex-col w-full h-10 ${
+ error && value !== '' ? 'bg-red/[0.15]' : ''
+ } ${
+ isSideBarOpen && 'bg-mineshaft-700 duration-200'
+ }`}>
<div
- className={`group relative flex flex-col justify-center w-full border ${
- error ? 'border-red' : 'border-mineshaft-500'
- } rounded-md`}
+ className={`group relative flex flex-col justify-center items-center h-full ${
+ error ? 'w-max' : 'w-full'
+ }`}
>
<input
- onChange={(e) => onChangeHandler(e.target.value.toUpperCase(), position)}
+ onChange={(e) => onChangeHandler(isCapitalized ? e.target.value.toUpperCase() : e.target.value, position)}
type={type}
value={value}
- className={`z-10 peer font-mono ph-no-capture bg-bunker-800 rounded-md caret-white text-gray-400 text-md px-2 py-1.5 w-full min-w-16 outline-none focus:ring-2 ${
- error ? 'focus:ring-red/50' : 'focus:ring-primary/50'
+ className={`z-10 peer font-mono ph-no-capture bg-transparent h-full caret-bunker-200 text-sm px-2 w-full min-w-16 outline-none ${
+ error ? 'text-red-600 focus:text-red-500' : 'text-bunker-300 focus:text-bunker-100'
} duration-200`}
spellCheck="false"
/>
@@@ -165,9 -231,8 +233,9 @@@ function inputPropsAreEqual(prev: Dashb
prev.type === next.type &&
prev.position === next.position &&
prev.blurred === next.blurred &&
- prev.override === next.override &&
- prev.isDuplicate === next.isDuplicate &&
- prev.isCapitalized === next.isCapitalized
++ prev.isCapitalized === next.isCapitalized &&
+ prev.overrideEnabled === next.overrideEnabled &&
+ prev.isDuplicate === next.isDuplicate
);
}
diff --cc frontend/src/components/dashboard/KeyPair.tsx
index c7aece86fc,c87dd7f96d..c2f8debefc
--- a/frontend/src/components/dashboard/KeyPair.tsx
+++ b/frontend/src/components/dashboard/KeyPair.tsx
@@@ -14,7 -16,12 +16,13 @@@ interface KeyPairProps
toggleSidebar: (id: string) => void;
sidebarSecretId: string;
isSnapshot: boolean;
+ isCapitalized: boolean;
+ deleteRow?: (props: DeleteRowFunctionProps) => void;
+ }
+
+ export interface DeleteRowFunctionProps {
+ ids: string[];
+ secretName: string;
}
/**
@@@ -40,27 -50,19 +51,21 @@@ const KeyPair = (
isDuplicate,
toggleSidebar,
sidebarSecretId,
- isSnapshot,
- isCapitalized
++ isCapitalized,
+ isSnapshot,
+ deleteRow
}: KeyPairProps) => (
<div
- className={`mx-1 flex flex-col items-center ml-1 ${isSnapshot && 'pointer-events-none'} ${
- keyPair.id === sidebarSecretId && 'bg-mineshaft-500 duration-200'
- } rounded-md`}
+ className={`group flex flex-col items-center border-b border-mineshaft-500 hover:bg-white/[0.03] duration-100 ${isSnapshot && 'pointer-events-none'} ${
+ keyPair.id === sidebarSecretId && 'bg-mineshaft-700 duration-200'
+ }`}
>
- <div className="relative flex flex-row justify-between w-full max-w-5xl mr-auto max-h-14 my-1 items-start px-1">
- {keyPair.valueOverride && (
- <div className="group font-normal group absolute top-[1rem] left-[0.2rem] z-40 inline-block text-gray-300 underline hover:text-primary duration-200">
- <div className="w-1 h-1 rounded-full bg-primary z-40" />
- <span className="absolute z-50 hidden group-hover:flex group-hover:animate-popdown duration-200 w-[10.5rem] -left-[0.4rem] -top-[1.7rem] translate-y-full px-2 py-2 bg-mineshaft-500 rounded-b-md rounded-r-md text-center text-gray-100 text-sm after:content-[''] after:absolute after:left-0 after:bottom-[100%] after:-translate-x-0 after:border-8 after:border-x-transparent after:border-t-transparent after:border-b-mineshaft-500">
- This secret is overriden
- </span>
- </div>
- )}
- <div className="min-w-xl w-96">
- <div className="flex pr-1.5 items-center rounded-lg mt-4 md:mt-0 max-h-16">
+ <div className="relative flex flex-row justify-between w-full mr-auto max-h-14 items-center">
+ <div className='text-bunker-400 text-xs flex items-center justify-center w-14 h-10 cursor-default'>{keyPair.pos + 1}</div>
+ <div className="w-80 border-r border-mineshaft-600">
+ <div className="flex items-center max-h-16">
<DashboardInputField
+ isCapitalized = {isCapitalized}
onChangeHandler={modifyKey}
type="varName"
position={keyPair.pos}