From c86b399ac4819d92f1e1ee9f0aa4b37fb82c53d5 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 1 Sep 2022 17:38:16 +0530 Subject: [PATCH] fix(gui-v2): map proper icon form number and specific db type Signed-off-by: Pranav C --- packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue | 3 +++ packages/nc-gui-v2/composables/useColumn.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue b/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue index d4ba8164bd..eb382da5d1 100644 --- a/packages/nc-gui-v2/components/smartsheet-header/CellIcon.vue +++ b/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 PercentIcon from '~icons/mdi/percent-outline' import DecimalIcon from '~icons/mdi/decimal' +import SpecificDBTypeIcon from '~icons/mdi/database-settings' const props = defineProps<{ columnMeta?: ColumnType }>() @@ -78,6 +79,8 @@ const icon = computed(() => { return NumericIcon } else if (additionalColMeta.isString.value) { return StringIcon + } else if (additionalColMeta.isSpecificDBType.value) { + return SpecificDBTypeIcon } else { return GenericIcon } diff --git a/packages/nc-gui-v2/composables/useColumn.ts b/packages/nc-gui-v2/composables/useColumn.ts index 8c14fba84d..07b90f5180 100644 --- a/packages/nc-gui-v2/composables/useColumn.ts +++ b/packages/nc-gui-v2/composables/useColumn.ts @@ -19,7 +19,7 @@ export function useColumn(column: Ref) { const isString = computed(() => uiDatatype.value === UITypes.SingleLineText || abstractType.value === 'string') const isTextArea = computed(() => uiDatatype.value === UITypes.LongText) 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 isYear = computed(() => abstractType.value === 'year' || uiDatatype.value === UITypes.Year) const isTime = computed(() => abstractType.value === 'time' || uiDatatype.value === UITypes.Time) @@ -38,6 +38,7 @@ export function useColumn(column: Ref) { const isDecimal = computed(() => uiDatatype.value === UITypes.Decimal) const isDuration = computed(() => uiDatatype.value === UITypes.Duration) const isPercent = computed(() => uiDatatype.value === UITypes.Percent) + const isSpecificDBType = computed(() => uiDatatype.value === UITypes.SpecificDBType) const isAutoSaved = computed(() => [ UITypes.SingleLineText, @@ -90,5 +91,6 @@ export function useColumn(column: Ref) { isMultiSelect, isPercent, isPhoneNumber, + isSpecificDBType } }