Use wildcard popup for confirmation
requested to merge 32374-code-insights-use-wildcard-popup-instead-of-native-confirmation-modal-for-insight-operation-confirmation-step into main
Created by: unclejustin
Closes https://github.com/sourcegraph/sourcegraph/issues/32374
This PR replaces the built-in window.confirm
dialogs with branded modals.
It does this by adding three new components.
- Shared ConfirmationModal: Generic modal to provide consistent formatting and functionality
- ConfirmDeleteModal: Implementation of ConfirmationModal with delete specific text and handlers
- ConfirmRemoveModal: Implementation of ConfirmationModal with remove specific text and handlers
I noticed that all of the call outs to delete and remove could be co-located with the actual menu items, which cleaned up the implementation quite a bit. Now context menu just triggers these modals which then handle dispatching the requests.
Test plan
- Navigate to a dashboard with insights
- Use the insight context menu and select "Delete"
- Should see new confirmation modal
- Modal should be cancelable
- Modal should trigger deletion
- Repeat above for remove