Files v2 - Add new FILES field type (#17236)
In this PR : - New field type FieldMetadataType.FILES added (as jsonb in DB) - Backend: GraphQL types, validation, REST API schema, data processor handling - Frontend: field configuration in settings - Feature flag IS_FILES_FIELD_ENABLED to gate the feature - Integration tests for create/filter validation - Dev seed: Feature flag enabled + FILES field on survey result object To do in next PRs : - Backend : -- new workspaceFile controller (for download) & new workspaceFile upload resolver (for upload) -- pre-hook/post-hook to ensure fileId existence + listener to ensure cleaning - Frontend : FILES field display/edit in table view, record, ...
This commit is contained in:
+27
-1
@@ -1,7 +1,8 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
type FieldMetadataSettings,
|
||||
FILE_CATEGORIES,
|
||||
NumberDataType,
|
||||
type FieldMetadataSettings,
|
||||
} from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
@@ -330,6 +331,31 @@ export const convertObjectMetadataToSchemaProperties = ({
|
||||
},
|
||||
};
|
||||
break;
|
||||
case FieldMetadataType.FILES:
|
||||
itemProperty = {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
fileId: {
|
||||
type: 'string',
|
||||
format: 'uuid',
|
||||
},
|
||||
label: {
|
||||
type: 'string',
|
||||
},
|
||||
...(forResponse
|
||||
? {
|
||||
fileCategory: {
|
||||
type: 'string',
|
||||
enum: Object.values(FILE_CATEGORIES),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
},
|
||||
};
|
||||
break;
|
||||
default:
|
||||
itemProperty = getFieldProperties(field);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user