Skip to content

Commit 3e272e7

Browse files
committed
feat(vscode): add ability to turn on/off columns
1 parent d1d76e7 commit 3e272e7

3 files changed

Lines changed: 33 additions & 7 deletions

File tree

vscode/extension/tests/lineage_settings.spec.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { test } from '@playwright/test'
1+
import { test, expect } from '@playwright/test'
22
import path from 'path'
33
import fs from 'fs-extra'
44
import os from 'os'
55
import { openLineageView, SUSHI_SOURCE_PATH } from './utils'
66
import { startCodeServer, stopCodeServer } from './utils_code_server'
77

8-
test('Turn on and off show columns', async ({ page }) => {
8+
test('Settings button is visible in the lineage view', async ({ page }) => {
99
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-test-sushi-'))
1010
await fs.copy(SUSHI_SOURCE_PATH, tempDir)
1111

@@ -34,7 +34,32 @@ test('Turn on and off show columns', async ({ page }) => {
3434
// Open lineage
3535
await openLineageView(page)
3636

37-
await page.locator('iframe >> nth=1 >> button').click()
37+
const iframes = page.locator('iframe')
38+
const iframeCount = await iframes.count()
39+
let settingsCount = 0
40+
41+
for (let i = 0; i < iframeCount; i++) {
42+
const iframe = iframes.nth(i)
43+
const contentFrame = iframe.contentFrame()
44+
if (contentFrame) {
45+
const activeFrame = contentFrame.locator('#active-frame').contentFrame()
46+
if (activeFrame) {
47+
try {
48+
await activeFrame
49+
.getByRole('button', {
50+
name: 'Settings',
51+
})
52+
.waitFor({ timeout: 1000 })
53+
settingsCount++
54+
} catch {
55+
// Continue to next iframe if this one doesn't have the error
56+
continue
57+
}
58+
}
59+
}
60+
}
61+
62+
expect(settingsCount).toBeGreaterThan(0)
3863
} finally {
3964
await stopCodeServer(context)
4065
}

vscode/react/src/components/graph/ModelNode.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ export default function ModelNode({
141141
const isModelExternal = nodeType === EnumLineageNodeModelType.external
142142
const isModelSeed = nodeType === EnumLineageNodeModelType.seed
143143
const isModelUnknown = nodeType === EnumLineageNodeModelType.unknown
144-
const showColumns = nodeData.withColumns && isArrayNotEmpty(columns) && isFalse(hasHighlightedNodes)
144+
const showColumns =
145+
nodeData.withColumns &&
146+
isArrayNotEmpty(columns) &&
147+
isFalse(hasHighlightedNodes)
145148
const isActiveNode =
146149
selectedNodes.size > 0 || activeNodes.size > 0 || withConnected
147150
? isSelected ||

vscode/react/src/components/graph/SettingsControl.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import {
2-
Menu,
3-
} from '@headlessui/react'
1+
import { Menu } from '@headlessui/react'
42
import { CheckIcon } from '@heroicons/react/24/outline'
53
import { CogIcon } from '@/components/graph/CogIcon'
64
import clsx from 'clsx'

0 commit comments

Comments
 (0)