Skip to content

Move "Integration active" toggle to integration_form.vue

Tom Quirk requested to merge 342121-move-active-toggle-to-vue-component into master

What does this MR do and why?

This MR is part 2 of of #342121 (closed), an effort to remove app/assets/javascripts/integrations/integration_settings_form.js and move its current responsibilities to Vuex or existing Vue components.

Part 1: !75484 (merged).

Tl;dr:

  • Remove TOGGLE_INTEGRATION_EVENT, handle integration active toggling in the Vue component
  • Move form validation checks to the Vue component, and write tests for these

Longer version:

In this MR, we remove the TOGGLE_INTEGRATION_EVENT event from the event hub and shift all toggling responsibilities to the integration_form.vue component. When an integration activation status changes, we set/unset the novalidate argument of the form.

We also move any form validation checks to the Vue component. It was easier to do this in the same MR, but it meant that some tests needed to be added

How to set up and validate locally

  1. Enable and configure the Jira integration for the project. More information.
  2. Uncheck the enable integration checkbox.
  3. Make the form invalid (e.g. don't enter an email address)
  4. Click Save Changes. The form should submit.
  5. Check the enable integration checkbox.
  6. Click Save Changes. The form shouldn't submit and you should get a validation error.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342121 (closed)

Edited by Tom Quirk

Merge request reports