Browse Source

fix(gui-v2): map proper icon form number and specific db type

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3435/head
Pranav C 2 years ago
parent
commit
c86b399ac4
  1. 3
      packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue
  2. 4
      packages/nc-gui-v2/composables/useColumn.ts

3
packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue

@ -25,6 +25,7 @@ import EmailIcon from '~icons/mdi/email'
import CurrencyIcon from '~icons/mdi/currency-usd-circle-outline' import CurrencyIcon from '~icons/mdi/currency-usd-circle-outline'
import PercentIcon from '~icons/mdi/percent-outline' import PercentIcon from '~icons/mdi/percent-outline'
import DecimalIcon from '~icons/mdi/decimal' import DecimalIcon from '~icons/mdi/decimal'
import SpecificDBTypeIcon from '~icons/mdi/database-settings'
const props = defineProps<{ columnMeta?: ColumnType }>() const props = defineProps<{ columnMeta?: ColumnType }>()
@ -78,6 +79,8 @@ const icon = computed(() => {
return NumericIcon return NumericIcon
} else if (additionalColMeta.isString.value) { } else if (additionalColMeta.isString.value) {
return StringIcon return StringIcon
} else if (additionalColMeta.isSpecificDBType.value) {
return SpecificDBTypeIcon
} else { } else {
return GenericIcon return GenericIcon
} }

4
packages/nc-gui-v2/composables/useColumn.ts

@ -19,7 +19,7 @@ export function useColumn(column: Ref<ColumnType>) {
const isString = computed(() => uiDatatype.value === UITypes.SingleLineText || abstractType.value === 'string') const isString = computed(() => uiDatatype.value === UITypes.SingleLineText || abstractType.value === 'string')
const isTextArea = computed(() => uiDatatype.value === UITypes.LongText) const isTextArea = computed(() => uiDatatype.value === UITypes.LongText)
const isInt = computed(() => abstractType.value === 'integer') const isInt = computed(() => abstractType.value === 'integer')
const isFloat = computed(() => abstractType.value === 'float') const isFloat = computed(() => abstractType.value === 'float' || abstractType.value === UITypes.Number)
const isDate = computed(() => abstractType.value === 'date' || uiDatatype.value === UITypes.Date) const isDate = computed(() => abstractType.value === 'date' || uiDatatype.value === UITypes.Date)
const isYear = computed(() => abstractType.value === 'year' || uiDatatype.value === UITypes.Year) const isYear = computed(() => abstractType.value === 'year' || uiDatatype.value === UITypes.Year)
const isTime = computed(() => abstractType.value === 'time' || uiDatatype.value === UITypes.Time) const isTime = computed(() => abstractType.value === 'time' || uiDatatype.value === UITypes.Time)
@ -38,6 +38,7 @@ export function useColumn(column: Ref<ColumnType>) {
const isDecimal = computed(() => uiDatatype.value === UITypes.Decimal) const isDecimal = computed(() => uiDatatype.value === UITypes.Decimal)
const isDuration = computed(() => uiDatatype.value === UITypes.Duration) const isDuration = computed(() => uiDatatype.value === UITypes.Duration)
const isPercent = computed(() => uiDatatype.value === UITypes.Percent) const isPercent = computed(() => uiDatatype.value === UITypes.Percent)
const isSpecificDBType = computed(() => uiDatatype.value === UITypes.SpecificDBType)
const isAutoSaved = computed(() => const isAutoSaved = computed(() =>
[ [
UITypes.SingleLineText, UITypes.SingleLineText,
@ -90,5 +91,6 @@ export function useColumn(column: Ref<ColumnType>) {
isMultiSelect, isMultiSelect,
isPercent, isPercent,
isPhoneNumber, isPhoneNumber,
isSpecificDBType
} }
} }

Loading…
Cancel
Save