Commit 2b9e0bc6 authored by Alexander Turinske's avatar Alexander Turinske

Remove Vulnerability List from the sidepanel

- remove it from the breadcrumb of the vulnerability page
- remove tests
- remove routing to :index
- remove before action
parent ee8c2f61
import Vue from 'vue';
import ProjectVulnerabilitiesApp from 'ee/vulnerabilities/components/project_vulnerabilities_app.vue';
import createDefaultClient from '~/lib/graphql';
import VueApollo from 'vue-apollo';
Vue.use(VueApollo);
function render() {
const el = document.getElementById('app');
if (!el) {
return false;
}
const { dashboardDocumentation, emptyStateSvgPath, projectFullPath } = el.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
return new Vue({
el,
apolloProvider,
render(createElement) {
return createElement(ProjectVulnerabilitiesApp, {
props: {
emptyStateSvgPath,
dashboardDocumentation,
projectFullPath,
},
});
},
});
}
window.addEventListener('DOMContentLoaded', () => {
render();
});
...@@ -8,14 +8,10 @@ module Projects ...@@ -8,14 +8,10 @@ module Projects
include RendersNotes include RendersNotes
before_action :not_found, unless: -> { project.first_class_vulnerabilities_enabled? } before_action :not_found, unless: -> { project.first_class_vulnerabilities_enabled? }
before_action :vulnerability, except: :index before_action :vulnerability
alias_method :vulnerable, :project alias_method :vulnerable, :project
def index
@vulnerabilities = project.vulnerabilities.page(params[:page])
end
def show def show
pipeline = vulnerability.finding.pipelines.first pipeline = vulnerability.finding.pipelines.first
@pipeline = pipeline if Ability.allowed?(current_user, :read_pipeline, pipeline) @pipeline = pipeline if Ability.allowed?(current_user, :read_pipeline, pipeline)
......
...@@ -167,7 +167,6 @@ module EE ...@@ -167,7 +167,6 @@ module EE
%w[ %w[
projects/security/configuration#show projects/security/configuration#show
projects/security/dashboard#index projects/security/dashboard#index
projects/security/vulnerabilities#index
projects/dependencies#index projects/dependencies#index
projects/licenses#index projects/licenses#index
projects/threat_monitoring#show projects/threat_monitoring#show
......
...@@ -21,11 +21,6 @@ ...@@ -21,11 +21,6 @@
= link_to project_security_dashboard_index_path(@project), title: _('Security Dashboard') do = link_to project_security_dashboard_index_path(@project), title: _('Security Dashboard') do
%span= _('Security Dashboard') %span= _('Security Dashboard')
- if project_nav_tab?(:security) && Feature.enabled?(:first_class_vulnerabilities, @project, default_enabled: true)
= nav_link(path: 'projects/security/vulnerabilities#index') do
= link_to project_security_vulnerabilities_path(@project), title: _('Vulnerability List') do
%span= _('Vulnerability List')
- if project_nav_tab?(:dependencies) - if project_nav_tab?(:dependencies)
= nav_link(path: 'projects/dependencies#index') do = nav_link(path: 'projects/dependencies#index') do
= link_to project_dependencies_path(@project), title: _('Dependency List'), data: { qa_selector: 'dependency_list_link' } do = link_to project_dependencies_path(@project), title: _('Dependency List'), data: { qa_selector: 'dependency_list_link' } do
......
- add_to_breadcrumbs _("Security Dashboard"), project_security_dashboard_index_path(@project)
- breadcrumb_title _("Vulnerabilities")
- page_title _("Vulnerabilities")
.issue-details.issuable-details
%h2.title= _("Vulnerabilities")
#app{ data: { empty_state_svg_path: image_path('illustrations/security-dashboard_empty.svg'),
vulnerabilities_endpoint: expose_path(api_v4_projects_vulnerabilities_path(id: @project.id)),
vulnerability_exports_endpoint: expose_path(api_v4_security_projects_vulnerability_exports_path(id: @project.id)),
project_full_path: @project.full_path,
dashboard_documentation: help_page_path('user/application_security/security_dashboard/index') } }
-# Display table loading animation while Vue app loads
%table.table.gl-table
%thead
%tr
%th.animation-container
.skeleton-line-1
%tbody
- 10.times do |n|
%tr
%td.animation-container
.skeleton-line-1
.skeleton-line-2
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- add_to_breadcrumbs _("Vulnerability List"), project_security_vulnerabilities_path(@project) - add_to_breadcrumbs _("Security Dashboard"), project_security_dashboard_index_path(@project)
- breadcrumb_title @vulnerability.id - breadcrumb_title @vulnerability.id
- page_title @vulnerability.title - page_title @vulnerability.title
- page_description @vulnerability.description - page_description @vulnerability.description
......
...@@ -78,7 +78,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -78,7 +78,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
resources :vulnerabilities, only: [:show, :index] do resources :vulnerabilities, only: [:show] do
member do member do
get :discussions, format: :json get :discussions, format: :json
end end
......
...@@ -7,54 +7,11 @@ describe Projects::Security::VulnerabilitiesController do ...@@ -7,54 +7,11 @@ describe Projects::Security::VulnerabilitiesController do
let_it_be(:project) { create(:project, :repository, :public, namespace: group) } let_it_be(:project) { create(:project, :repository, :public, namespace: group) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
it_behaves_like SecurityDashboardsPermissions do
let(:vulnerable) { project }
let(:security_dashboard_action) do
get :index, params: { namespace_id: project.namespace, project_id: project }
end
end
before do before do
group.add_developer(user) group.add_developer(user)
stub_licensed_features(security_dashboard: true) stub_licensed_features(security_dashboard: true)
end end
describe 'GET #index' do
render_views
def show_vulnerability_list(current_user = user)
sign_in(current_user)
get :index, params: { namespace_id: project.namespace, project_id: project }
end
context "when we have vulnerabilities" do
2.times do
let_it_be(:vulnerability) { create(:vulnerability, project: project) }
let_it_be(:finding) { create(:vulnerabilities_occurrence, vulnerability: vulnerability) }
end
it 'renders the vulnerability list' do
show_vulnerability_list
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index)
end
end
context 'when the feature flag is disabled' do
before do
stub_feature_flags(first_class_vulnerabilities: false)
end
it 'renders the 404 page' do
show_vulnerability_list
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
describe 'GET #show' do describe 'GET #show' do
let_it_be(:pipeline) { create(:ci_pipeline, sha: project.commit.id, project: project, user: user) } let_it_be(:pipeline) { create(:ci_pipeline, sha: project.commit.id, project: project, user: user) }
let_it_be(:vulnerability) { create(:vulnerability, project: project) } let_it_be(:vulnerability) { create(:vulnerability, project: project) }
......
...@@ -47,7 +47,6 @@ describe 'Project navbar' do ...@@ -47,7 +47,6 @@ describe 'Project navbar' do
nav_item: _('Security & Compliance'), nav_item: _('Security & Compliance'),
nav_sub_items: [ nav_sub_items: [
_('Security Dashboard'), _('Security Dashboard'),
_('Vulnerability List'),
_('Configuration') _('Configuration')
] ]
} }
......
...@@ -23664,9 +23664,6 @@ msgstr "" ...@@ -23664,9 +23664,6 @@ msgstr ""
msgid "Vulnerabilities over time" msgid "Vulnerabilities over time"
msgstr "" msgstr ""
msgid "Vulnerability List"
msgstr ""
msgid "Vulnerability remediated. Review before resolving." msgid "Vulnerability remediated. Review before resolving."
msgstr "" 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