Add Rename Functionality to Sidebar Items
Add Rename Functionality to Sidebar Items✍🏻
After adding rename
https://github.com/user-attachments/assets/4eaecfcb-e68c-4a03-b07d-b69c8069b975
before
https://github.com/user-attachments/assets/a32a02c0-3b1f-45a0-b2db-08528faee3b2
Description
Currently, the sidebar items (namespaces and clusters) only have a delete option when clicking on the three dots menu. We need to add a rename capability to allow users to change the names of namespaces and clusters directly from the sidebar.
Requirements
- Add a rename/edit option to the sidebar item context menu for namespaces and clusters
- Create a dialog to input the new name
- Implement API calls to handle the renaming on the backend
- Add proper error handling and user feedback
Implementation Details
UI Changes
- Add an edit icon to the context menu next to the delete icon
- Create a rename dialog with a text field for the new name
- Show success/error messages after rename attempts
API Endpoints
Need to implement these endpoints on the backend:
/api/namespaces/{oldName}/rename- For renaming namespaces/api/namespaces/{namespace}/clusters/{oldName}/rename- For renaming clusters
Files to Modify
/Users/jitmisra/Desktop/kvrocks-controller/webui/src/app/ui/sidebarItem.tsx/Users/jitmisra/Desktop/kvrocks-controller/webui/src/app/lib/api.ts
Acceptance Criteria
- Users can rename namespaces and clusters from the sidebar
- UI provides clear feedback on success or failure
- After successful rename, the user is redirected to the renamed resource
I want to work on this issue already i have wrote the code as you can see in the video added edit icon previosly only delete icon was there
@Jitmisra, that looks good to me. Thanks for your efforts.
@Jitmisra, that looks good to me. Thanks for your efforts.
I have already implemented the frontend and rename functionality, and it successfully makes the API call. However, since I have limited experience with Go, I need to check if the backend already has a function to handle the rename operation. If it doesn’t, I will need some time to implement it. Alternatively, I can push the PR for the edit functionality now and work on the backend implementation separately. Let me know how you’d like to proceed.
@Jitmisra It now doesn't have the rename API, but it should be simple to implement. Could refer to: https://github.com/apache/kvrocks-controller/blob/unstable/server/route.go#L61
@Jitmisra It now doesn't have the rename API, but it should be simple to implement. Could refer to: https://github.com/apache/kvrocks-controller/blob/unstable/server/route.go#L61
thank you i have raised the pr please review