Warn user when leaving badge settings page and requests are still pending

When adding / saving / deleting a badge (https://gitlab.com/gitlab-org/gitlab-ce/issues/41174, https://gitlab.com/gitlab-org/gitlab-ce/issues/41176), the user should be warned when leaving the page before the action was successfully completed (https://gitlab.com/gitlab-org/gitlab-ce/issues/41174#note_61827720).

We probably want to add a handler for the beforeunload event to achieve this.

Design

Screen_Shot_2018-03-09_at_13.25.06

Old Design

project-badges--warning-modal

Edited by Inactive Account