Fix form record picker field (#11817)

- enrich response so the record is available in the step output. Today
this is available in the schema but only the id is set
- make the full record picker clickable instead of the arrow only

<img width="467" alt="Capture d’écran 2025-04-30 à 16 08 04"
src="https://github.com/user-attachments/assets/db74b9a6-7f1d-4e54-bf06-9be3d67ee398"
/>
This commit is contained in:
Thomas Trompette
2025-05-05 12:58:11 +00:00
committed by GitHub
parent c9eff401df
commit 6128d660c2
8 changed files with 270 additions and 54 deletions
@@ -1,6 +1,8 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { isDefined } from 'class-validator';
import { isValidUuid } from 'twenty-shared/utils';
import { Repository } from 'typeorm';
import { WorkflowExecutor } from 'src/modules/workflow/workflow-executor/interfaces/workflow-executor.interface';
@@ -59,6 +61,17 @@ export class DeleteRecordWorkflowAction implements WorkflowExecutor {
context,
) as WorkflowDeleteRecordActionInput;
if (
!isDefined(workflowActionInput.objectRecordId) ||
!isValidUuid(workflowActionInput.objectRecordId) ||
!isDefined(workflowActionInput.objectName)
) {
throw new RecordCRUDActionException(
'Failed to update: Object record ID and name are required',
RecordCRUDActionExceptionCode.INVALID_REQUEST,
);
}
const repository = await this.twentyORMManager.getRepository(
workflowActionInput.objectName,
);
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import deepEqual from 'deep-equal';
import { isDefined, isValidUuid } from 'twenty-shared/utils';
import { Repository } from 'typeorm';
import { WorkflowExecutor } from 'src/modules/workflow/workflow-executor/interfaces/workflow-executor.interface';
@@ -67,6 +68,17 @@ export class UpdateRecordWorkflowAction implements WorkflowExecutor {
context,
) as WorkflowUpdateRecordActionInput;
if (
!isDefined(workflowActionInput.objectRecordId) ||
!isValidUuid(workflowActionInput.objectRecordId) ||
!isDefined(workflowActionInput.objectName)
) {
throw new RecordCRUDActionException(
'Failed to update: Object record ID and name are required',
RecordCRUDActionExceptionCode.INVALID_REQUEST,
);
}
const repository = await this.twentyORMManager.getRepository(
workflowActionInput.objectName,
);