-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for all airtable field types #234
Conversation
…ndling - Updated the path generation for output query mappings to use bracket notation for keys, ensuring compatibility with keys that may contain special characters. - Introduced a variable for the mapping key to enhance code readability.
- Automatically assign output mapping types to airtable fields - Improved field mapping logic to filter unsupported fields and handle selected table fields more effectively.
- Implemented handling for 'string_array' field type, allowing for the conversion of array values into a comma-separated string format.
…ice' and add 'string_array' support - Changed field type from 'price' to 'currency' in multiple queries and configurations to standardize currency handling. - Updated the QueryRunner to accept a mapping array for field values, enhancing flexibility in field type management. - Added 'string_array' to the list of supported text field types, allowing for better data handling in queries. - Adjusted documentation to reflect these changes.
case 'string_array': | ||
return implode( ', ', $field_value ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this should be a separate type - string_array
or would it be better if we keep the type as string
and if it finds an array, it should just join them using comma. The only reason I can think against keeping the type as string
is if for some reason we want to expose the raw array to the block. However, I can't think of why we'd want to do that top of my mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the latter is preferred. The value is a string. It's just our way of automatically mapping the array from the source. But once we join them, it's just a string and that's what it should be on our side. If you write your own config, you can use a different type and conversion.
Other than the small string array change you mentioned, this looks really good. |
Description
Note
JIRA: CAFE-1068
Support for string arrays: Added handling when array values are received for
string
type where it concatenates them with comma delimiter and thus returning string values.Renaming
price
tocurrency
: Theprice
field has been renamed tocurrency
and adds support for a new field in mapping optionsprefix
which allows for displaying the currency symbol or prefix.Currency Prefix/Symbol Support: Added support for currency prefixes or symbols, enhancing the display options for monetary values.
Comprehensive Airtable Type Support: Added support for all the Airtable fields documented here: https://airtable.com/developers/web/api/field-model. The Airtables types are mapped to plugin's output mapping types using the following mapping:
Testing
To test these changes: