Generic Confirm Modal to Call from HAML

What and Why

Based on a slack discussion between @pslaughter and I, having a generic Confirm Modal we can call from HAML will be nice to remove the browser default confirm messages we have within GitLab.

The ask was first identified as part of: !24808 (merged)

This will behave similarly to !23125 (merged) where it is a simple way to hook in to a confirm modal without effort or additional coding.

How

The Vue Component: vue_shared/components/confirm_modal.vue

  • This is where the Vue magic will happen, where we can add our DOM events and way to hook into the submit logic (most likely a form.submit() that can call intended action the modal is "confirming". Everything can be passed in as props.

The JS Hook: confirm_modal.js

  • This will be how your index.js file can init the modal for your own HAML view(s)

Hook into HAML: {file_name}.html.haml

  • This will be where you create your element and data-props to pass to the modal
  • ex. #js-confirm-modal { data: { ...props } }
Edited Feb 18, 2020 by Zack Cuddy
Assignee Loading
Time tracking Loading