Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/airtable/src/FieldMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ export function FieldMapping({ collection, dataSource, initialSlugFieldId }: Fie
return { ...field, type: "string" } as PossibleField
case "formattedText":
return { ...field, type: "formattedText" } as PossibleField
case "color":
return { ...field, type: "color" } as PossibleField
default:
return field
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/airtable/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function getFieldDataEntryForFieldSchema(fieldSchema: PossibleField, value: unkn
}

case "color":
if (typeof value !== "string") return null
if (!value || typeof value !== "string") return null
return {
value,
type: "color",
Expand Down Expand Up @@ -239,8 +239,8 @@ export async function getItems(dataSource: DataSource, slugFieldId: string) {
case "image":
case "file":
case "link":
case "color":
case "date":
case "color":
case "collectionReference":
case "multiCollectionReference":
fieldData[field.id] = {
Expand Down
2 changes: 1 addition & 1 deletion plugins/airtable/src/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function inferStringField(fieldSchema: AirtableFieldSchema & { type: "singleLine
userEditable: false,
airtableType: fieldSchema.type,
type: "string",
allowedTypes: ["string", "formattedText"],
allowedTypes: ["string", "formattedText", "color"],
}
}

Expand Down
Loading