Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions frontend/src/base/components/environment/CreateConnection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ const CreateConnection = ({
getConnectionFields();
}, [getConnectionFields]);

const hasDetailsChanged = useMemo(() => {
if (!connectionId || !originalDbSelectionInfo) return false;
return (
formName !== originalDbSelectionInfo.name ||
formDescription !== originalDbSelectionInfo.description
);
}, [connectionId, formName, formDescription, originalDbSelectionInfo]);

const handleCreateOrUpdate = useCallback(async () => {
setIsCreateOrUpdateLoading(true);
try {
Expand Down Expand Up @@ -407,15 +415,6 @@ const CreateConnection = ({
[dbSelectionInfo.datasource_name, selectedOrgId, csrfToken, connType]
);

// Detect if connection name or description changed (metadata-only changes)
const hasDetailsChanged = useMemo(() => {
if (!connectionId || !originalDbSelectionInfo) return false;
return (
formName !== originalDbSelectionInfo.name ||
formDescription !== originalDbSelectionInfo.description
);
}, [connectionId, formName, formDescription, originalDbSelectionInfo]);

const mappedDataSources = useMemo(
() =>
dataSources.map((dSource) => ({
Expand Down
Loading