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

Added the error free and tested functionality to move folders into another folder. Work for all types of folders (#933) #1379

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

SubhPB
Copy link
Contributor

@SubhPB SubhPB commented Nov 9, 2024

In this pull request, i enabled the user to move folders into another folder. It also works for dataroom folders. It is complete error free and fully tested as it was said in #933 .

An overview of what changes i have made:

Created 2 new api endpoints one for simple folder and other for dataroom folder.

1. /api/teams/[teamId]/folders/move         [PATCH]
2. /api/teams/[teamId]/datarooms/[id]/folders/move        [PATCH]

i has implemented all the security checks and also solved all the possible edge cases. There were multiple edge cases. i worked very hard in code readability you can easily read and check how i have solved all of those.
All update is handled very preciously and smoothly in a careful way.

Modified Existing Components such as SidebarSelectionTree for both (Folder and DataroomFolder)

In order to make those components compatible with this new feature i had to implement an optional filter function so that user can't select any invalid new parent folder. This change is 100% compatible with existing code

New Modal specific to move folders into another folder

I introduced a new modal capable to handle both types of folders. Upon form submission it do a good job to check the validity, also give the appropriate meaningful errors if user selects an invalid new parent folder. It internally calls move-folders-into-folder a newly created function to make the API request

Modified existing component named FolderCard

This component did not have any option about move folder. but now i have included a new option of move folder and it also works for both types of folders.

Here is the video of my solution.

feat-933.mp4

@mfts All code has been done in a clean way with meaningful comments. This was a bit complex problem but i believe it would not be hard for anyone to understand the code and solution. I would be very happy to get feedback about my solution and how overall my code was. Please feel free to ask if you need any modification or anything in the code.

  • Byimaan

SubhPB added 12 commits November 7, 2024 10:42
…ove.ts] To move dataroom-folder into another dataroom-folder
…le to handle both dataroom folder and also ordinary folders to be moved freely and makes approriate API call to move folder location
…ionality of filtering folders data to made this component with new feature of moving dataroom folders into another dataroom folder
…components compatiable for the functionality to move datarrom folders into other folders
…ders] In this modification code is giving more meaningful toast errors to user to identify the cause of invalid folder selection.
@SubhPB SubhPB requested a review from mfts as a code owner November 9, 2024 00:16
Copy link

vercel bot commented Nov 9, 2024

@SubhPB is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

@SubhPB
Copy link
Contributor Author

SubhPB commented Nov 12, 2024

@mfts Please let me know if there will be something to do in this code or if you want me to add more videos as proof or any more explanation about code. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant