2021-03-08 18:12:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module JiraConnectHelper
|
|
|
|
def new_jira_connect_ui?
|
|
|
|
Feature.enabled?(:new_jira_connect_ui, type: :development, default_enabled: :yaml)
|
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
def jira_connect_app_data(subscriptions)
|
|
|
|
return {} unless new_jira_connect_ui?
|
|
|
|
|
|
|
|
skip_groups = subscriptions.map(&:namespace_id)
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
{
|
2021-03-11 19:13:27 +05:30
|
|
|
groups_path: api_v4_groups_path(params: { min_access_level: Gitlab::Access::MAINTAINER, skip_groups: skip_groups }),
|
|
|
|
subscriptions_path: jira_connect_subscriptions_path,
|
|
|
|
users_path: current_user ? nil : jira_connect_users_path
|
2021-03-08 18:12:59 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|