-
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
fix: Files field fix #7376
fix: Files field fix #7376
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
This PR addresses issue #7324 by implementing the ability to save a renamed file when the user presses Enter in the file attachment section.
- Modified
packages/twenty-front/src/modules/activities/files/components/AttachmentRow.tsx
to handle Enter key press for file renaming - Implemented logic to split file name and extension, preserving the extension during renaming
- Added functionality to save the renamed file on both Enter key press and clicking outside the input field
- Improved user experience in file management, specifically in the rename operation
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
const getFileNameAndExtension = (filename: string) => { | ||
const lastDotIndex = filename.lastIndexOf('.'); | ||
return { | ||
name: filename.substring(0, lastDotIndex), | ||
extension: filename.substring(lastDotIndex), | ||
}; | ||
}; |
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.
style: Consider moving this function outside the component to improve performance
Nice work |
Thanks @harshit078 for your contribution! |
## Description Closes twentyhq#7324 Closes twentyhq#7323 - This PR solves the issue - - twentyhq#7324 - twentyhq#7323 - On Enter the rename of the file is saved - Removed renaming of extension ## After Changes Behaviour https://github.com/user-attachments/assets/f5c47cd4-883e-473e-9cfa-e277f8f630c2 --------- Co-authored-by: Lucas Bordeau <[email protected]>
Description
Closes #7324
Closes #7323
After Changes Behaviour
Screen.Recording.2024-10-02.at.2.33.16.AM.mov