diff options
3 files changed, 50 insertions, 1 deletions
diff --git a/app/views/projects/boards/components/sidebar/_labels.html.haml b/app/views/projects/boards/components/sidebar/_labels.html.haml index 0f0a84c156d..bee0f3dd065 100644 --- a/app/views/projects/boards/components/sidebar/_labels.html.haml +++ b/app/views/projects/boards/components/sidebar/_labels.html.haml @@ -19,7 +19,7 @@ ":value" => "label.id" } .dropdown %button.dropdown-menu-toggle.js-label-select.js-multiselect.js-issue-board-sidebar{ type: "button", - data: { toggle: "dropdown", field_name: "issue[label_names][]", show_no: "true", show_any: "true", project_id: @project.id, labels: namespace_project_labels_path(@project.namespace, @project, :json), namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) }, + data: { toggle: "dropdown", field_name: "issue[label_names][]", show_no: "true", show_any: "true", project_id: @project.id, labels: namespace_project_labels_path(@project.namespace, @project, :json), namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path) }, ":data-issue-update" => "'#{namespace_project_issues_path(@project.namespace, @project)}/' + issue.id + '.json'" } %span.dropdown-toggle-text Label diff --git a/changelogs/unreleased/issue-boards-sidebar-create-new-label-404-error.yml b/changelogs/unreleased/issue-boards-sidebar-create-new-label-404-error.yml new file mode 100644 index 00000000000..b935ef14786 --- /dev/null +++ b/changelogs/unreleased/issue-boards-sidebar-create-new-label-404-error.yml @@ -0,0 +1,4 @@ +--- +title: Fixed create new label form in issue boards sidebar +merge_request: +author: diff --git a/spec/features/boards/sub_group_project_spec.rb b/spec/features/boards/sub_group_project_spec.rb new file mode 100644 index 00000000000..6cd7fddd288 --- /dev/null +++ b/spec/features/boards/sub_group_project_spec.rb @@ -0,0 +1,45 @@ +require 'rails_helper' + +describe 'Sub-group project issue boards', :feature, :js do + include WaitForVueResource + + let(:group) { create(:group) } + let(:nested_group_1) { create(:group, parent: group) } + let(:project) { create(:empty_project, group: nested_group_1) } + let(:board) { create(:board, project: project) } + let(:label) { create(:label, project: project) } + let(:user) { create(:user) } + let!(:list1) { create(:list, board: board, label: label, position: 0) } + let!(:issue) { create(:labeled_issue, project: project, labels: [label]) } + + before do + project.add_master(user) + + login_as(user) + + visit namespace_project_board_path(project.namespace, project, board) + wait_for_vue_resource + end + + it 'creates new label from sidebar' do + find('.card').click + + page.within '.labels' do + click_link 'Edit' + click_link 'Create new label' + end + + 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_ajax + end + + page.within '.labels' do + expect(page).to have_link 'test label' + end + end +end |