Commit c0e443ad authored by Mark Florian's avatar Mark Florian

Add Dependency List view skeleton

Part of the larger [Dependency List MVC][mvc].

This only adds the rails view, from which the client-side application
can bootstrap itself.

[mvc]: https://gitlab.com/gitlab-org/gitlab-ee/issues/10075
parent 0c8f1ccf
......@@ -36,6 +36,8 @@
= render_if_exists 'projects/sidebar/security_dashboard'
= render_if_exists 'projects/sidebar/dependencies'
- if can?(current_user, :read_cycle_analytics, @project)
= nav_link(path: 'cycle_analytics#show') do
= link_to project_cycle_analytics_path(@project), title: _('Cycle Analytics'), class: 'shortcuts-project-cycle-analytics' do
......
# frozen_string_literal: true
module Projects
class DependenciesController < Projects::ApplicationController
before_action :check_feature_enabled!
def check_feature_enabled!
render_404 unless project.feature_available?(:dependency_list)
end
end
end
- breadcrumb_title _('Dependency List')
- page_title _('Dependency List')
#js-dependencies-app{ data: { endpoint: project_security_dependencies_path(@project), documentation_path: help_page_path('user/application_security/dependency_scanning/index'), empty_state_svg_path: image_path('illustrations/Dependency-list-empty-state.svg') } }
- if @project.feature_available?(:dependency_list)
= nav_link(path: 'projects/dependencies#show') do
= link_to project_dependencies_path(@project), title: _('Dependency List'), class: 'shortcuts-project-dependencies' do
%span= _('Dependency List')
---
title: Add preliminary Dependency List frontend implementation.
merge_request: 13968
author:
type: added
......@@ -83,6 +83,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resource :dependencies, only: [:show]
namespace :security do
resources :dependencies, only: [:index]
end
......
# frozen_string_literal: true
require 'spec_helper'
describe Projects::DependenciesController do
set(:project) { create(:project, :repository, :public) }
set(:user) { create(:user) }
subject { get :show, params: { namespace_id: project.namespace, project_id: project } }
before do
project.add_developer(user)
end
describe 'GET show' do
context 'with authorized user' do
before do
sign_in(user)
end
context 'when feature is available' do
before do
stub_licensed_features(dependency_list: true)
end
it 'renders the show template' do
subject
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:show)
end
end
context 'when feature is not available' do
it 'returns 404' do
subject
expect(response).to have_gitlab_http_status(404)
end
end
end
context 'with unauthorized user' do
it 'returns 404' do
subject
expect(response).to have_gitlab_http_status(404)
end
end
end
end
......@@ -4093,6 +4093,9 @@ msgstr ""
msgid "Dependencies|Version"
msgstr ""
msgid "Dependency List"
msgstr ""
msgid "Dependency Proxy"
msgstr ""
......
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