Commit d44bd660 authored by Peter Leitzen's avatar Peter Leitzen

Show issue types in dropdown only if allowed

parent ea91814e
# frozen_string_literal: true # frozen_string_literal: true
module IssuesHelper module IssuesHelper
include Issues::IssueTypeHelpers
def issue_css_classes(issue) def issue_css_classes(issue)
classes = ["issue"] classes = ["issue"]
classes << "closed" if issue.closed? classes << "closed" if issue.closed?
......
...@@ -18,17 +18,19 @@ ...@@ -18,17 +18,19 @@
= sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon') = sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon')
.dropdown-content{ data: { testid: 'issue-type-select-dropdown' } } .dropdown-content{ data: { testid: 'issue-type-select-dropdown' } }
%ul %ul
%li.js-filter-issuable-type - if create_issue_type_allowed?(@project, :issue)
= link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do %li.js-filter-issuable-type
#{sprite_icon(work_item_type_icon(:issue), css_class: 'gl-icon')} #{_("Issue")} = link_to new_project_issue_path(@project), class: ("is-active" if issuable.issue?) do
%li.js-filter-issuable-type{ data: { track: { action: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } } #{sprite_icon(work_item_type_icon(:issue), css_class: 'gl-icon')} #{_('Issue')}
= link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do - if create_issue_type_allowed?(@project, :incident)
#{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_("Incident")} %li.js-filter-issuable-type{ data: { track: { action: "select_issue_type_incident", label: "select_issue_type_incident_dropdown_option" } } }
= link_to new_project_issue_path(@project, { issuable_template: 'incident', issue: { issue_type: 'incident' } }), class: ("is-active" if issuable.incident?) do
#{sprite_icon(work_item_type_icon(:incident), css_class: 'gl-icon')} #{_('Incident')}
#js-type-popover #js-type-popover
- if issuable.incident? - if issuable.incident?
%p.form-text.text-muted %p.form-text.text-muted
- incident_docs_url = help_page_path('operations/incident_management/incidents.md') - incident_docs_url = help_page_path('operations/incident_management/incidents.md')
- incident_docs_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: incident_docs_url } - incident_docs_start = format('<a href="%{url}" target="_blank" rel="noopener noreferrer">', 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 } = format(_('A %{incident_docs_start}modified issue%{incident_docs_end} to guide the resolution of incidents.'), incident_docs_start: incident_docs_start, incident_docs_end: '</a>').html_safe
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