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
fix(pam): share transaction state across all query tabs
bernie-g8fa0af7d6a0b
diff --git a/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx b/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsxindex d75e606168..8022a627ba 100644--- a/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx+++ b/frontend/src/pages/pam/PamDataExplorerPage/PamDataExplorerPage.tsx@@ -62,6 +62,7 @@ export const PamDataExplorerPage = () => {const [approvalJustification, setApprovalJustification] = useState("");const { tabs, activeTabId, atTabLimit, addTab, closeTab, setActiveTab, updateTabSql } = useQueryTabs();+ const [isInTransaction, setIsInTransaction] = useState(false);const {isConnected,@@ -505,7 +506,9 @@ export const PamDataExplorerPage = () => {executeQuery={executeQuery}cancelQuery={cancelQuery}tableDetail={tableDetail}+ isInTransaction={isInTransaction}onSqlChange={(sql) => updateTabSql(tab.id, sql)}+ onTransactionStateChange={setIsInTransaction}/></div>))}diff --git a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryPanel.tsx b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryPanel.tsxindex 8d74d3c56d..dc1820c6c7 100644--- a/frontend/src/pages/pam/PamDataExplorerPage/components/QueryPanel.tsx+++ b/frontend/src/pages/pam/PamDataExplorerPage/components/QueryPanel.tsx@@ -23,15 +23,16 @@ type Props = {executeQuery: (sql: string) => Promise<QueryResult>;cancelQuery: () => void;tableDetail: TableDetail | null;+ isInTransaction: boolean;onSqlChange: (sql: string) => void;+ onTransactionStateChange: (open: boolean) => void;};-export function QueryPanel({ tab, executeQuery, cancelQuery, tableDetail, onSqlChange }: Props) {+export function QueryPanel({ tab, executeQuery, cancelQuery, tableDetail, isInTransaction, onSqlChange, onTransactionStateChange }: Props) {const [isRunning, setIsRunning] = useState(false);const [result, setResult] = useState<QueryResult | null>(null);const [error, setError] = useState<string | null>(null);const [isDragging, setIsDragging] = useState(false);- const [isInTransaction, setIsInTransaction] = useState(false);const [hasSelection, setHasSelection] = useState(false);const sqlToRunRef = useRef<string>(tab.sql);@@ -50,10 +51,10 @@ export function QueryPanel({ tab, executeQuery, cancelQuery, tableDetail, onSqlCsetError(null);try {const res = await executeQuery(sqlToRun);- setIsInTransaction(res.transactionOpen);+ onTransactionStateChange(res.transactionOpen);setResult(res);} catch (err) {- setIsInTransaction(false);+ onTransactionStateChange(false);setError(err instanceof Error ? err.message : String(err));setResult(null);} finally {