Commit 00da2df8 authored by David O'Regan's avatar David O'Regan Committed by Olena Horal-Koretska

Add help text for type select

parent 2ff32a4e
.form-group.row.gl-mb-0
= form.label :type, 'Type', class: 'col-form-label col-sm-2'
.col-sm-10
.issuable-form-select-holder.selectbox.form-group
.issuable-form-select-holder.selectbox.form-group.gl-mb-0
.dropdown.js-issuable-type-filter-dropdown-wrap
%button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
%span.dropdown-label
%span.dropdown-toggle-text.is-default
= type.capitalize || _("Select type")
= icon('chevron-down')
.dropdown-menu.dropdown-menu-selectable.dropdown-select
......@@ -18,5 +18,10 @@
= link_to new_project_issue_path(@project), class: ("is-active" if type === 'issue') do
= _("Issue")
%li.js-filter-issuable-type
= link_to new_project_issue_path(@project, { 'issue[issue_type]': 'incident', issuable_template: 'incident' }), class: ("is-active" if type === 'incident') do
= link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if type === 'incident') do
= _("Incident")
- if type === 'incident'
%p.form-text.text-muted
- incident_docs_url = help_page_path('operations/incident_management/incidents.md', anchor: 'create-and-manage-incidents-in-gitlab')
- incident_docs_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: incident_docs_url }
= _('A %{incident_docs_start}modified issue%{incident_docs_end} to guide the resolution of incidents.').html_safe % { incident_docs_start: incident_docs_start, incident_docs_end: '</a>'.html_safe }
title: Add help text to incident type select on new issue form
merge_request: 41567
author:
type: changed
......@@ -1105,6 +1105,9 @@ msgstr ""
msgid ":%{startLine} to %{endLine}"
msgstr ""
msgid "A %{incident_docs_start}modified issue%{incident_docs_end} to guide the resolution of incidents."
msgstr ""
msgid "A 'Runner' is a process which runs a job. You can set up as many Runners as you need."
msgstr ""
......
......@@ -196,7 +196,7 @@ RSpec.describe "User creates issue" do
end
it 'pre-fills the issue type dropdown with issue type' do
expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-label')).to have_content('Issue')
expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-toggle-text')).to have_content('Issue')
end
it 'does not hide the milestone select' do
......@@ -208,11 +208,11 @@ RSpec.describe "User creates issue" do
let(:project) { create(:project) }
before do
visit new_project_issue_path(project, { 'issue[issue_type]': 'incident', issuable_template: 'incident' })
visit new_project_issue_path(project, { issuable_template: 'incident', issue: { issue_type: 'incident' } })
end
it 'pre-fills the issue type dropdown with incident type' do
expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-label')).to have_content('Incident')
expect(find('.js-issuable-type-filter-dropdown-wrap .dropdown-toggle-text')).to have_content('Incident')
end
it 'hides the epic select' do
......@@ -226,6 +226,10 @@ RSpec.describe "User creates issue" do
it 'hides the weight input' do
expect(page).not_to have_selector('.qa-issuable-weight-input')
end
it 'shows the incident help text' do
expect(page).to have_text('A modified issue to guide the resolution of incidents.')
end
end
context 'suggestions', :js do
......
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