Skip to content

Hide Reset button when integration cannot be manually activated

What does this MR do and why?

Some integrations can only be enabled and disabled by the presence of some other data, for example the GitLab for Slack app integration active state is toggled when an associated SlackIntegration record is created or destroyed (see Integrations::SlackInstallation:: classes), and the GitLab for Jira Cloud app integration when a JiraConnectSubscription record for its inheriting group is created/destroyed (see JiraConnectSubscription::CreateService and DestroyService).

In these situations we do not want to allow people to reset the integration, as resetting destroys the integration, which should only happen in conjunction with the other data.

This change removes the Reset button from the UI when the integration cannot be manually enabled and disabled.

It renames the boolean property from #show_active? to #manual_activation? as this property represents whether an integration can be activated or disabled manually.

#473128 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

How to set up and validate locally

  1. Enable the enable_jira_connect_configuration feature flag.
  2. Select an integration that cannot be manually activated, like the GitLab for Slack app integration or the GitLab for Jira Cloud app integration. If you don't have these integrations configured locally yet, you can mock your environment with one:
    1. Visit /admin/application_settings/general and expand GitLab for Jira app.
    2. Enter fake into Jira Connect Application ID and save the changes.
    3. On the Rails console go:
      group = Group.find_by_full_path('full_path_of_group')
      integration = Integration.find_or_initialize_non_project_specific_integration(
       'jira_cloud_app',
       group_id: group.id
      ) 
      integration.activate!
  3. View the integration on the group-level. On this branch you will not see the Reset button. View another kind of (active) integration on the group-level and you will see the Reset button.

Related to #473128 (closed)

Edited by Luke Duncalfe

Merge request reports

Loading