Browse Source

refactor(gui-v2): replace static string literal with enum

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3435/head
Pranav C 2 years ago
parent
commit
5ca48d97f3
  1. 4
      packages/nc-gui-v2/composables/useColumn.ts
  2. 2
      packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue

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

@ -33,7 +33,7 @@ export function useColumn(column: Ref<ColumnType>) {
const isEmail = computed(() => uiDatatype.value === UITypes.Email)
const isAttachment = computed(() => uiDatatype.value === UITypes.Attachment)
const isRating = computed(() => uiDatatype.value === UITypes.Rating)
const isCurrency = computed(() => uiDatatype.value === 'Currency')
const isCurrency = computed(() => uiDatatype.value === UITypes.Currency)
const isPhoneNumber = computed(() => uiDatatype.value === UITypes.PhoneNumber)
const isDecimal = computed(() => uiDatatype.value === UITypes.Decimal)
const isDuration = computed(() => uiDatatype.value === UITypes.Duration)
@ -91,6 +91,6 @@ export function useColumn(column: Ref<ColumnType>) {
isMultiSelect,
isPercent,
isPhoneNumber,
isSpecificDBType
isSpecificDBType,
}
}

2
packages/nc-gui-v2/pages/[projectType]/[projectId]/index/index/index.vue

@ -61,7 +61,7 @@ function onDrop(droppedFiles: File[] | null) {
if (isAllowed) {
const ext = droppedFiles[0].name.split('.').pop()
fileType = (ext === 'csv' || ext === 'json') ? ext : 'excel' as QuickImportTypes
fileType = ext === 'csv' || ext === 'json' ? ext : ('excel' as QuickImportTypes)
}
return isAllowed

Loading…
Cancel
Save