Skip to content

Commit

Permalink
[apache#1611] fix(web): fix click tree table error (apache#1612)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Fix the issue of clicking on the `table` in the tree list.

After: when clicked the `hive-schema-table` on the tree view.
<img width="1040" alt="image"
src="https://github.com/datastrato/gravitino/assets/17310559/ae534b7e-0288-4cff-a1b7-5874b5c461d0">


### Why are the changes needed?

Fix: apache#1611

### Does this PR introduce _any_ user-facing change?

N/A

### How was this patch tested?

N/A
  • Loading branch information
ch3yne authored Jan 19, 2024
1 parent d25834c commit f145099
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

0 comments on commit f145099

Please sign in to comment.