-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UUID form field input #9121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added UUID form field input functionality with variable support and comprehensive testing coverage.
- Added
FormUuidFieldInput
component in/packages/twenty-front/src/modules/object-record/record-field/form-types/components/FormUuidFieldInput.tsx
with variable picker integration - Added UUID field handling in
/packages/twenty-front/src/modules/object-record/record-field/components/FormFieldInput.tsx
with type guard support - Added Storybook tests in
FormUuidFieldInput.stories.tsx
covering UUID input variations and variable replacement - No UUID format validation implemented, allowing invalid UUIDs to be persisted
- Test coverage uses non-UUID values in some cases which may not reflect real usage patterns
3 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
<FormUuidFieldInput | ||
label={field.label} | ||
defaultValue={defaultValue as string | null | undefined} | ||
onPersist={onPersist} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: onPersist should be wrapped to ensure it returns the correct type - (value: string | null) => onPersist(value as JsonValue)
const input = await canvas.findByPlaceholderText('Enter UUID'); | ||
expect(input).toBeVisible(); | ||
|
||
const uuid = 'test'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Using 'test' as UUID value doesn't match real UUID format. Should use valid UUID to properly test clearing functionality.
const [, , variableTag] = await Promise.all([ | ||
userEvent.click(addVariableButton), | ||
|
||
waitForElementToBeRemoved(input), | ||
waitFor(() => { | ||
const variableTag = canvas.getByText('test'); | ||
expect(variableTag).toBeVisible(); | ||
|
||
return variableTag; | ||
}), | ||
waitFor(() => { | ||
expect(args.onPersist).toHaveBeenCalledWith('{{test}}'); | ||
}), | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Promise.all array has 4 promises but only 3 values are destructured, which could cause confusion
defaultValue: string | null | undefined; | ||
placeholder: string; | ||
onPersist: (value: string | null) => void; | ||
readonly?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: readonly prop is defined but never used in the component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
Log
|
No description provided.