Skip to content

Commit

Permalink
Update settings to toggle auto-detect schema changes notifications
Browse files Browse the repository at this point in the history
- Added toggle auto-detect schema changes notifications
  • Loading branch information
Mark Berger committed Dec 13, 2022
1 parent 6a697c4 commit b49923a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React from "react";
import { DeleteBlock } from "components/common/DeleteBlock";
import { UpdateConnectionDataResidency } from "components/connection/UpdateConnectionDataResidency";

import { useSchemaChanges } from "hooks/connection/useSchemaChanges";
import { PageTrackingCodes, useTrackPage } from "hooks/services/Analytics";
import { useConnectionEditService } from "hooks/services/ConnectionEdit/ConnectionEditService";
import { FeatureItem, useFeature } from "hooks/services/Feature";
Expand All @@ -17,16 +16,16 @@ import { StateBlock } from "./StateBlock";
export const ConnectionSettingsTab: React.FC = () => {
const { connection } = useConnectionEditService();
const { mutateAsync: deleteConnection } = useDeleteConnection();
const { hasSchemaChanges } = useSchemaChanges(connection.schemaChange);
const canUpdateDataResidency = useFeature(FeatureItem.AllowChangeDataGeographies);
const allowAutoDetectSchemaChanges = useFeature(FeatureItem.AllowAutoDetectSchemaChanges);

const [isAdvancedMode] = useAdvancedModeSetting();
useTrackPage(PageTrackingCodes.CONNECTIONS_ITEM_SETTINGS);
const onDelete = () => deleteConnection(connection);

return (
<div className={styles.container}>
{hasSchemaChanges && <SchemaUpdateNotifications />}
{allowAutoDetectSchemaChanges && <SchemaUpdateNotifications />}
{canUpdateDataResidency && <UpdateConnectionDataResidency />}
{isAdvancedMode && <StateBlock connectionId={connection.connectionId} />}
<DeleteBlock type="connection" onDelete={onDelete} />
Expand Down

0 comments on commit b49923a

Please sign in to comment.