[FIX] Delete SQL agent connection bug fix (#1635)

fix update agent settings button not appearing when deleting sql connection
This commit is contained in:
Sean Hatfield 2024-06-07 12:03:48 -07:00 committed by GitHub
parent 3434bf4686
commit 48b7d54b52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@ export const DB_LOGOS = {
"sql-server": MSSQLLogo,
};
export default function DBConnection({ connection, onRemove }) {
export default function DBConnection({ connection, onRemove, setHasChanges }) {
const { database_id, engine } = connection;
function removeConfirmation() {
if (
@ -20,6 +20,7 @@ export default function DBConnection({ connection, onRemove }) {
return false;
}
onRemove(database_id);
setHasChanges(true);
}
return (

View File

@ -9,6 +9,7 @@ export default function AgentSQLConnectorSelection({
settings,
toggleSkill,
enabled = false,
setHasChanges,
}) {
const { isOpen, openModal, closeModal } = useModal();
const [connections, setConnections] = useState(
@ -72,6 +73,7 @@ export default function AgentSQLConnectorSelection({
})
);
}}
setHasChanges={setHasChanges}
/>
))}
<button

View File

@ -100,6 +100,7 @@ export default function WorkspaceAgentConfiguration({ workspace }) {
skills={agentSkills}
toggleAgentSkill={toggleAgentSkill}
settings={settings}
setHasChanges={setHasChanges}
/>
{hasChanges && (
<button
@ -143,7 +144,7 @@ function LoadingSkeleton() {
);
}
function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) {
function AvailableAgentSkills({ skills, settings, toggleAgentSkill, setHasChanges }) {
return (
<div>
<div className="flex flex-col mb-8">
@ -211,6 +212,7 @@ function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) {
settings={settings}
toggleSkill={toggleAgentSkill}
enabled={skills.includes("sql-agent")}
setHasChanges={setHasChanges}
/>
</div>
</div>