Commit f240c18c authored by Baodong's avatar Baodong Committed by Dmitry Gruzd

Feature: Add help information for ZenTao integration

parent 0fd8d460
......@@ -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
......@@ -39908,6 +39908,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