Commit 48e76046 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'issuable-form-create-label-sub-groups' into 'master'

Fixed create new label form in issue form not working for sub-group projects

Closes #32906

See merge request !11703
parents bd259d6b ed6bf343
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
- selected = local_assigns.fetch(:selected, nil) - selected = local_assigns.fetch(:selected, nil)
- selected_toggle = local_assigns.fetch(:selected_toggle, nil) - selected_toggle = local_assigns.fetch(:selected_toggle, nil)
- dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by label") - dropdown_title = local_assigns.fetch(:dropdown_title, "Filter by label")
- dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path), labels: labels_filter_path, default_label: "Labels"} - dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), labels: labels_filter_path, default_label: "Labels"}
- dropdown_data.merge!(data_options) - dropdown_data.merge!(data_options)
- classes << 'js-extra-options' if extra_options - classes << 'js-extra-options' if extra_options
- classes << 'js-filter-submit' if filter_submit - classes << 'js-filter-submit' if filter_submit
......
---
title: Fixed create new label form in issue form not working for sub-group projects
merge_request:
author:
...@@ -219,6 +219,37 @@ describe 'New/edit issue', :feature, :js do ...@@ -219,6 +219,37 @@ describe 'New/edit issue', :feature, :js do
end end
end end
describe 'sub-group project' do
let(:group) { create(:group) }
let(:nested_group_1) { create(:group, parent: group) }
let(:sub_group_project) { create(:empty_project, group: nested_group_1) }
before do
sub_group_project.add_master(user)
visit new_namespace_project_issue_path(sub_group_project.namespace, sub_group_project)
end
it 'creates new label from dropdown' do
click_button 'Labels'
click_link 'Create new label'
page.within '.dropdown-new-label' do
fill_in 'new_label_name', with: 'test label'
first('.suggest-colors-dropdown a').click
click_button 'Create'
wait_for_requests
end
page.within '.dropdown-menu-labels' do
expect(page).to have_link 'test label'
end
end
end
def before_for_selector(selector) def before_for_selector(selector)
js = <<-JS.strip_heredoc js = <<-JS.strip_heredoc
(function(selector) { (function(selector) {
......
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