diff --git a/ui/app/mirrors/create/cdc/fields.tsx b/ui/app/mirrors/create/cdc/fields.tsx index a401c3be24..19518e2e42 100644 --- a/ui/app/mirrors/create/cdc/fields.tsx +++ b/ui/app/mirrors/create/cdc/fields.tsx @@ -25,6 +25,7 @@ const CDCFields = ({ setting, handleChange }: FieldProps) => { }} > handleChange(state, setting)} /> {setting.tips && ( @@ -52,7 +53,7 @@ const CDCFields = ({ setting, handleChange }: FieldProps) => { ) => handleChange(e.target.value, setting) } diff --git a/ui/app/mirrors/create/helpers/cdc.ts b/ui/app/mirrors/create/helpers/cdc.ts index 88d39a6dc8..3cf35d4c92 100644 --- a/ui/app/mirrors/create/helpers/cdc.ts +++ b/ui/app/mirrors/create/helpers/cdc.ts @@ -6,10 +6,11 @@ export const cdcSettings: MirrorSetting[] = [ stateHandler: (value, setter) => setter((curr: CDCConfig) => ({ ...curr, - doInitialCopy: (value as boolean) || false, + doInitialCopy: (value as boolean) || true, })), tips: 'Specify if you want initial load to happen for your tables.', type: 'switch', + default: true, }, { label: 'Pull Batch Size', diff --git a/ui/app/mirrors/create/helpers/common.ts b/ui/app/mirrors/create/helpers/common.ts index 15f0607920..f68e72c479 100644 --- a/ui/app/mirrors/create/helpers/common.ts +++ b/ui/app/mirrors/create/helpers/common.ts @@ -15,7 +15,7 @@ export interface MirrorSetting { required?: boolean; tips?: string; helpfulLink?: string; - default?: string | number; + default?: string | number | boolean; advanced?: boolean; // whether it should come under an 'Advanced' section } @@ -29,7 +29,7 @@ export const blankCDCSetting: FlowConnectionConfigs = { tableNameSchemaMapping: {}, metadataPeer: undefined, maxBatchSize: 100000, - doInitialCopy: false, + doInitialCopy: true, publicationName: '', snapshotNumRowsPerPartition: 500000, snapshotMaxParallelWorkers: 1, diff --git a/ui/app/mirrors/create/qrep/qrep.tsx b/ui/app/mirrors/create/qrep/qrep.tsx index 9dd7943b80..bfabd6a3ce 100644 --- a/ui/app/mirrors/create/qrep/qrep.tsx +++ b/ui/app/mirrors/create/qrep/qrep.tsx @@ -285,7 +285,7 @@ export default function QRepConfigForm({ defaultValue={ setting.label === 'Destination Table Name' ? mirrorConfig.destinationTableIdentifier - : setting.default + : (setting.default as string) } onChange={(e: React.ChangeEvent) => handleChange(e.target.value, setting) diff --git a/ui/app/mirrors/edit/[mirrorId]/cdc.tsx b/ui/app/mirrors/edit/[mirrorId]/cdc.tsx index 8c33fa7c9b..ba981539e4 100644 --- a/ui/app/mirrors/edit/[mirrorId]/cdc.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/cdc.tsx @@ -1,5 +1,4 @@ 'use client'; - import { SyncStatusRow } from '@/app/dto/MirrorsDTO'; import TimeLabel from '@/components/TimeComponent'; import { @@ -275,7 +274,13 @@ export function CDCMirror({ createdAt, syncStatusChild, }: CDCMirrorStatusProps) { - const [selectedTab, setSelectedTab] = useState(''); + const [selectedTab, setSelectedTab] = useState(-1); + const LocalStorageTabKey = 'cdctab'; + + const handleTab = (index: number) => { + localStorage.setItem(LocalStorageTabKey, index.toString()); + setSelectedTab(index); + }; let snapshot = <>; if (cdc.snapshotStatus) { @@ -284,12 +289,18 @@ export function CDCMirror({ useEffect(() => { if (typeof window !== 'undefined') { - setSelectedTab(localStorage?.getItem('mirrortab') || 'tab1'); + setSelectedTab( + parseInt(localStorage?.getItem(LocalStorageTabKey) || '0') + ); } }, []); return ( - + @@ -70,9 +71,7 @@ export function CDCFlows({ cdcFlows }: { cdcFlows: any }) { {mirrors.map((flow: any) => ( - + ( - + { + const [isLoading, setIsLoading] = useState(false); + return ( +
setIsLoading(true)}> + {isLoading ? ( + + ) : ( + + + + )} +
+ ); +}; +export default MirrorLink;