diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx index 9be9f291f..e6a5461e4 100644 --- a/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx +++ b/frontend/src/pages/secret-manager/SecretDashboardPage/SecretDashboardPage.tsx @@ -440,6 +440,7 @@ const Page = () => { onToggleRowType={handleToggleRowType} onClickRollbackMode={() => handlePopUpToggle("snapshots", true)} protectedBranchPolicyName={boardPolicy?.name} + importedBy={importedBy} />
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx index 7b1965878..4c598bfe6 100644 --- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx +++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx @@ -86,6 +86,7 @@ import { CreateDynamicSecretForm } from "./CreateDynamicSecretForm"; import { CreateSecretImportForm } from "./CreateSecretImportForm"; import { FolderForm } from "./FolderForm"; import { MoveSecretsModal } from "./MoveSecretsModal"; +import { CollapsibleSecretImports } from "../SecretListView/CollapsibleSecretImports"; type TParsedEnv = Record; type TParsedFolderEnv = Record< @@ -112,6 +113,14 @@ type Props = { onVisibilityToggle: () => void; onToggleRowType: (rowType: RowType) => void; onClickRollbackMode: () => void; + importedBy?: { + environment: { name: string; slug: string }; + folders: { + name: string; + secrets?: { secretId: string; referencedSecretKey: string }[]; + isImported: boolean; + }[]; + }[]; }; export const ActionBar = ({ @@ -129,7 +138,8 @@ export const ActionBar = ({ onVisibilityToggle, onClickRollbackMode, onToggleRowType, - protectedBranchPolicyName + protectedBranchPolicyName, + importedBy }: Props) => { const { handlePopUpOpen, handlePopUpToggle, handlePopUpClose, popUp } = usePopUp([ "addFolder", @@ -1059,6 +1069,15 @@ export const ActionBar = ({ title="Do you want to delete these secrets?" onChange={(isOpen) => handlePopUpToggle("bulkDeleteSecrets", isOpen)} onDeleteApproved={handleSecretBulkDelete} + formContent={ + importedBy && + importedBy.length > 0 && ( + s.key)} + /> + ) + } /> = ({ importedBy = [], - secretToDelete + secretsToDelete }) => { const { currentWorkspace } = useWorkspace(); @@ -83,7 +83,7 @@ export const CollapsibleSecretImports: React.FC = if (folder.secrets?.length) { folder.secrets.forEach(({ secretId: secret, referencedSecretKey }) => { const secretPath = folder.name === "/" ? `/${secret}` : `${folder.name}/${secret}`; - if (referencedSecretKey === secretToDelete) { + if (secretsToDelete.includes(referencedSecretKey)) { items.push({ type: ItemType.Secret, path: secretPath, diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx index bea2eba2a..bb6420606 100644 --- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx +++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretListView.tsx @@ -372,7 +372,7 @@ export const SecretListView = ({ importedBy.length > 0 && ( ) }