Commit 57fea91f authored by Dmitry Gruzd's avatar Dmitry Gruzd

Merge branch 'feature/zentao/add_config_help_tips' into 'master'

Feature: Add help information for ZenTao integration

See merge request gitlab-org/gitlab!73055
parents a2398de0 f240c18c
......@@ -2,6 +2,8 @@
module Integrations
class Zentao < Integration
include Gitlab::Routing
data_field :url, :api_url, :api_token, :zentao_product_xid
validates :url, public_url: true, presence: true, if: :activated?
......@@ -26,6 +28,14 @@ module Integrations
s_("ZentaoIntegration|Use ZenTao as this project's issue tracker.")
end
def help
s_("ZentaoIntegration|Before you enable this integration, you must configure ZenTao. For more details, read the %{link_start}ZenTao integration documentation%{link_end}.") % {
link_start: '<a href="%{url}" target="_blank" rel="noopener noreferrer">'
.html_safe % { url: help_page_url('user/project/integrations/zentao') },
link_end: '</a>'.html_safe
}
end
def self.to_param
name.demodulize.downcase
end
......@@ -82,3 +92,5 @@ module Integrations
end
end
end
::Integrations::Zentao.prepend_mod
......@@ -39935,6 +39935,9 @@ msgstr ""
msgid "ZentaoIntegration|Base URL of the ZenTao instance."
msgstr ""
msgid "ZentaoIntegration|Before you enable this integration, you must configure ZenTao. For more details, read the %{link_start}ZenTao integration documentation%{link_end}."
msgstr ""
msgid "ZentaoIntegration|Enter new ZenTao API token"
msgstr ""
......
......@@ -50,4 +50,10 @@ RSpec.describe Integrations::Zentao do
expect(zentao_integration.test).to eq(test_response)
end
end
describe '#help' do
it 'renders prompt information' do
expect(zentao_integration.help).not_to be_empty
end
end
end
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