Browse Source

fix(nc-gui): revise isCheckboxType logic

pull/6725/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
76403ad667
  1. 7
      packages/nc-gui/helpers/parsers/parserHelpers.ts

7
packages/nc-gui/helpers/parsers/parserHelpers.ts

@ -29,17 +29,15 @@ export const isCheckboxType: any = (values: [], col?: number) => {
let options = booleanOptions
for (let i = 0; i < values.length; i++) {
const val = getColVal(values[i], col)
if (val === null || val === undefined || val.toString().trim() === '') {
continue
}
options = options.filter((v) => val in v)
if (!options.length) {
return false
}
}
return options
return true
}
export const getCheckboxValue = (value: any) => {
@ -161,8 +159,7 @@ export const getColumnUIDTAndMetas = (colData: [], defaultType: string) => {
if (isUrlType(colData)) {
colProps.uidt = UITypes.URL
} else {
const checkboxType = isCheckboxType(colData)
if (checkboxType.length === 1) {
if (isCheckboxType(colData)) {
colProps.uidt = UITypes.Checkbox
} else {
Object.assign(colProps, extractMultiOrSingleSelectProps(colData))

Loading…
Cancel
Save