Commit f60307d2 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '207845-add-requirements-management-nav-item' into 'master'

Add Requirements navigation link & placeholder page

Closes #207845

See merge request gitlab-org/gitlab!27086
parents a5004c79 7241cf54
......@@ -159,6 +159,8 @@
%span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge
= number_with_delimiter(@project.open_merge_requests_count)
= render_if_exists "layouts/nav/requirements_link", project: @project
- if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :artifacts], unless: -> { current_path?('projects/pipelines#charts') }) do
= link_to project_pipelines_path(@project), class: 'shortcuts-pipelines qa-link-pipelines rspec-link-pipelines', data: { qa_selector: 'ci_cd_link' } do
......
- return unless Feature.enabled?(:requirements_management, project)
= nav_link(path: 'requirements#index') do
= link_to project_requirements_path(project), class: 'qa-project-requirements-link' do
.nav-icon-container
= sprite_icon('list-task')
%span.nav-item-name
= _('Requirements')
%ul.sidebar-sub-level-items
= nav_link(path: 'requirements#index', html_options: { class: "fly-out-top-item" } ) do
= link_to project_requirements_path(project) do
%strong.fly-out-top-item-name= _('Requirements')
%span.badge.badge-pill.count.requirements_counter.fly-out-badge
%li.divider.fly-out-top-item
= nav_link(path: 'requirements#index', html_options: { class: 'home' }) do
= link_to project_requirements_path(project), title: 'List' do
%span= _('List')
= _('Not Implemented')
- page_title _('Requirements')
-# haml-lint:disable NoPlainNodes
%h1 Hello World from Requirements!
......@@ -7,6 +7,12 @@ describe 'EE-specific project routing' do
allow(Project).to receive(:find_by_full_path).with('gitlab/gitlabhq', any_args).and_return(true)
end
describe Projects::RequirementsController, 'routing', type: :routing do
it "to #index" do
expect(get("/gitlab/gitlabhq/-/requirements")).to route_to('projects/requirements#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
end
end
# project_vulnerability_feedback GET /:project_id/vulnerability_feedback(.:format) projects/vulnerability_feedback#index
# POST /:project_id/vulnerability_feedback(.:format) projects/vulnerability_feedback#create
# project_vulnerability_feedback DELETE /:project_id/vulnerability_feedback/:id(.:format) projects/vulnerability_feedback#destroy
......
......@@ -16775,6 +16775,9 @@ msgstr ""
msgid "Require users to prove ownership of custom domains"
msgstr ""
msgid "Requirements"
msgstr ""
msgid "Requires approval from %{names}."
msgid_plural "Requires %{count} more approvals from %{names}."
msgstr[0] ""
......
......@@ -18,6 +18,13 @@ describe 'Project navbar' do
}
end
let(:requirements_nav_item) do
{
nav_item: _('Requirements'),
nav_sub_items: [_('List')]
}
end
let(:structure) do
[
{
......@@ -54,6 +61,7 @@ describe 'Project navbar' do
nav_item: _('Merge Requests'),
nav_sub_items: []
},
(requirements_nav_item if Gitlab.ee?),
{
nav_item: _('CI / CD'),
nav_sub_items: [
......@@ -100,6 +108,7 @@ describe 'Project navbar' do
end
before do
stub_licensed_features(requirements: false)
project.add_maintainer(user)
sign_in(user)
end
......@@ -123,5 +132,15 @@ describe 'Project navbar' do
it_behaves_like 'verified navigation bar'
end
context 'when requirements is available' do
before do
stub_licensed_features(requirements: true)
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
end
end
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