Skip to content

Commit

Permalink
Add boolean with toggle in csv import (#6050)
Browse files Browse the repository at this point in the history
Better UI when importing boolean via CSV (with a toggle)
  • Loading branch information
FelixMalfait authored Jun 26, 2024
1 parent 7b816e5 commit 08c081d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 08c081d

Please sign in to comment.