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
feat: make secrets overview sortable
danieltoneld6d330265942
diff --git a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsxindex df88d8138c..5f383ba98a 100644--- a/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx+++ b/frontend/src/views/SecretOverviewPage/SecretOverviewPage.tsx@@ -4,7 +4,9 @@ import Link from "next/link";import { useRouter } from "next/router";import { faFolderBlank, faMagnifyingGlass } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { faArrowDown, faArrowUp } from "@fortawesome/free-solid-svg-icons";+import { IconButton } from "@app/components/v2";import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";import NavHeader from "@app/components/navigation/NavHeader";import {@@ -46,6 +48,7 @@ export const SecretOverviewPage = () => {// coz when overflow the table goes to the rightconst parentTableRef = useRef<HTMLTableElement>(null);const [expandableTableWidth, setExpandableTableWidth] = useState(0);+ const [sortDir, setSortDir] = useState<"asc" | "desc">("asc");useEffect(() => {const handleParentTableWidthResize = () => {@@ -219,7 +222,7 @@ export const SecretOverviewPage = () => {const filteredSecretNames = secKeys?.filter((name) =>name.toUpperCase().includes(searchFilter.toUpperCase())- );+ ).sort((a, b) => sortDir === "asc" ? a.localeCompare(b || "") : b.localeCompare(a || ""));const filteredFolderNames = folderNames?.filter((name) =>name.toLowerCase().includes(searchFilter.toLowerCase()));@@ -278,6 +281,9 @@ export const SecretOverviewPage = () => {<Th className="sticky left-0 z-20 min-w-[20rem] border-b-0 p-0"><div className="flex items-center border-b border-r border-mineshaft-600 px-5 pt-4 pb-3.5">Name+ <IconButton variant="plain" className="ml-2" ariaLabel="sort" onClick={() => setSortDir(prev => prev === "asc" ? "desc" : "asc")}>+ <FontAwesomeIcon icon={sortDir === "asc" ? faArrowDown : faArrowUp} />+ </IconButton></div></Th>{userAvailableEnvs?.map(({ name, slug }, index) => {