Commit 7241cf54 authored by Kushal Pandya's avatar Kushal Pandya

Add Requirements navigation link & page

Adds Requirements nav link to Projects nav sidebar and
placeholder page to host Requirements app.
parent 4375dac6
...@@ -159,6 +159,8 @@ ...@@ -159,6 +159,8 @@
%span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge %span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge
= number_with_delimiter(@project.open_merge_requests_count) = number_with_delimiter(@project.open_merge_requests_count)
= render_if_exists "layouts/nav/requirements_link", project: @project
- if project_nav_tab? :pipelines - if project_nav_tab? :pipelines
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :artifacts], unless: -> { current_path?('projects/pipelines#charts') }) do = 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 = 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 ...@@ -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) allow(Project).to receive(:find_by_full_path).with('gitlab/gitlabhq', any_args).and_return(true)
end 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 # project_vulnerability_feedback GET /:project_id/vulnerability_feedback(.:format) projects/vulnerability_feedback#index
# POST /:project_id/vulnerability_feedback(.:format) projects/vulnerability_feedback#create # POST /:project_id/vulnerability_feedback(.:format) projects/vulnerability_feedback#create
# project_vulnerability_feedback DELETE /:project_id/vulnerability_feedback/:id(.:format) projects/vulnerability_feedback#destroy # project_vulnerability_feedback DELETE /:project_id/vulnerability_feedback/:id(.:format) projects/vulnerability_feedback#destroy
......
...@@ -16763,6 +16763,9 @@ msgstr "" ...@@ -16763,6 +16763,9 @@ msgstr ""
msgid "Require users to prove ownership of custom domains" msgid "Require users to prove ownership of custom domains"
msgstr "" msgstr ""
msgid "Requirements"
msgstr ""
msgid "Requires approval from %{names}." msgid "Requires approval from %{names}."
msgid_plural "Requires %{count} more approvals from %{names}." msgid_plural "Requires %{count} more approvals from %{names}."
msgstr[0] "" msgstr[0] ""
......
...@@ -18,6 +18,13 @@ describe 'Project navbar' do ...@@ -18,6 +18,13 @@ describe 'Project navbar' do
} }
end end
let(:requirements_nav_item) do
{
nav_item: _('Requirements'),
nav_sub_items: [_('List')]
}
end
let(:structure) do let(:structure) do
[ [
{ {
...@@ -54,6 +61,7 @@ describe 'Project navbar' do ...@@ -54,6 +61,7 @@ describe 'Project navbar' do
nav_item: _('Merge Requests'), nav_item: _('Merge Requests'),
nav_sub_items: [] nav_sub_items: []
}, },
(requirements_nav_item if Gitlab.ee?),
{ {
nav_item: _('CI / CD'), nav_item: _('CI / CD'),
nav_sub_items: [ nav_sub_items: [
...@@ -100,6 +108,7 @@ describe 'Project navbar' do ...@@ -100,6 +108,7 @@ describe 'Project navbar' do
end end
before do before do
stub_licensed_features(requirements: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
end end
...@@ -123,5 +132,15 @@ describe 'Project navbar' do ...@@ -123,5 +132,15 @@ describe 'Project navbar' do
it_behaves_like 'verified navigation bar' it_behaves_like 'verified navigation bar'
end 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
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