Commit c547531d authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch 'feature_flag/zentao' into 'master'

Turn on the Feature Flag of ZenTao

See merge request gitlab-org/gitlab!72958
parents bbafe868 499a27c8
...@@ -9,10 +9,6 @@ module Integrations ...@@ -9,10 +9,6 @@ module Integrations
validates :api_token, presence: true, if: :activated? validates :api_token, presence: true, if: :activated?
validates :zentao_product_xid, presence: true, if: :activated? validates :zentao_product_xid, presence: true, if: :activated?
def self.feature_flag_enabled?(project)
Feature.enabled?(:zentao_issues_integration, project)
end
# License Level: EEP_FEATURES # License Level: EEP_FEATURES
def self.issues_license_available?(project) def self.issues_license_available?(project)
project&.licensed_feature_available?(:zentao_issues_integration) project&.licensed_feature_available?(:zentao_issues_integration)
......
...@@ -1453,10 +1453,7 @@ class Project < ApplicationRecord ...@@ -1453,10 +1453,7 @@ class Project < ApplicationRecord
end end
def disabled_integrations def disabled_integrations
disabled_integrations = [] []
disabled_integrations << :zentao unless ::Integrations::Zentao.feature_flag_enabled?(self)
disabled_integrations
end end
def find_or_initialize_integration(name) def find_or_initialize_integration(name)
......
---
name: zentao_issues_integration
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69602
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/338775
milestone: '14.4'
type: development
group: group::integrations
default_enabled: false
...@@ -34,7 +34,7 @@ module Projects ...@@ -34,7 +34,7 @@ module Projects
private private
def query_params def query_params
params.permit(:id, :page, :limit, :search, :sort, :state, :labels) params.permit(:id, :page, :limit, :search, :sort, :state, labels: [])
end end
def query def query
...@@ -53,8 +53,6 @@ module Projects ...@@ -53,8 +53,6 @@ module Projects
end end
def check_feature_enabled! def check_feature_enabled!
return render_404 unless ::Integrations::Zentao.feature_flag_enabled?(project)
return render_404 unless ::Integrations::Zentao.issues_license_available?(project) && project.zentao_integration&.active? return render_404 unless ::Integrations::Zentao.issues_license_available?(project) && project.zentao_integration&.active?
end end
......
...@@ -23,7 +23,7 @@ module Sidebars ...@@ -23,7 +23,7 @@ module Sidebars
add_menu(Sidebars::Projects::Menus::RepositoryMenu.new(context)) add_menu(Sidebars::Projects::Menus::RepositoryMenu.new(context))
add_menu(Sidebars::Projects::Menus::IssuesMenu.new(context)) add_menu(Sidebars::Projects::Menus::IssuesMenu.new(context))
add_menu(Sidebars::Projects::Menus::ExternalIssueTrackerMenu.new(context)) add_menu(Sidebars::Projects::Menus::ExternalIssueTrackerMenu.new(context))
add_menu(Sidebars::Projects::Menus::ZentaoMenu.new(context)) if ::Integrations::Zentao.feature_flag_enabled?(context.project) add_menu(Sidebars::Projects::Menus::ZentaoMenu.new(context))
add_menu(Sidebars::Projects::Menus::MergeRequestsMenu.new(context)) add_menu(Sidebars::Projects::Menus::MergeRequestsMenu.new(context))
add_menu(Sidebars::Projects::Menus::CiCdMenu.new(context)) add_menu(Sidebars::Projects::Menus::CiCdMenu.new(context))
add_menu(Sidebars::Projects::Menus::SecurityComplianceMenu.new(context)) add_menu(Sidebars::Projects::Menus::SecurityComplianceMenu.new(context))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment