Browse Source

fix: treat Links field as number

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 2 years ago
parent
commit
edb2ddb830
  1. 7
      packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue
  2. 1
      packages/nocodb-sdk/src/lib/UITypes.ts

7
packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { UITypes } from 'nocodb-sdk'
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { import {
@ -80,6 +81,7 @@ const checkTypeFunctions = {
isInt, isInt,
isFloat, isFloat,
isTextArea, isTextArea,
isLinks: (col: ColumnType) => col.uidt === UITypes.Links,
} }
type FilterType = keyof typeof checkTypeFunctions type FilterType = keyof typeof checkTypeFunctions
@ -145,6 +147,7 @@ const componentMap: Partial<Record<FilterType, any>> = $computed(() => {
isDecimal: Decimal, isDecimal: Decimal,
isInt: Integer, isInt: Integer,
isFloat: Float, isFloat: Float,
isLinks: Integer,
} }
}) })
@ -161,6 +164,7 @@ const componentProps = $computed(() => {
case 'isPercent': case 'isPercent':
case 'isDecimal': case 'isDecimal':
case 'isFloat': case 'isFloat':
case 'isLinks':
case 'isInt': { case 'isInt': {
return { class: 'h-32px' } return { class: 'h-32px' }
} }
@ -176,7 +180,8 @@ const componentProps = $computed(() => {
const hasExtraPadding = $computed(() => { const hasExtraPadding = $computed(() => {
return ( return (
column.value && column.value &&
(isInt(column.value, abstractType) || (column.value?.uidt === UITypes.Links ||
isInt(column.value, abstractType) ||
isDate(column.value, abstractType) || isDate(column.value, abstractType) ||
isDateTime(column.value, abstractType) || isDateTime(column.value, abstractType) ||
isTime(column.value, abstractType) || isTime(column.value, abstractType) ||

1
packages/nocodb-sdk/src/lib/UITypes.ts

@ -50,6 +50,7 @@ export const numericUITypes = [
UITypes.Rating, UITypes.Rating,
UITypes.Rollup, UITypes.Rollup,
UITypes.Year, UITypes.Year,
UITypes.Links,
]; ];
export function isNumericCol( export function isNumericCol(

Loading…
Cancel
Save