Skip to content

Commit 538d5ca

Browse files
🪟 🐛 Fixes getAvailableSyncModesOptions function to return intersection of sync mode options (#22310)
* Fixes getAvailableSyncModesOptions function to return intersection of sync mode options * Fixes getAvailableSyncModesOptions function unit test
1 parent dcde74d commit 538d5ca

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ describe("<BulkEditPanel />", () => {
210210

211211
it("getAvailableSyncModesOptions should work correctly", () => {
212212
const expectedResult: SyncModeOption[] = [
213-
{ value: { syncMode: "incremental", destinationSyncMode: "append_dedup" } },
214213
{ value: { syncMode: "full_refresh", destinationSyncMode: "overwrite" } },
215-
{ value: { syncMode: "incremental", destinationSyncMode: "append" } },
216214
{ value: { syncMode: "full_refresh", destinationSyncMode: "append" } },
217215
];
218216
const actualResult = getAvailableSyncModesOptions(

airbyte-webapp/src/components/connection/CatalogTree/next/BulkEditPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const getAvailableSyncModesOptions = (
6666
syncModes?: DestinationSyncMode[]
6767
): SyncModeOption[] =>
6868
SUPPORTED_MODES.filter(([syncMode, destinationSyncMode]) => {
69-
const supportableModes = intersection(nodes.flatMap((n) => n.stream?.supportedSyncModes));
69+
const supportableModes = intersection(...nodes.map((n) => n.stream?.supportedSyncModes));
7070
return supportableModes.includes(syncMode) && syncModes?.includes(destinationSyncMode);
7171
}).map(([syncMode, destinationSyncMode]) => ({
7272
value: { syncMode, destinationSyncMode },

0 commit comments

Comments
 (0)