feat: Add delete confirmation dialog for servers and folders#1186
Open
eduardomozart wants to merge 12 commits intognmyt:mainfrom
Open
feat: Add delete confirmation dialog for servers and folders#1186eduardomozart wants to merge 12 commits intognmyt:mainfrom
eduardomozart wants to merge 12 commits intognmyt:mainfrom
Conversation
Introduce an ActionConfirmDialog to confirm server deletions. Adds deleteConfirmDialog state, openDeleteServerConfirm and handleDeleteConfirm handlers, and replaces direct deleteServer calls from the context menu with the confirmation flow. The dialog displays the server name via i18n and triggers deleteRequest + loadServers on confirm, then closes the dialog.
added 3 commits
February 24, 2026 22:38
Replace direct folder deletion with a confirm dialog flow. Introduces openDeleteFolderConfirm to populate deleteConfirmDialog (including entryType) by finding the folder entry, updates the context menu to open the dialog instead of calling deleteFolder, and removes the old deleteFolder helper. handleDeleteConfirm now checks entryType to call the correct endpoint (folders/{id} vs entries/{id}) and resets entryType when closing. The dialog text also uses a folder-specific translation when appropriate.
Ensure flattenEntries is called with a proper array (guards against servers being undefined) when finding a folder for deletion, and simplify the delete confirmation text to always use the fileManager translation key. This avoids potential runtime errors and removes the conditional branching for the dialog message.
Add i18n keys for delete failures (deleteFailFile, deleteFailFolder) and update ServerList logic to reliably locate folder entries by comparing IDs as strings. Add .catch handlers to folder/entry delete requests to show error toasts using the new translation keys. Also add debug console logs for servers/contextClickedId and close the delete confirm dialog after handling.
Remove leftover console.log statements and simplify folder lookup by using the servers array directly instead of calling flattenEntries. This avoids unnecessary flattening when finding the folder entry by id before opening the delete confirmation.
added 7 commits
February 26, 2026 14:23
Add findEntryById to recursively locate an entry (server/folder/org) by id within nested entries, and consolidate delete confirmation logic into openDeleteEntryConfirm. Replace separate openDeleteServerConfirm/openDeleteFolderConfirm flows and folder-specific lookup with a single handler, and update context menu actions to call the unified function. This simplifies deletion handling for nested structures and preserves entry name/id/type in the confirm dialog.
Move the duplicated recursive findEntryById function out of the ServerList component and into module scope. Removes the nested duplicate implementation and consolidates the entry lookup logic (handles nested folder/organization entries) so it can be reused without changing behavior. Reduces code duplication and improves clarity.
Insert console.log statements in findEntryById to output the entries array and the requested id (contextClickedId) during lookup. This change is meant to aid debugging of entry lookup failures and tracing what data is being passed; these logs are likely temporary and can be removed once the issue is resolved.
Remove stray console.log calls from findEntryById and add logging in openDeleteEntryConfirm to output 'servers' and 'contextClickedId' when the delete confirmation is opened. This shifts debug output to the user action context, making it easier to inspect state when deleting an entry.
Coerce entry.id and the target id to Numbers before comparing to ensure matches when one value is a string and the other a number. Added console.log statements to aid debugging of entries and ids during lookup. Recursive search behavior is unchanged.
Remove leftover console.log calls in ServerList.jsx (inside findEntryById and openDeleteEntryConfirm) to clean up noisy console output. No functional changes; only debug statements were removed.
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



📋 Description
Introduce an ActionConfirmDialog to confirm server and folder deletions. Adds deleteConfirmDialog state, openDeleteServerConfirm and handleDeleteConfirm handlers, and replaces direct deleteServer and deleteFolder calls from the context menu with the confirmation flow. The dialog displays the server/folder name via i18n and triggers deleteRequest + loadServers on confirm, then closes the dialog.
🚀 Changes made to ...
✅ Checklist
🔗 Related Issues
Closes #1178