Skip to content

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

misc: more feedback

Sheen Capadnganf057a0bb2639
diff --git a/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx b/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
index 65a8d7724e..932a1bfcf1 100644
--- a/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
+++ b/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
@@ -5,8 +5,11 @@ import {
Field,
FieldContent,
FieldLabel,
- Label,
- Switch,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
UnstableIconButton,
UnstableInput
} from "@app/components/v3";
@@ -84,17 +87,18 @@ export const RotationRuleCard = ({
<div className="flex w-full flex-col gap-2">
<div className="flex items-center gap-2">
<span className="mr-1 text-lg font-medium text-muted">{index + 1}</span>
- <Switch
- id={`rule-enabled-${rule.id}`}
- checked={rule.enabled}
- onCheckedChange={(checked) => onUpdate({ enabled: checked })}
- variant="project"
- />
- {rule.enabled ? (
- <Label>Rotate</Label>
- ) : (
- <Label className="opacity-50">Do Not Rotate</Label>
- )}
+ <Select
+ value={rule.enabled ? "include" : "exclude"}
+ onValueChange={(value) => onUpdate({ enabled: value === "include" })}
+ >
+ <SelectTrigger className="w-36">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="include">Rotate</SelectItem>
+ <SelectItem value="exclude">Do Not Rotate</SelectItem>
+ </SelectContent>
+ </Select>
</div>
<Field>
<FieldLabel>Rule Name</FieldLabel>
diff --git a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
index 0a654a0502..fbb36ce08d 100644
--- a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
+++ b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
@@ -1,7 +1,8 @@
-import { useMemo } from "react";
+import { useMemo, useState } from "react";
+import { SearchIcon } from "lucide-react";
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
-import { Button, Label } from "@app/components/v3";
+import { Button, InputGroup, InputGroupAddon, InputGroupInput, Label } from "@app/components/v3";
import { usePopUp } from "@app/hooks";
import {
PAM_RESOURCE_TYPE_MAP,
@@ -32,6 +33,7 @@ const COMING_SOON_SET = new Set(COMING_SOON_RESOURCES.map((r) => r.resource));
export const ResourceTypeSelect = ({ onSelect }: Props) => {
const { isPending, data: resourceOptions } = useListPamResourceOptions();
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const);
+ const [search, setSearch] = useState("");
const allOptions = useMemo(() => {
if (!resourceOptions) return [];
@@ -40,6 +42,15 @@ export const ResourceTypeSelect = ({ onSelect }: Props) => {
);
}, [resourceOptions]);
+ const filteredOptions = useMemo(() => {
+ if (!search.trim()) return allOptions;
+ const searchLower = search.toLowerCase();
+ return allOptions.filter((option) => {
+ const details = PAM_RESOURCE_TYPE_MAP[option.resource];
+ return details.name.toLowerCase().includes(searchLower);
+ });
+ }, [allOptions, search]);
+
const handleResourceSelect = (resource: PamResourceType) => {
if (COMING_SOON_SET.has(resource)) {
handlePopUpOpen("upgradePlan", {
@@ -62,28 +73,48 @@ export const ResourceTypeSelect = ({ onSelect }: Props) => {
return (
<>
- <div className="flex overflow-y-auto">
- <div className="flex h-fit w-full flex-col gap-2 p-4">
- {allOptions.map((option) => {
- const details = PAM_RESOURCE_TYPE_MAP[option.resource];
+ <div className="flex flex-col overflow-hidden">
+ <div className="p-4 pb-2">
+ <InputGroup>
+ <InputGroupAddon>
+ <SearchIcon className="size-4" />
+ </InputGroupAddon>
+ <InputGroupInput
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ placeholder="Search resources..."
+ />
+ </InputGroup>
+ </div>
+ <div className="flex flex-1 overflow-y-auto">
+ <div className="flex h-fit w-full flex-col gap-2 p-4 pt-2">
+ {filteredOptions.length === 0 ? (
+ <div className="flex items-center justify-center py-8 text-sm text-muted">
+ No resources found
+ </div>
+ ) : (
+ filteredOptions.map((option) => {
+ const details = PAM_RESOURCE_TYPE_MAP[option.resource];
- return (
- <Button
- key={option.resource}
- onClick={() => handleResourceSelect(option.resource)}
- size="lg"
- variant="neutral"
- className="w-full justify-start"
- >
- <img
- src={`/images/integrations/${details.image}`}
- className="size-6"
- alt={`${details.name} logo`}
- />
- <Label className="pointer-events-none">{details.name}</Label>
- </Button>
- );
- })}
+ return (
+ <Button
+ key={option.resource}
+ onClick={() => handleResourceSelect(option.resource)}
+ size="lg"
+ variant="neutral"
+ className="w-full justify-start"
+ >
+ <img
+ src={`/images/integrations/${details.image}`}
+ className="size-6"
+ alt={`${details.name} logo`}
+ />
+ <Label className="pointer-events-none">{details.name}</Label>
+ </Button>
+ );
+ })
+ )}
+ </div>
</div>
</div>
<UpgradePlanModal