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

Loading…
Cancel
Save