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)',
|
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 {
|
} else {
|
||||||
templateFields.push({
|
templateFields.push({
|
||||||
icon: getIcon(field.icon),
|
icon: getIcon(field.icon),
|
||||||
|
|||||||
@ -147,6 +147,8 @@ export const ValidationStep = <T extends string>({
|
|||||||
importColumn.value === column.key) ||
|
importColumn.value === column.key) ||
|
||||||
(importColumn.type === ColumnType.matchedSelectOptions &&
|
(importColumn.type === ColumnType.matchedSelectOptions &&
|
||||||
importColumn.value === column.key) ||
|
importColumn.value === column.key) ||
|
||||||
|
(importColumn.type === ColumnType.matchedCheckbox &&
|
||||||
|
importColumn.value === column.key) ||
|
||||||
column.key === 'select-row',
|
column.key === 'select-row',
|
||||||
).length > 0;
|
).length > 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user