Skip to content

Commit e658ca7

Browse files
committed
update envd version desing, add compatibility warning
1 parent ebc0f51 commit e658ca7

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

src/features/dashboard/templates/table-cells.tsx

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
useToast,
88
} from '@/lib/hooks/use-toast'
99
import { cn } from '@/lib/utils'
10+
import { isVersionCompatible } from '@/lib/utils/version'
1011
import {
1112
deleteTemplateAction,
1213
updateTemplateAction,
@@ -285,14 +286,37 @@ export function VisibilityCell({
285286
)
286287
}
287288

289+
const INVALID_ENVD_VERSION = '0.0.1'
290+
const SDK_V2_MINIMAL_ENVD_VERSION = '0.2.0'
291+
288292
export function EnvdVersionCell({
289293
getValue,
290294
}: CellContext<Template | DefaultTemplate, unknown>) {
291-
const versionValue = getValue() as string
295+
const valueString = getValue() as string
296+
const versionValue =
297+
valueString && valueString !== INVALID_ENVD_VERSION ? valueString : null
292298

299+
const isNotV2Compatible =
300+
isVersionCompatible(
301+
versionValue ?? INVALID_ENVD_VERSION,
302+
SDK_V2_MINIMAL_ENVD_VERSION
303+
) === false
293304
return (
294-
<span className={cn('text-fg-tertiary whitespace-nowrap font-mono')}>
295-
{versionValue}
296-
</span>
305+
<div
306+
className={cn(
307+
'text-fg-tertiary whitespace-nowrap font-mono flex flex-row gap-1.5',
308+
{
309+
'text-accent-error-highlight': isNotV2Compatible,
310+
}
311+
)}
312+
>
313+
{versionValue ?? 'N/A'}
314+
{isNotV2Compatible && (
315+
<HelpTooltip>
316+
The envd version is not compatible with the SDK v2. To update the envd
317+
version, you need to rebuild the template.
318+
</HelpTooltip>
319+
)}
320+
</div>
297321
)
298322
}

src/features/dashboard/templates/table-config.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ export const useColumns = (deps: unknown[]) => {
142142
{
143143
accessorKey: 'envdVersion',
144144
header: 'Envd Version',
145-
size: 140,
146-
minSize: 100,
145+
size: 125,
146+
minSize: 70,
147147
cell: EnvdVersionCell,
148148
enableSorting: false,
149149
},

0 commit comments

Comments
 (0)