Commit 10e35363 authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch '214034-remove-vulnerability-list' into 'master'

Remove Vulnerability List from the sidepanel

See merge request gitlab-org/gitlab!30091
parents 4b74033f 2b9e0bc6
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
include RendersNotes
before_action :not_found, unless: -> { project.first_class_vulnerabilities_enabled? }
before_action :vulnerability, except: :index
before_action :vulnerability
alias_method :vulnerable, :project
def index
@vulnerabilities = project.vulnerabilities.page(params[:page])
end
def show
pipeline = vulnerability.finding.pipelines.first
@pipeline = pipeline if Ability.allowed?(current_user, :read_pipeline, pipeline)
......
......@@ -167,7 +167,6 @@ module EE
%w[
projects/security/configuration#show
projects/security/dashboard#index
projects/security/vulnerabilities#index
projects/dependencies#index
projects/licenses#index
projects/threat_monitoring#show
......
......@@ -21,11 +21,6 @@
= link_to project_security_dashboard_index_path(@project), title: _('Security Dashboard') do
%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)
= nav_link(path: 'projects/dependencies#index') 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
- 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
- page_title @vulnerability.title
- page_description @vulnerability.description
......
......@@ -78,7 +78,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
resources :vulnerabilities, only: [:show, :index] do
resources :vulnerabilities, only: [:show] do
member do
get :discussions, format: :json
end
......
......@@ -7,54 +7,11 @@ describe Projects::Security::VulnerabilitiesController do
let_it_be(:project) { create(:project, :repository, :public, namespace: group) }
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
group.add_developer(user)
stub_licensed_features(security_dashboard: true)
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
let_it_be(:pipeline) { create(:ci_pipeline, sha: project.commit.id, project: project, user: user) }
let_it_be(:vulnerability) { create(:vulnerability, project: project) }
......
......@@ -47,7 +47,6 @@ describe 'Project navbar' do
nav_item: _('Security & Compliance'),
nav_sub_items: [
_('Security Dashboard'),
_('Vulnerability List'),
_('Configuration')
]
}
......
......@@ -23707,9 +23707,6 @@ msgstr ""
msgid "Vulnerabilities over time"
msgstr ""
msgid "Vulnerability List"
msgstr ""
msgid "Vulnerability remediated. Review before resolving."
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