Skip to content
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

Merged
merged 4 commits into from
Oct 10, 2024
Merged

fix: Files field fix #7376

merged 4 commits into from
Oct 10, 2024

Conversation

harshit078
Copy link
Contributor

@harshit078 harshit078 commented Oct 1, 2024

Description

Closes #7324
Closes #7323

After Changes Behaviour

Screen.Recording.2024-10-02.at.2.33.16.AM.mov

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Comment on lines 63 to 69
const getFileNameAndExtension = (filename: string) => {
const lastDotIndex = filename.lastIndexOf('.');
return {
name: filename.substring(0, lastDotIndex),
extension: filename.substring(lastDotIndex),
};
};
Copy link
Contributor

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

@lucasbordeau
Copy link
Contributor

Nice work

@lucasbordeau lucasbordeau self-assigned this Oct 10, 2024
@lucasbordeau lucasbordeau merged commit 54c328a into twentyhq:main Oct 10, 2024
9 of 10 checks passed
Copy link

Thanks @harshit078 for your contribution!
This marks your 28th PR on the repo. You're top 2% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

harshit078 added a commit to harshit078/twenty that referenced this pull request Oct 14, 2024
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants