diff --git a/CHANGELOG b/CHANGELOG index fba25fca30caec66c7eb2b224644edd782c04aa1..5857fa53d91872b9294f7b01c59d55c495c9c897 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -64,6 +64,7 @@ v 8.9.0 (unreleased) - Toggling a task list item in a issue/mr description does not creates a Todo for mentions - Improved UX of date pickers on issue & milestone forms - Cache on the database if a project has an active external issue tracker. + - Put project Labels and Milestones pages links under Issues and Merge Requests tabs as subnav v 8.8.5 (unreleased) - Ensure branch cleanup regardless of whether the GitHub import process succeeds diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index ca99ba8def374c8d957372f150b9892e223b6d61..79cc5c02888704aea4a1bf50075e8c0cf3b1e843 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -33,7 +33,7 @@ = navbar_icon('activity') %span Activity - + - if project_nav_tab? :files = nav_link(controller: %w(tree blob blame edit_tree new_tree find_file commit commits compare repositories tags branches releases network)) do = link_to project_files_path(@project), title: 'Code', class: 'shortcuts-tree' do @@ -62,15 +62,8 @@ %span Graphs - - if project_nav_tab? :milestones - = nav_link(controller: :milestones) do - = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do - = navbar_icon('milestones') - %span - Milestones - - if project_nav_tab? :issues - = nav_link(controller: :issues) do + = nav_link(controller: [:issues, :labels, :milestones]) do = link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues' do = navbar_icon('issues') %span @@ -86,13 +79,6 @@ Merge Requests %span.badge.count.merge_counter= number_with_delimiter(@project.merge_requests.opened.count) - - if project_nav_tab? :labels - = nav_link(controller: :labels) do - = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do - = icon('tags fw') - %span - Labels - - if project_nav_tab? :wiki = nav_link(controller: :wikis) do = link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..166dae248b635258e0b571e4fd0b67806415ffd1 --- /dev/null +++ b/app/views/projects/issues/_head.html.haml @@ -0,0 +1,25 @@ +%ul.nav-links.sub-nav + %div{ class: (container_class) } + - if project_nav_tab?(:issues) && !current_controller?(:merge_requests) + = nav_link(controller: :issues) do + = link_to url_for_project_issues(@project, only_path: true), title: 'Issues' do + %span + Issues + + - if project_nav_tab?(:merge_requests) && current_controller?(:merge_requests) + = nav_link(controller: :merge_requests) do + = link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests' do + %span + Merge Requests + + - if project_nav_tab? :labels + = nav_link(controller: :labels) do + = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do + %span + Labels + + - if project_nav_tab? :milestones + = nav_link(controller: :milestones) do + = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do + %span + Milestones diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index 7c1457553d932a119c92a70d37c36fccfd26c415..cd876b5ea62d5aa58f65fc54278c44dd90108dcc 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -1,23 +1,26 @@ +- @no_container = true - page_title "Issues" += render "projects/issues/head" = content_for :meta_tags do - if current_user = auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") -.top-area - = render 'shared/issuable/nav', type: :issues - .nav-controls - - if current_user - = link_to namespace_project_issues_path(@project.namespace, @project, :atom, { private_token: current_user.private_token }), class: 'btn append-right-10' do - = icon('rss') - %span.icon-label - Subscribe - = render 'shared/issuable/search_form', path: namespace_project_issues_path(@project.namespace, @project) - - if can? current_user, :create_issue, @project - = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { assignee_id: @issuable_finder.assignee.try(:id), milestone_id: @issuable_finder.milestones.try(:first).try(:id) }), class: "btn btn-new", title: "New Issue", id: "new_issue_link" do - New Issue +%div{ class: (container_class) } + .top-area + = render 'shared/issuable/nav', type: :issues + .nav-controls + - if current_user + = link_to namespace_project_issues_path(@project.namespace, @project, :atom, { private_token: current_user.private_token }), class: 'btn append-right-10' do + = icon('rss') + %span.icon-label + Subscribe + = render 'shared/issuable/search_form', path: namespace_project_issues_path(@project.namespace, @project) + - if can? current_user, :create_issue, @project + = link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { assignee_id: @issuable_finder.assignee.try(:id), milestone_id: @issuable_finder.milestones.try(:first).try(:id) }), class: "btn btn-new", title: "New Issue", id: "new_issue_link" do + New Issue -= render 'shared/issuable/filter', type: :issues + = render 'shared/issuable/filter', type: :issues -.issues-holder - = render "issues" + .issues-holder + = render "issues" diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 93583c92609d188a3d75e3e14da5b561979dbf2e..6e1baa46b05ad94f3d20f410b33bbbd50328427b 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -1,35 +1,38 @@ +- @no_container = true - page_title "Labels" - hide_class = '' += render "projects/issues/head" -.top-area - .nav-text - Labels can be applied to issues and merge requests. - .nav-controls - - if can?(current_user, :admin_label, @project) - = link_to new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new" do - New label +%div{ class: (container_class) } + .top-area + .nav-text + Labels can be applied to issues and merge requests. + .nav-controls + - if can?(current_user, :admin_label, @project) + = link_to new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new" do + New label -.labels - - if can?(current_user, :admin_label, @project) - -# Only show it in the first page - - hide = @project.labels.empty? || (params[:page].present? && params[:page] != '1') - .prioritized-labels{ class: ('hide' if hide) } - %h5 Prioritized Labels - %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) } - - if @prioritized_labels.present? - = render @prioritized_labels - - else - %p.empty-message No prioritized labels yet - .other-labels + .labels - if can?(current_user, :admin_label, @project) - %h5{ class: ('hide' if hide) } Other Labels - - if @labels.present? - %ul.content-list.manage-labels-list.js-other-labels - = render @labels - = paginate @labels, theme: 'gitlab' - - else - .nothing-here-block - - if can?(current_user, :admin_label, @project) - Create a label or #{link_to 'generate a default set of labels', generate_namespace_project_labels_path(@project.namespace, @project), method: :post}. - - else - No labels created + -# Only show it in the first page + - hide = @project.labels.empty? || (params[:page].present? && params[:page] != '1') + .prioritized-labels{ class: ('hide' if hide) } + %h5 Prioritized Labels + %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) } + - if @prioritized_labels.present? + = render @prioritized_labels + - else + %p.empty-message No prioritized labels yet + .other-labels + - if can?(current_user, :admin_label, @project) + %h5{ class: ('hide' if hide) } Other Labels + - if @labels.present? + %ul.content-list.manage-labels-list.js-other-labels + = render @labels + = paginate @labels, theme: 'gitlab' + - else + .nothing-here-block + - if can?(current_user, :admin_label, @project) + Create a label or #{link_to 'generate a default set of labels', generate_namespace_project_labels_path(@project.namespace, @project), method: :post}. + - else + No labels created diff --git a/app/views/projects/merge_requests/_head.html.haml b/app/views/projects/merge_requests/_head.html.haml deleted file mode 100644 index 19e4dab874bcd9e805232b5abf8bd6aa1c2f2ab7..0000000000000000000000000000000000000000 --- a/app/views/projects/merge_requests/_head.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -.top-tabs - = link_to namespace_project_merge_requests_path(@project.namespace, @project), class: "tab #{'active' if current_page?(namespace_project_merge_requests_path(@project.namespace, @project)) }" do - %span - Merge Requests - diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index c8653cb0c306497d5b1af97c4750ba41f25da420..9f948d41ddaf8a963d3b0388d60d9da9d4bf7a0a 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -1,18 +1,20 @@ +- @no_container = true - page_title "Merge Requests" - += render "projects/issues/head" = render 'projects/last_push' -.top-area - = render 'shared/issuable/nav', type: :merge_requests - .nav-controls - = render 'shared/issuable/search_form', path: namespace_project_merge_requests_path(@project.namespace, @project) +%div{ class: (container_class) } + .top-area + = render 'shared/issuable/nav', type: :merge_requests + .nav-controls + = render 'shared/issuable/search_form', path: namespace_project_merge_requests_path(@project.namespace, @project) - - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) - - if merge_project - = link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project), class: "btn btn-new", title: "New Merge Request" do - New Merge Request + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + = link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project), class: "btn btn-new", title: "New Merge Request" do + New Merge Request -= render 'shared/issuable/filter', type: :merge_requests + = render 'shared/issuable/filter', type: :merge_requests -.merge-requests-holder - = render 'merge_requests' + .merge-requests-holder + = render 'merge_requests' diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml index 60a5b83434efe345f8a7ed292021a5c229ae0623..b0e0bdfff5ad60ca8d6eb8b7ee2e1dd00ae72321 100644 --- a/app/views/projects/milestones/index.html.haml +++ b/app/views/projects/milestones/index.html.haml @@ -1,19 +1,22 @@ +- @no_container = true - page_title "Milestones" += render "projects/issues/head" -.top-area - = render 'shared/milestones_filter' +%div{ class: (container_class) } + .top-area + = render 'shared/milestones_filter' - .nav-controls - - if can?(current_user, :admin_milestone, @project) - = link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "btn btn-new", title: "New Milestone" do - New Milestone + .nav-controls + - if can?(current_user, :admin_milestone, @project) + = link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "btn btn-new", title: "New Milestone" do + New Milestone -.milestones - %ul.content-list - = render @milestones + .milestones + %ul.content-list + = render @milestones - - if @milestones.blank? - %li - .nothing-here-block No milestones to show + - if @milestones.blank? + %li + .nothing-here-block No milestones to show - = paginate @milestones, theme: "gitlab" + = paginate @milestones, theme: "gitlab" diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index 26e6750302190c9852d7ef803fb99cb0ded1a31f..c4f987a7923fd218b3f52f6001fc9e487ee67dce 100644 --- a/features/project/active_tab.feature +++ b/features/project/active_tab.feature @@ -107,12 +107,16 @@ Feature: Project Active Tab Scenario: On Project Issues/Milestones Given I visit my project's issues page - And I click the "Milestones" tab - Then the active main tab should be Milestones + And I click the "Milestones" sub tab + Then the active main tab should be Issues + Then the active sub tab should be Milestones And no other main tabs should be active + And no other sub tabs should be active Scenario: On Project Issues/Labels Given I visit my project's issues page - And I click the "Labels" tab - Then the active main tab should be Labels + And I click the "Labels" sub tab + Then the active main tab should be Issues + Then the active sub tab should be Labels And no other main tabs should be active + And no other sub tabs should be active diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index 745fd3471c495307998346fd616b307dee402a9d..80043463188d568d438c7c65d6697908f4bb4f3e 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -77,14 +77,14 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps # Sub Tabs: Issues - step 'I click the "Milestones" tab' do - page.within('.layout-nav') do + step 'I click the "Milestones" sub tab' do + page.within('.sub-nav') do click_link('Milestones') end end - step 'I click the "Labels" tab' do - page.within('.layout-nav') do + step 'I click the "Labels" sub tab' do + page.within('.sub-nav') do click_link('Labels') end end @@ -93,11 +93,11 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps ensure_active_sub_tab('Issues') end - step 'the active main tab should be Milestones' do - ensure_active_main_tab('Milestones') + step 'the active sub tab should be Milestones' do + ensure_active_sub_tab('Milestones') end - step 'the active main tab should be Labels' do - ensure_active_main_tab('Labels') + step 'the active sub tab should be Labels' do + ensure_active_sub_tab('Labels') end end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index ace717b99094d87cb6dc4aa6ba33f0201fa37e89..4eef7aff213f126543019f7f17bac53c7ea4b3a4 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -6,7 +6,7 @@ module SharedActiveTab end def ensure_active_sub_tab(content) - expect(find('div.content ul.nav-links li.active')).to have_content(content) + expect(find('.sub-nav li.active')).to have_content(content) end def ensure_active_sub_nav(content) @@ -18,7 +18,7 @@ module SharedActiveTab end step 'no other sub tabs should be active' do - expect(page).to have_selector('div.content ul.nav-links li.active', count: 1) + expect(page).to have_selector('.sub-nav li.active', count: 1) end step 'no other sub navs should be active' do