Commit e453c3e2 authored by Fatih Acet's avatar Fatih Acet

Merge branch '7631-remove-security-report-summary-from-pipelines-view-ee' into 'master'

Remove security report summary from pipelines view

Closes gitlab-ce#48031 and #7631

See merge request gitlab-org/gitlab-ee!7844
parents 6c475235 1e5afcbb
......@@ -30,5 +30,3 @@
%span.js-details-content.hide
= link_to @pipeline.sha, project_commit_path(@project, @pipeline.sha), class: "commit-sha commit-hash-full"
= clipboard_button(text: @pipeline.sha, title: "Copy commit SHA to clipboard")
= render_if_exists "projects/pipelines/info_extension", pipeline: @pipeline
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import SecurityReportApp from 'ee/vue_shared/security_reports/split_security_reports_app.vue';
import SastSummaryWidget from 'ee/pipelines/components/security_reports/report_summary_widget.vue';
import createStore from 'ee/vue_shared/security_reports/store';
import { convertPermissionToBoolean } from '~/lib/utils/common_utils';
import { updateBadgeCount } from './utils';
......@@ -10,7 +9,6 @@ Vue.use(Translate);
export default () => {
const securityTab = document.getElementById('js-security-report-app');
const sastSummary = document.querySelector('.js-sast-summary');
// They are being rendered under the same condition
if (securityTab) {
......@@ -34,21 +32,6 @@ export default () => {
const store = createStore();
// Widget summary
if (sastSummary) {
// eslint-disable-next-line no-new
new Vue({
el: sastSummary,
store,
components: {
SastSummaryWidget,
},
render(createElement) {
return createElement('sast-summary-widget');
},
});
}
// Tab content
// eslint-disable-next-line no-new
new Vue({
......@@ -76,7 +59,7 @@ export default () => {
canCreateIssue: convertPermissionToBoolean(canCreateIssue),
},
on: {
updateBadgeCount: (count) => {
updateBadgeCount: count => {
updateBadgeCount('.js-sast-counter', count);
},
},
......
<script>
import { mapState } from 'vuex';
import $ from 'jquery';
import { n__, s__ } from '~/locale';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import messages from 'ee/vue_shared/security_reports/store/messages';
export default {
name: 'SummaryReport',
components: {
CiIcon,
},
messages,
computed: {
...mapState(['sast', 'dependencyScanning', 'dast', 'sastContainer']),
sastLink() {
return this.link(this.sast.newIssues.length);
},
dependencyScanningLink() {
return this.link(this.dependencyScanning.newIssues.length);
},
dastLink() {
return this.link(this.dast.newIssues.length);
},
sastContainerLink() {
return this.link(this.sastContainer.newIssues.length);
},
sastIcon() {
return this.statusIcon(this.hasSastError, this.sast.newIssues.length);
},
dependencyScanningIcon() {
return this.statusIcon(
this.hasDependencyScanningError,
this.dependencyScanning.newIssues.length,
);
},
dastIcon() {
return this.statusIcon(this.hasDastError, this.dast.newIssues.length);
},
sastContainerIcon() {
return this.statusIcon(this.hasSastContainerError, this.sastContainer.newIssues.length);
},
hasSast() {
return this.sast.paths.head !== null;
},
hasDependencyScanning() {
return this.dependencyScanning.paths.head !== null;
},
hasDast() {
return this.dast.paths.head !== null;
},
hasSastContainer() {
return this.sastContainer.paths.head !== null;
},
isLoadingSast() {
return this.sast.isLoading;
},
isLoadingDependencyScanning() {
return this.dependencyScanning.isLoading;
},
isLoadingDast() {
return this.dast.isLoading;
},
isLoadingSastContainer() {
return this.sastContainer.isLoading;
},
hasSastError() {
return this.sast.hasError;
},
hasDependencyScanningError() {
return this.dependencyScanning.hasError;
},
hasDastError() {
return this.dast.hasError;
},
hasSastContainerError() {
return this.sastContainer.hasError;
},
},
methods: {
openTab() {
// This opens a tab outside of this Vue application
// It opens the securty report tab in the pipelines page and updates the URL
// This is needed because the tabs are built in haml+jquery
$('.pipelines-tabs a[data-action="security"]').tab('show');
},
link(issuesCount = 0) {
if (issuesCount > 0) {
return n__('%d vulnerability', '%d vulnerabilities', issuesCount);
}
return s__('ciReport|no vulnerabilities');
},
statusIcon(failed = true, issuesCount = 0) {
if (issuesCount > 0 || failed) {
return {
group: 'warning',
icon: 'status_warning',
};
}
return {
group: 'success',
icon: 'status_success',
};
},
},
};
</script>
<template>
<div>
<div
v-if="hasSast"
class="well-segment flex js-sast-summary"
>
<gl-loading-icon
v-if="isLoadingSast"
/>
<ci-icon
v-else
:status="sastIcon"
class="flex flex-align-self-center"
/>
<span
class="prepend-left-10 flex flex-align-self-center"
>
<template v-if="hasSastError">
{{ $options.messages.SAST_HAS_ERROR }}
</template>
<template v-else-if="isLoadingSast">
{{ $options.messages.SAST_IS_LOADING }}
</template>
<template v-else>
{{ s__('ciReport|SAST detected') }}
<button
type="button"
class="btn-link btn-blank prepend-left-5"
@click="openTab"
>
{{ sastLink }}
</button>
</template>
</span>
</div>
<div
v-if="hasDependencyScanning"
class="well-segment flex js-dss-summary"
>
<gl-loading-icon
v-if="isLoadingDependencyScanning"
/>
<ci-icon
v-else
:status="dependencyScanningIcon"
class="flex flex-align-self-center"
/>
<span
class="prepend-left-10 flex flex-align-self-center"
>
<template v-if="hasDependencyScanningError">
{{ $options.messages.DEPENDENCY_SCANNING_HAS_ERROR }}
</template>
<template v-else-if="isLoadingDependencyScanning">
{{ $options.messages.DEPENDENCY_SCANNING_IS_LOADING }}
</template>
<template v-else>
{{ s__('ciReport|Dependency scanning detected') }}
<button
type="button"
class="btn-link btn-blank prepend-left-5"
@click="openTab"
>
{{ dependencyScanningLink }}
</button>
</template>
</span>
</div>
<div
v-if="hasSastContainer"
class="well-segment flex js-sast-container-summary"
>
<gl-loading-icon
v-if="isLoadingSastContainer"
/>
<ci-icon
v-else
:status="sastContainerIcon"
class="flex flex-align-self-center"
/>
<span
class="prepend-left-10 flex flex-align-self-center"
>
<template v-if="hasSastContainerError">
{{ $options.messages.CONTAINER_SCANNING_HAS_ERROR }}
</template>
<template v-else-if="isLoadingSastContainer">
{{ $options.messages.CONTAINER_SCANNING_IS_LOADING }}
</template>
<template v-else>
{{ s__('ciReport|Container scanning detected') }}
<button
type="button"
class="btn-link btn-blank prepend-left-5"
@click="openTab"
>
{{ sastContainerLink }}
</button>
</template>
</span>
</div>
<div
v-if="hasDast"
class="well-segment flex js-dast-summary"
>
<gl-loading-icon
v-if="isLoadingDast"
/>
<ci-icon
v-else
:status="dastIcon"
class="flex flex-align-self-center"
/>
<span
class="prepend-left-10 flex flex-align-self-center"
>
<template v-if="hasDastError">
{{ $options.messages.DAST_HAS_ERROR }}
</template>
<template v-else-if="isLoadingDast">
{{ $options.messages.DAST_IS_LOADING }}
</template>
<template v-else>
{{ s__('ciReport|DAST detected') }}
<button
type="button"
class="btn-link btn-blank prepend-left-5"
@click="openTab"
>
{{ dastLink }}
</button>
</template>
</span>
</div>
</div>
</template>
- return unless local_assigns.fetch(:pipeline).expose_security_dashboard?
.js-sast-summary
---
title: Remove security report summary from pipelines view
merge_request: 7844
author:
type: removed
......@@ -102,11 +102,6 @@ msgid_plural "%d unstaged changes"
msgstr[0] ""
msgstr[1] ""
msgid "%d vulnerability"
msgid_plural "%d vulnerabilities"
msgstr[0] ""
msgstr[1] ""
msgid "%s additional commit has been omitted to prevent performance issues."
msgid_plural "%s additional commits have been omitted to prevent performance issues."
msgstr[0] ""
......@@ -9009,27 +9004,18 @@ msgstr ""
msgid "ciReport|Container scanning"
msgstr ""
msgid "ciReport|Container scanning detected"
msgstr ""
msgid "ciReport|Container scanning detects known vulnerabilities in your docker images."
msgstr ""
msgid "ciReport|DAST"
msgstr ""
msgid "ciReport|DAST detected"
msgstr ""
msgid "ciReport|Dependency Scanning detects known vulnerabilities in your source code's dependencies."
msgstr ""
msgid "ciReport|Dependency scanning"
msgstr ""
msgid "ciReport|Dependency scanning detected"
msgstr ""
msgid "ciReport|Description"
msgstr ""
......@@ -9106,9 +9092,6 @@ msgstr ""
msgid "ciReport|SAST"
msgstr ""
msgid "ciReport|SAST detected"
msgstr ""
msgid "ciReport|Security scanning"
msgstr ""
......@@ -9156,9 +9139,6 @@ msgstr[1] ""
msgid "ciReport|View full report"
msgstr ""
msgid "ciReport|no vulnerabilities"
msgstr ""
msgid "ciReport|on pipeline"
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