From 37599af882575c8e7c59d952a9cf6d3c50fda43d Mon Sep 17 00:00:00 2001 From: martmull Date: Mon, 17 Mar 2025 11:25:13 +0100 Subject: [PATCH] Fix unknown labe (#10934) ## Before ![image](https://github.com/user-attachments/assets/20b5d5c7-907e-4293-a8db-034125e0f4b4) ## After ![image](https://github.com/user-attachments/assets/1df6d597-f06e-49e4-a9a4-ad980f42b07b) --- .../__tests__/getFunctionOutputSchema.test.ts | 33 ++++++++++++++++--- .../utils/getFunctionOutputSchema.ts | 1 + 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/__tests__/getFunctionOutputSchema.test.ts b/packages/twenty-front/src/modules/serverless-functions/utils/__tests__/getFunctionOutputSchema.test.ts index db5842d8c..9f425ffd1 100644 --- a/packages/twenty-front/src/modules/serverless-functions/utils/__tests__/getFunctionOutputSchema.test.ts +++ b/packages/twenty-front/src/modules/serverless-functions/utils/__tests__/getFunctionOutputSchema.test.ts @@ -10,21 +10,46 @@ describe('getFunctionOutputSchema', () => { e: [1, 2, 3], }; const expectedOutputSchema = { - a: { isLeaf: true, type: 'unknown', value: null, icon: 'IconVariable' }, - b: { isLeaf: true, type: 'string', value: 'b', icon: 'IconVariable' }, + a: { + isLeaf: true, + type: 'unknown', + value: null, + icon: 'IconVariable', + label: 'a', + }, + b: { + isLeaf: true, + type: 'string', + value: 'b', + icon: 'IconVariable', + label: 'b', + }, c: { isLeaf: false, icon: 'IconVariable', value: { - cc: { isLeaf: true, type: 'number', value: 1, icon: 'IconVariable' }, + cc: { + isLeaf: true, + type: 'number', + value: 1, + icon: 'IconVariable', + label: 'cc', + }, }, }, - d: { isLeaf: true, type: 'boolean', value: true, icon: 'IconVariable' }, + d: { + isLeaf: true, + type: 'boolean', + value: true, + icon: 'IconVariable', + label: 'd', + }, e: { isLeaf: true, type: 'array', value: [1, 2, 3], icon: 'IconVariable', + label: 'e', }, }; expect(getFunctionOutputSchema(testResult)).toEqual(expectedOutputSchema); diff --git a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts index 2d5537bc8..387ae34bd 100644 --- a/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts +++ b/packages/twenty-front/src/modules/serverless-functions/utils/getFunctionOutputSchema.ts @@ -41,6 +41,7 @@ export const getFunctionOutputSchema = (testResult: object) => { value, type: getValueType(value), icon: 'IconVariable', + label: key, }; } return acc;