Skip to content

Use wildcard popup for confirmation

Created by: unclejustin

Closes https://github.com/sourcegraph/sourcegraph/issues/32374

This PR replaces the built-in window.confirm dialogs with branded modals.

PixelSnap 2022-04-07 at 20 22 08

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

App preview:

Merge request reports

Loading