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 title dynamic when deleting folders and secrets
lemmyMwaurade886f8dd07d
diff --git a/frontend/src/views/SecretOverviewPage/components/SelectionPanel/SelectionPanel.tsx b/frontend/src/views/SecretOverviewPage/components/SelectionPanel/SelectionPanel.tsxindex 3d97228c3d..52cc8bb0a3 100644--- a/frontend/src/views/SecretOverviewPage/components/SelectionPanel/SelectionPanel.tsx+++ b/frontend/src/views/SecretOverviewPage/components/SelectionPanel/SelectionPanel.tsx@@ -49,8 +49,9 @@ export const SelectionPanel = ({"bulkDeleteEntries"] as const);- const selectedCount =- Object.keys(selectedEntries.folder).length + Object.keys(selectedEntries.secret).length;+ const selectedFolderCount = Object.keys(selectedEntries.folder).length+ const selectedKeysCount = Object.keys(selectedEntries.secret).length+ const selectedCount = selectedFolderCount + selectedKeysCountconst { currentWorkspace } = useWorkspace();const workspaceId = currentWorkspace?.id || "";@@ -68,6 +69,16 @@ export const SelectionPanel = ({));+ const getDeleteModalTitle = () => {+ if (selectedFolderCount > 0 && selectedKeysCount > 0) {+ return "Do you want to delete the selected secrets and folders across envs?";+ } else if (selectedFolderCount > 0 && selectedKeysCount === 0) {+ return "Do you want to delete the selected folders across envs?";+ } else {+ return "Do you want to delete the selected secrets across envs?";+ }+ }+const handleBulkDelete = async () => {let processedEntries = 0;@@ -180,7 +191,7 @@ export const SelectionPanel = ({<DeleteActionModalisOpen={popUp.bulkDeleteEntries.isOpen}deleteKey="delete"- title="Do you want to delete the selected secrets and folders across envs?"+ title={getDeleteModalTitle()}onChange={(isOpen) => handlePopUpToggle("bulkDeleteEntries", isOpen)}onDeleteApproved={handleBulkDelete}/>