Skip to content

Commit 8538ce1

Browse files
authored
chore(vscode): further clean up of types (#4470)
1 parent 4abce1e commit 8538ce1

5 files changed

Lines changed: 6 additions & 25 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function ModelLineageDetails({
6767
className="mr-2 w-full whitespace-nowrap text-ellipsis overflow-hidden @lg:block font-bold text-neutral-600 dark:text-neutral-400 cursor-pointer hover:underline"
6868
onClick={handleCenter}
6969
>
70-
{truncate(model.displayName, 50, 25)}
70+
{truncate(model.name, 50, 25)}
7171
</a>
7272
)}
7373
<span className="bg-neutral-5 px-2 py-0.5 flex rounded-full mr-2">

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { isNil, isArrayNotEmpty, isNotNil, isFalse } from '@/utils/index'
22
import clsx from 'clsx'
33
import { useMemo, useCallback, useState } from 'react'
4-
import { ModelType } from '@/api/client'
4+
import { ModelType, type Model } from '@/api/client'
55
import { useLineageFlow } from './context'
66
import { type GraphNodeData } from './help'
77
import { Position, type NodeProps } from 'reactflow'
88
import { type Column } from '@/api/client'
99
import ModelNodeHeaderHandles from './ModelNodeHeaderHandles'
1010
import ModelColumns from './ModelColumns'
11-
import type { Model } from '@/domain/model'
1211

1312
export const EnumLineageNodeModelType = {
1413
...ModelType,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Column } from '@/api/client'
1+
import { type Column, type Model } from '@/api/client'
22
import {
33
createContext,
44
useState,
@@ -11,7 +11,7 @@ import { EnumSide } from './types'
1111
import { type Node } from 'reactflow'
1212
import type { Lineage } from '@/domain/lineage'
1313
import type { ModelSQLMeshModel } from '@/domain/sqlmesh-model'
14-
import type { Model } from '@/domain/model'
14+
1515
export interface Connections {
1616
left: string[]
1717
right: string[]

vscode/react/src/domain/model.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

vscode/react/src/pages/lineage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ModelSQLMeshModel } from '@/domain/sqlmesh-model'
1414
import { useEventBus } from '@/hooks/eventBus'
1515
import type { VSCodeEvent } from '@bus/callbacks'
1616
import { URI } from 'vscode-uri'
17-
import type { Model } from '@/domain/model'
17+
import type { Model } from '@/api/client'
1818

1919
export function LineagePage() {
2020
const { emit } = useEventBus()
@@ -91,7 +91,6 @@ function Lineage() {
9191
}
9292
const modelsRecord = models.reduce(
9393
(acc, model) => {
94-
// @ts-ignore
9594
acc[model.name] = model
9695
return acc
9796
},
@@ -130,7 +129,7 @@ export function LineageComponentFromWeb({
130129
function handleClickModel(id: string): void {
131130
console.log('handling click', id)
132131
const decodedId = decodeURIComponent(id)
133-
const model = Object.values(models).find((m: Model) => m.fqn === decodedId)
132+
const model = Object.values(models).find(m => m.fqn === decodedId)
134133
if (!model) {
135134
throw new Error('Model not found')
136135
}

0 commit comments

Comments
 (0)