Browse Source

qrcode: ignore qr fields for Form View and add more allowed QR value types

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
4cc610bebf
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 6
      packages/nc-gui/components/smartsheet/Form.vue
  2. 9
      packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue
  3. 2
      packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

6
packages/nc-gui/components/smartsheet/Form.vue

@ -73,7 +73,7 @@ const { syncLTARRefs, row } = useProvideSmartsheetRowStore(
}), }),
) )
const columns = computed(() => meta?.value?.columns || []) const columns = computed(() => meta?.value?.columns?.filter((col) => col.uidt !== UITypes.QrCode) || [])
const localColumns = ref<Record<string, any>[]>([]) const localColumns = ref<Record<string, any>[]>([])
@ -228,7 +228,7 @@ async function addAllColumns() {
} }
function shouldSkipColumn(col: Record<string, any>) { function shouldSkipColumn(col: Record<string, any>) {
return isDbRequired(col) || !!col.required || (!!col.rqd && !col.cdf) return isDbRequired(col) || !!col.required || (!!col.rqd && !col.cdf) || col.uidt === UITypes.QrCode
} }
async function removeAllColumns() { async function removeAllColumns() {
@ -257,7 +257,7 @@ async function checkSMTPStatus() {
} }
function setFormData() { function setFormData() {
const col = (formColumnData as Record<string, any>)?.value const col = (formColumnData as Record<string, any>)?.value.filter((c: Record<string, any>) => c.uidt !== UITypes.QrCode)
formViewData.value = { formViewData.value = {
...formViewData.value, ...formViewData.value,

9
packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue

@ -20,7 +20,14 @@ const vModel = useVModel(props, 'value', emit)
const { setAdditionalValidations, validateInfos, column } = useColumnCreateStoreOrThrow() const { setAdditionalValidations, validateInfos, column } = useColumnCreateStoreOrThrow()
const allowedColumnTypesForQrValue = [UITypes.Formula, UITypes.SingleLineText, UITypes.LongText] as string[] const allowedColumnTypesForQrValue = [
UITypes.Formula,
UITypes.SingleLineText,
UITypes.LongText,
UITypes.PhoneNumber,
UITypes.URL,
UITypes.Email,
] as string[]
const columnsAllowedAsQrValue = computed<SelectProps['options']>(() => { const columnsAllowedAsQrValue = computed<SelectProps['options']>(() => {
return fields.value return fields.value

2
packages/nc-gui/components/smartsheet/toolbar/FieldListAutoCompleteDropdown.vue

@ -28,7 +28,7 @@ const options = computed<SelectProps['options']>(() =>
) )
/** ignore virtual fields which are system fields ( mm relation ) and qr code fields */ /** ignore virtual fields which are system fields ( mm relation ) and qr code fields */
} else { } else {
const isQrCode = c.uidt === 'QrCode' const isQrCode = c.uidt === UITypes.QrCode
const isVirtualSystemField = c.colOptions && c.system const isVirtualSystemField = c.colOptions && c.system
return !isVirtualSystemField && !isQrCode return !isVirtualSystemField && !isQrCode
} }

Loading…
Cancel
Save