forked from twentyhq/twenty
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Files field fix (twentyhq#7376)
## 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]>
- Loading branch information
1 parent
f1303a5
commit 5a367ef
Showing
2 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
packages/twenty-front/src/utils/file/getFileNameAndExtension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const getFileNameAndExtension = (filenameWithExtension: string) => { | ||
const lastDotIndex = filenameWithExtension.lastIndexOf('.'); | ||
|
||
return { | ||
name: filenameWithExtension.substring(0, lastDotIndex), | ||
extension: filenameWithExtension.substring(lastDotIndex), | ||
}; | ||
}; |