Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1611] fix(web): fix click tree table error #1612

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions web/components/ColumnTypeChip.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import { alpha } from '@/lib/utils/color'
import { isString } from 'lodash-es'

const ColumnTypeChip = props => {
const { type } = props
const { type = '' } = props

const label = isString(type) ? type : `${type.type}<${type.elementType ?? 'unknown'}>` ?? 'unknown'
const formatType = type && isString(type) ? type.replace(/\(.*\)/, '') : type

const columnTypeColor = ColumnTypeColorEnum[type] || 'secondary'
const label = isString(type) ? type : `${type?.type}<${type?.elementType ?? 'unknown'}>` ?? 'unknown'

const columnTypeColor = ColumnTypeColorEnum[formatType] || 'secondary'
const color = colors[columnTypeColor]?.main || '#8592A3'
const bgColor = alpha(color, 0.1)

Expand Down
8 changes: 4 additions & 4 deletions web/lib/enums/columnTypeEnum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export enum ColumnTypeColorEnum {
long = 'primary',
float = 'primary',
double = 'primary',
'decimal(10,2)' = 'primary',
'fixed(16)' = 'primary',
decimal = 'primary',
fixed = 'primary',

date = 'info',
time = 'info',
Expand All @@ -21,8 +21,8 @@ export enum ColumnTypeColorEnum {
interval_year = 'info',

string = 'warning',
'char(10)' = 'warning',
'varchar(10)' = 'warning',
char = 'warning',
varchar = 'warning',

byte = 'success',
uuid = 'success',
Expand Down
Loading