Files field - add files field display and input + filtering (#17637)
This PR introduces a new FILES field type for Twenty CRM, allowing users to attach multiple files to any record. - Files field display - Files field preview - Files field input - Files field filtering To test : 1/ need to activate feature flag `IS_FILES_FIELD_ENABLED` + create a new FILES field - display in read only, edit, inline, table - edit - filter - export closes https://github.com/twentyhq/core-team-issues/issues/2154 <img width="354" height="134" alt="Screenshot 2026-02-02 at 19 11 01" src="https://github.com/user-attachments/assets/3c3de89e-f6b6-4526-b710-e4c7ee1a6d30" /> <img width="1081" height="933" alt="Screenshot 2026-02-02 at 19 10 41" src="https://github.com/user-attachments/assets/7c9a7278-edb7-4d4a-882c-f7404689d011" /> <img width="1073" height="719" alt="Screenshot 2026-02-02 at 19 10 33" src="https://github.com/user-attachments/assets/79cc372b-56a2-4cbf-b4fe-023adc4753a8" />
This commit is contained in:
@@ -73,6 +73,18 @@ export const sanitizeRecordInput = ({
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (
|
||||
isDefined(fieldMetadataItem) &&
|
||||
fieldMetadataItem.type === FieldMetadataType.FILES &&
|
||||
Array.isArray(fieldValue)
|
||||
) {
|
||||
const cleanedFiles = fieldValue.map((file: any) => ({
|
||||
fileId: file.fileId,
|
||||
label: file.label,
|
||||
}));
|
||||
return [fieldName, cleanedFiles];
|
||||
}
|
||||
|
||||
// Todo: we should check that the fieldValue is a valid value
|
||||
// (e.g. a string for a string field, following the right composite structure for composite fields)
|
||||
return [fieldName, fieldValue];
|
||||
|
||||
Reference in New Issue
Block a user