mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-11 01:10:11 +01:00
[FIX] Delete SQL agent connection bug fix (#1635)
fix update agent settings button not appearing when deleting sql connection
This commit is contained in:
parent
3434bf4686
commit
48b7d54b52
@ -9,7 +9,7 @@ export const DB_LOGOS = {
|
|||||||
"sql-server": MSSQLLogo,
|
"sql-server": MSSQLLogo,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function DBConnection({ connection, onRemove }) {
|
export default function DBConnection({ connection, onRemove, setHasChanges }) {
|
||||||
const { database_id, engine } = connection;
|
const { database_id, engine } = connection;
|
||||||
function removeConfirmation() {
|
function removeConfirmation() {
|
||||||
if (
|
if (
|
||||||
@ -20,6 +20,7 @@ export default function DBConnection({ connection, onRemove }) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
onRemove(database_id);
|
onRemove(database_id);
|
||||||
|
setHasChanges(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -9,6 +9,7 @@ export default function AgentSQLConnectorSelection({
|
|||||||
settings,
|
settings,
|
||||||
toggleSkill,
|
toggleSkill,
|
||||||
enabled = false,
|
enabled = false,
|
||||||
|
setHasChanges,
|
||||||
}) {
|
}) {
|
||||||
const { isOpen, openModal, closeModal } = useModal();
|
const { isOpen, openModal, closeModal } = useModal();
|
||||||
const [connections, setConnections] = useState(
|
const [connections, setConnections] = useState(
|
||||||
@ -72,6 +73,7 @@ export default function AgentSQLConnectorSelection({
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
setHasChanges={setHasChanges}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<button
|
<button
|
||||||
|
@ -100,6 +100,7 @@ export default function WorkspaceAgentConfiguration({ workspace }) {
|
|||||||
skills={agentSkills}
|
skills={agentSkills}
|
||||||
toggleAgentSkill={toggleAgentSkill}
|
toggleAgentSkill={toggleAgentSkill}
|
||||||
settings={settings}
|
settings={settings}
|
||||||
|
setHasChanges={setHasChanges}
|
||||||
/>
|
/>
|
||||||
{hasChanges && (
|
{hasChanges && (
|
||||||
<button
|
<button
|
||||||
@ -143,7 +144,7 @@ function LoadingSkeleton() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) {
|
function AvailableAgentSkills({ skills, settings, toggleAgentSkill, setHasChanges }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="flex flex-col mb-8">
|
<div className="flex flex-col mb-8">
|
||||||
@ -211,6 +212,7 @@ function AvailableAgentSkills({ skills, settings, toggleAgentSkill }) {
|
|||||||
settings={settings}
|
settings={settings}
|
||||||
toggleSkill={toggleAgentSkill}
|
toggleSkill={toggleAgentSkill}
|
||||||
enabled={skills.includes("sql-agent")}
|
enabled={skills.includes("sql-agent")}
|
||||||
|
setHasChanges={setHasChanges}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user