Support define is tool logic function (#17926)
- supports isTool and timeout settings in defineLogicFunction in apps and in setting tabs definition - compute for all toolInputSchema for logic funciton, in settings and in code steps <img width="991" height="802" alt="image" src="https://github.com/user-attachments/assets/05dc1221-cac9-45a3-87b0-3b13161446fd" />
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
import { computeMorphRelationFieldName } from '@/utils/fieldMetadata/compute-morph-relation-field-name';
|
||||
|
||||
describe('computeMorphRelationFieldName', () => {
|
||||
it('should return singular-based name for MANY_TO_ONE', () => {
|
||||
const result = computeMorphRelationFieldName({
|
||||
fieldName: 'assigned',
|
||||
relationType: 'MANY_TO_ONE' as any,
|
||||
targetObjectMetadataNameSingular: 'person',
|
||||
targetObjectMetadataNamePlural: 'people',
|
||||
});
|
||||
|
||||
expect(result).toBe('assignedPerson');
|
||||
});
|
||||
|
||||
it('should return plural-based name for ONE_TO_MANY', () => {
|
||||
const result = computeMorphRelationFieldName({
|
||||
fieldName: 'assigned',
|
||||
relationType: 'ONE_TO_MANY' as any,
|
||||
targetObjectMetadataNameSingular: 'person',
|
||||
targetObjectMetadataNamePlural: 'people',
|
||||
});
|
||||
|
||||
expect(result).toBe('assignedPeople');
|
||||
});
|
||||
|
||||
it('should throw for invalid relation type', () => {
|
||||
expect(() =>
|
||||
computeMorphRelationFieldName({
|
||||
fieldName: 'assigned',
|
||||
relationType: 'INVALID' as any,
|
||||
targetObjectMetadataNameSingular: 'person',
|
||||
targetObjectMetadataNamePlural: 'people',
|
||||
}),
|
||||
).toThrow();
|
||||
});
|
||||
});
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import { FieldMetadataType } from '@/types';
|
||||
import { isFieldMetadataDateKind } from '@/utils/fieldMetadata/isFieldMetadataDateKind';
|
||||
|
||||
describe('isFieldMetadataDateKind', () => {
|
||||
it('should return true for DATE type', () => {
|
||||
expect(isFieldMetadataDateKind(FieldMetadataType.DATE)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for DATE_TIME type', () => {
|
||||
expect(isFieldMetadataDateKind(FieldMetadataType.DATE_TIME)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for TEXT type', () => {
|
||||
expect(isFieldMetadataDateKind(FieldMetadataType.TEXT)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for undefined', () => {
|
||||
expect(isFieldMetadataDateKind(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user