Commit 917f04ff authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'feat/add-support-page-link-in-help-menu' into 'master'

feat: add support page link in help menu

See merge request gitlab-org/gitlab-ce!30459
parents 9ba87676 e2053808
...@@ -16,6 +16,6 @@ ...@@ -16,6 +16,6 @@
.form-group .form-group
= f.label :help_page_support_url, _('Support page URL'), class: 'label-bold' = f.label :help_page_support_url, _('Support page URL'), class: 'label-bold'
= f.text_field :help_page_support_url, class: 'form-control', placeholder: 'http://company.example.com/getting-help', :'aria-describedby' => 'support_help_block' = f.text_field :help_page_support_url, class: 'form-control', placeholder: 'http://company.example.com/getting-help', :'aria-describedby' => 'support_help_block'
%span.form-text.text-muted#support_help_block= _('Alternate support URL for help page') %span.form-text.text-muted#support_help_block= _('Alternate support URL for help page and help dropdown')
= f.submit _('Save changes'), class: "btn btn-success" = f.submit _('Save changes'), class: "btn btn-success"
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
- if current_user_menu?(:help) - if current_user_menu?(:help)
%li %li
= link_to _("Help"), help_path = link_to _("Help"), help_path
%li
= link_to _("Support"), support_url
= render_if_exists "shared/learn_gitlab_menu_item" = render_if_exists "shared/learn_gitlab_menu_item"
%li.divider %li.divider
%li %li
......
---
title: Add admin-configurable "Support page URL" link to top Help dropdown menu
merge_request: 30459
author: Diego Louzán
type: added
...@@ -230,7 +230,7 @@ are listed in the descriptions of the relevant settings. ...@@ -230,7 +230,7 @@ are listed in the descriptions of the relevant settings.
| `gravatar_enabled` | boolean | no | Enable Gravatar. | | `gravatar_enabled` | boolean | no | Enable Gravatar. |
| `hashed_storage_enabled` | boolean | no | Create new projects using hashed storage paths: Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance. (EXPERIMENTAL) | | `hashed_storage_enabled` | boolean | no | Create new projects using hashed storage paths: Enable immutable, hash-based paths and repository names to store repositories on disk. This prevents repositories from having to be moved or renamed when the Project URL changes and may improve disk I/O performance. (EXPERIMENTAL) |
| `help_page_hide_commercial_content` | boolean | no | Hide marketing-related entries from help. | | `help_page_hide_commercial_content` | boolean | no | Hide marketing-related entries from help. |
| `help_page_support_url` | string | no | Alternate support URL for help page. | | `help_page_support_url` | string | no | Alternate support URL for help page and help dropdown. |
| `help_page_text` | string | no | Custom text displayed on the help page. | | `help_page_text` | string | no | Custom text displayed on the help page. |
| `help_text` | string | no | **(PREMIUM)** GitLab server administrator information | | `help_text` | string | no | **(PREMIUM)** GitLab server administrator information |
| `hide_third_party_offers` | boolean | no | Do not display offers from third parties within GitLab. | | `hide_third_party_offers` | boolean | no | Do not display offers from third parties within GitLab. |
......
...@@ -59,7 +59,7 @@ module API ...@@ -59,7 +59,7 @@ module API
optional :grafana_url, type: String, desc: 'Grafana URL' optional :grafana_url, type: String, desc: 'Grafana URL'
optional :gravatar_enabled, type: Boolean, desc: 'Flag indicating if the Gravatar service is enabled' optional :gravatar_enabled, type: Boolean, desc: 'Flag indicating if the Gravatar service is enabled'
optional :help_page_hide_commercial_content, type: Boolean, desc: 'Hide marketing-related entries from help' optional :help_page_hide_commercial_content, type: Boolean, desc: 'Hide marketing-related entries from help'
optional :help_page_support_url, type: String, desc: 'Alternate support URL for help page' optional :help_page_support_url, type: String, desc: 'Alternate support URL for help page and help dropdown'
optional :help_page_text, type: String, desc: 'Custom text displayed on the help page' optional :help_page_text, type: String, desc: 'Custom text displayed on the help page'
optional :home_page_url, type: String, desc: 'We will redirect non-logged in users to this page' optional :home_page_url, type: String, desc: 'We will redirect non-logged in users to this page'
optional :housekeeping_enabled, type: Boolean, desc: 'Enable automatic repository housekeeping (git repack, git gc)' optional :housekeeping_enabled, type: Boolean, desc: 'Enable automatic repository housekeeping (git repack, git gc)'
......
...@@ -966,7 +966,7 @@ msgstr "" ...@@ -966,7 +966,7 @@ msgstr ""
msgid "Allows you to add and manage Kubernetes clusters." msgid "Allows you to add and manage Kubernetes clusters."
msgstr "" msgstr ""
msgid "Alternate support URL for help page" msgid "Alternate support URL for help page and help dropdown"
msgstr "" msgstr ""
msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import." msgid "Alternatively, you can use a %{personal_access_token_link}. When you create your Personal Access Token, you will need to select the <code>repo</code> scope, so we can display a list of your public and private repositories which are available to import."
...@@ -10586,6 +10586,9 @@ msgstr "" ...@@ -10586,6 +10586,9 @@ msgstr ""
msgid "Sunday" msgid "Sunday"
msgstr "" msgstr ""
msgid "Support"
msgstr ""
msgid "Support for custom certificates is disabled. Ask your system's administrator to enable it." msgid "Support for custom certificates is disabled. Ask your system's administrator to enable it."
msgstr "" msgstr ""
......
...@@ -356,16 +356,18 @@ describe 'Admin updates settings' do ...@@ -356,16 +356,18 @@ describe 'Admin updates settings' do
end end
it 'Change Help page' do it 'Change Help page' do
new_support_url = 'http://example.com/help'
page.within('.as-help-page') do page.within('.as-help-page') do
fill_in 'Help page text', with: 'Example text' fill_in 'Help page text', with: 'Example text'
check 'Hide marketing-related entries from help' check 'Hide marketing-related entries from help'
fill_in 'Support page URL', with: 'http://example.com/help' fill_in 'Support page URL', with: new_support_url
click_button 'Save changes' click_button 'Save changes'
end end
expect(current_settings.help_page_text).to eq "Example text" expect(current_settings.help_page_text).to eq "Example text"
expect(current_settings.help_page_hide_commercial_content).to be_truthy expect(current_settings.help_page_hide_commercial_content).to be_truthy
expect(current_settings.help_page_support_url).to eq "http://example.com/help" expect(current_settings.help_page_support_url).to eq new_support_url
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
...@@ -415,6 +417,34 @@ describe 'Admin updates settings' do ...@@ -415,6 +417,34 @@ describe 'Admin updates settings' do
end end
end end
context 'Nav bar' do
it 'Shows default help links in nav' do
default_support_url = 'https://about.gitlab.com/getting-help/'
visit root_dashboard_path
find('.header-help-dropdown-toggle').click
page.within '.header-help' do
expect(page).to have_link(text: 'Help', href: help_path)
expect(page).to have_link(text: 'Support', href: default_support_url)
end
end
it 'Shows custom support url in nav when set' do
new_support_url = 'http://example.com/help'
stub_application_setting(help_page_support_url: new_support_url)
visit root_dashboard_path
find('.header-help-dropdown-toggle').click
page.within '.header-help' do
expect(page).to have_link(text: 'Support', href: new_support_url)
end
end
end
def check_all_events def check_all_events
page.check('Active') page.check('Active')
page.check('Push') page.check('Push')
......
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