Add boolean with toggle in csv import (#6050)
Better UI when importing boolean via CSV (with a toggle)
This commit is contained in:
@ -90,6 +90,16 @@ export const useSpreadsheetRecordImport = (objectNameSingular: string) => {
|
||||
field.label + ' (ID)',
|
||||
),
|
||||
});
|
||||
} else if (field.type === FieldMetadataType.Boolean) {
|
||||
templateFields.push({
|
||||
icon: getIcon(field.icon),
|
||||
label: field.label,
|
||||
key: field.name,
|
||||
fieldType: {
|
||||
type: 'checkbox',
|
||||
},
|
||||
validations: getSpreadSheetValidation(field.type, field.label),
|
||||
});
|
||||
} else {
|
||||
templateFields.push({
|
||||
icon: getIcon(field.icon),
|
||||
|
||||
@ -147,6 +147,8 @@ export const ValidationStep = <T extends string>({
|
||||
importColumn.value === column.key) ||
|
||||
(importColumn.type === ColumnType.matchedSelectOptions &&
|
||||
importColumn.value === column.key) ||
|
||||
(importColumn.type === ColumnType.matchedCheckbox &&
|
||||
importColumn.value === column.key) ||
|
||||
column.key === 'select-row',
|
||||
).length > 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user