Commit e779ebbc authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'req-rename-api' into 'master'

Requirements_management rename - controller+route

See merge request gitlab-org/gitlab!30583
parents e29ec55e 5babf538
# frozen_string_literal: true
class Projects::RequirementsController < Projects::ApplicationController
class Projects::RequirementsManagement::RequirementsController < Projects::ApplicationController
before_action :authorize_read_requirement!
before_action :verify_requirements_management_flag!
before_action do
......
......@@ -2,16 +2,16 @@
- return unless can?(current_user, :read_requirement, project)
= nav_link(path: 'requirements#index') do
= link_to project_requirements_path(project), class: 'qa-project-requirements-link' do
= link_to project_requirements_management_requirements_path(project), class: 'qa-project-requirements-link' do
.nav-icon-container
= sprite_icon('requirements')
%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
= link_to project_requirements_management_requirements_path(project) do
%strong.fly-out-top-item-name= _('Requirements')
%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
= link_to project_requirements_management_requirements_path(project), title: 'List' do
%span= _('List')
......@@ -49,7 +49,7 @@
opened: requirements_count['opened'],
archived: requirements_count['archived'],
all: total_requirements,
requirements_web_url: project_requirements_path(@project),
requirements_web_url: project_requirements_management_requirements_path(@project),
can_create_requirement: can?(current_user, :create_requirement, @project),
empty_state_path: image_path('illustrations/empty-state/empty-requirements-lg.svg') } }
- if current_tab_count == 0
......
---
title: Change UI requirements route from project/requirements to project/requirements_management/requirements
merge_request: 30583
author:
type: changed
......@@ -11,7 +11,10 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
# Begin of the /-/ scope.
# Use this scope for all new project routes.
scope '-' do
namespace :requirements_management do
resources :requirements, only: [:index]
end
resources :packages, only: [:index, :show, :destroy], module: :packages
resources :package_files, only: [], module: :packages do
member do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Projects::RequirementsController do
describe Projects::RequirementsManagement::RequirementsController do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
......
......@@ -35,7 +35,7 @@ describe 'Requirements list', :js do
context 'when requirements exist for the project' do
before do
visit project_requirements_path(project)
visit project_requirements_management_requirements_path(project)
wait_for_requests
end
......@@ -245,7 +245,7 @@ describe 'Requirements list', :js do
context 'when accessing project as guest user' do
before do
sign_in(user_guest)
visit project_requirements_path(project)
visit project_requirements_management_requirements_path(project)
wait_for_requests
end
......
......@@ -7,9 +7,9 @@ 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
describe Projects::RequirementsManagement::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')
expect(get("/gitlab/gitlabhq/-/requirements_management/requirements")).to route_to('projects/requirements_management/requirements#index', namespace_id: 'gitlab', project_id: 'gitlabhq')
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