Skip to content

Commit

Permalink
Increase select option width
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakib25800 committed Sep 13, 2024
1 parent dbd4e5a commit 1e8f031
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
23 changes: 12 additions & 11 deletions plugins/airtable/src/airtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,16 @@ function richTextToHTML(cellValue: string): string {
/**
* Get the value of an Airtable field in a format compatible with a collection field.
*/
function getFieldValue(
// fields: CollectionField[],
fieldSchema: AirtableFieldSchema,
cellValue: AirtableFieldValue
): unknown | undefined {
function getFieldValue(fieldSchema: AirtableFieldSchema, cellValue: AirtableFieldValue): unknown | undefined {
switch (fieldSchema.type) {
case "checkbox":
case "checkbox": {
return cellValue === true
}

case "multipleAttachments":
case "multipleAttachments": {
return (cellValue as AirtableFieldValues["multipleAttachments"])[0].thumbnails?.full?.url
}

case "multipleSelects":
case "singleSelect": {
if (typeof cellValue !== "string") return undefined

Expand Down Expand Up @@ -213,14 +210,18 @@ function getFieldValue(
case "email":
case "url":
case "phoneNumber":
case "multilineText":
case "multilineText": {
return cellValue
}

case "richText":
case "richText": {
return richTextToHTML(cellValue as string)
}

default:
// Add more field types as needed
default: {
return undefined
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/airtable/src/pages/SelectTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function SelectTablePage({ onTableSelected }: Props) {
<div className="col pl-[15px]">
<div className="row justify-between">
<p>Base</p>
<select onChange={handleBaseSelect} value={selectedBaseId || ""}>
<select onChange={handleBaseSelect} value={selectedBaseId || ""} className="w-[164px]">
<option value="" disabled>
{isFetchingBases ? "Loading..." : "Choose..."}
</option>
Expand All @@ -55,7 +55,7 @@ export function SelectTablePage({ onTableSelected }: Props) {
</div>
<div className="row justify-between">
<p>Table</p>
<select onChange={handleTableSelect} value={selectedTableId || ""}>
<select onChange={handleTableSelect} value={selectedTableId || ""} className="w-[164px]">
<option value="" disabled>
{isFetchingSchemas ? "Loading..." : "Choose..."}
</option>
Expand Down

0 comments on commit 1e8f031

Please sign in to comment.