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:
+1
@@ -13,4 +13,5 @@ export enum FeatureFlagKey {
|
||||
IS_IF_ELSE_ENABLED = 'IS_IF_ELSE_ENABLED',
|
||||
IS_SSE_DB_EVENTS_ENABLED = 'IS_SSE_DB_EVENTS_ENABLED',
|
||||
IS_COMMAND_MENU_ITEM_ENABLED = 'IS_COMMAND_MENU_ITEM_ENABLED',
|
||||
IS_FILES_FIELD_ENABLED = 'IS_FILES_FIELD_ENABLED',
|
||||
}
|
||||
|
||||
+4
@@ -141,6 +141,10 @@ export const generateRandomFieldValue = ({
|
||||
return [];
|
||||
}
|
||||
|
||||
case FieldMetadataType.FILES: {
|
||||
return null;
|
||||
}
|
||||
|
||||
case FieldMetadataType.TS_VECTOR: {
|
||||
throw new Error(
|
||||
`We should not generate fake version for ${field.type} field`,
|
||||
|
||||
+5
@@ -9,6 +9,7 @@ import { z } from 'zod';
|
||||
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
|
||||
import { filesFieldSchema } from 'src/engine/api/common/common-args-processors/data-arg-processor/validator-utils/validate-files-field-or-throw.util';
|
||||
import { type ObjectMetadataForToolSchema } from 'src/engine/core-modules/record-crud/types/object-metadata-for-tool-schema.type';
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
import { isFieldMetadataEntityOfType } from 'src/engine/utils/is-field-metadata-of-type.util';
|
||||
@@ -243,6 +244,10 @@ export const generateRecordPropertiesZodSchema = (
|
||||
});
|
||||
break;
|
||||
|
||||
case FieldMetadataType.FILES:
|
||||
fieldSchema = filesFieldSchema;
|
||||
break;
|
||||
|
||||
default:
|
||||
fieldSchema = getFieldZodType(field);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user