Skip to content

Commit 5274934

Browse files
committed
temp
1 parent ef3ce7e commit 5274934

2 files changed

Lines changed: 63 additions & 39 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { test } from '@playwright/test'
2+
import path from 'path'
3+
import fs from 'fs-extra'
4+
import os from 'os'
5+
import { openLineageView, SUSHI_SOURCE_PATH } from './utils'
6+
import { startCodeServer, stopCodeServer } from './utils_code_server'
7+
8+
test('Turn on and off show columns', async ({ page }) => {
9+
const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-test-sushi-'))
10+
await fs.copy(SUSHI_SOURCE_PATH, tempDir)
11+
12+
const context = await startCodeServer({
13+
tempDir,
14+
placeFileWithPythonInterpreter: true,
15+
})
16+
17+
try {
18+
await page.goto(`http://127.0.0.1:${context.codeServerPort}`)
19+
20+
await page.waitForSelector('text=models')
21+
22+
// Click on the models folder, excluding external_models
23+
await page
24+
.getByRole('treeitem', { name: 'models', exact: true })
25+
.locator('a')
26+
.click()
27+
// Open the waiters.py model
28+
await page
29+
.getByRole('treeitem', { name: 'waiters.py', exact: true })
30+
.locator('a')
31+
.click()
32+
await page.waitForSelector('text=Loaded SQLMesh Context')
33+
34+
// Open lineage
35+
await openLineageView(page)
36+
37+
await page.locator('iframe >> nth=1 >> button').click()
38+
} finally {
39+
await stopCodeServer(context)
40+
}
41+
})
Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import { Fragment } from 'react'
21
import {
32
Menu,
4-
Button,
5-
Transition,
6-
MenuItems,
7-
MenuItem,
83
} from '@headlessui/react'
94
import { CheckIcon } from '@heroicons/react/24/outline'
105
import { CogIcon } from '@/components/graph/CogIcon'
@@ -33,41 +28,29 @@ export function SettingsControl({
3328
aria-hidden="true"
3429
/>
3530
</Menu.Button>
36-
<Transition
37-
as={Fragment}
38-
enter="transition ease-out duration-100"
39-
enterFrom="transform opacity-0 scale-95"
40-
enterTo="transform opacity-100 scale-100"
41-
leave="transition ease-in duration-75"
42-
leaveFrom="transform opacity-100 scale-100"
43-
leaveTo="transform opacity-0 scale-95"
44-
>
45-
<Menu.Items className="absolute bottom-full mb-2 left-0 w-56 origin-bottom-left divide-y divide-neutral-100 dark:divide-neutral-800 rounded-md bg-theme shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-50">
46-
<div className="px-1 py-1">
47-
<Menu.Item>
48-
{({ active }) => (
49-
<button
50-
className={clsx(
51-
'group flex w-full items-center rounded-md px-2 py-2 text-sm',
52-
active
53-
? 'bg-primary-10 text-primary-500'
54-
: 'text-neutral-700 dark:text-neutral-300',
55-
)}
56-
onClick={() => onWithColumnsChange(!showColumns)}
57-
>
58-
<span className="flex-1 text-left">Show Columns</span>
59-
{showColumns && (
60-
<CheckIcon
61-
className="h-4 w-4 text-primary-500"
62-
aria-hidden="true"
63-
/>
64-
)}
65-
</button>
31+
<Menu.Items className="absolute bottom-0 left-full ml-2 w-56 origin-bottom-left divide-y bg-theme shadow-lg focus:outline-none z-50">
32+
<Menu.Item>
33+
{({ active }) => (
34+
<button
35+
className={clsx(
36+
'group flex w-full items-center px-2 py-1 text-sm',
37+
active
38+
? 'text-[var(--vscode-foreground)] bg-[var(--vscode-button-background)]'
39+
: 'bg-[var(--vscode-button-hoverBackground)] text-[var(--vscode-foreground)]',
40+
)}
41+
onClick={() => onWithColumnsChange(!showColumns)}
42+
>
43+
<span className="flex-1 text-left">Show Columns</span>
44+
{showColumns && (
45+
<CheckIcon
46+
className="h-4 w-4 text-primary-500"
47+
aria-hidden="true"
48+
/>
6649
)}
67-
</Menu.Item>
68-
</div>
69-
</Menu.Items>
70-
</Transition>
50+
</button>
51+
)}
52+
</Menu.Item>
53+
</Menu.Items>
7154
</Menu>
7255
)
7356
}

0 commit comments

Comments
 (0)