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,
|
||||
};
|
||||
|
||||
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 (
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user