Commit 8f4f2ff0 authored by Savas Vedova's avatar Savas Vedova

Apply code review suggestions

parent 373b481c
......@@ -61,9 +61,7 @@ export default {
id: finding.uuid,
})),
result({ data }) {
if (data.project) {
this.pageInfo = preparePageInfo(data.project.pipeline.securityReportFindings?.pageInfo);
}
this.pageInfo = preparePageInfo(data.project?.pipeline?.securityReportFindings?.pageInfo);
},
error() {
this.errorLoadingFindings = true;
......
......@@ -116,6 +116,11 @@ export default {
},
fields() {
const baseFields = [
{
key: 'checkbox',
class: 'checkbox',
skip: !this.shouldShowSelection,
},
{
key: 'detected',
label: s__('Vulnerability|Detected'),
......@@ -161,13 +166,6 @@ export default {
},
].filter((f) => !f.skip);
if (this.shouldShowSelection) {
baseFields.unshift({
key: 'checkbox',
class: 'checkbox',
});
}
// Apply gl-bg-white! to every header.
baseFields.forEach((field) => {
field.thClass = [field.thClass, 'gl-bg-white!']; // eslint-disable-line no-param-reassign
......
......@@ -16,7 +16,7 @@ import DashboardNotConfiguredInstance from './empty_states/instance_dashboard_no
import DashboardNotConfiguredProject from './empty_states/reports_not_configured.vue';
import GroupVulnerabilities from './first_class_group_security_dashboard_vulnerabilities.vue';
import InstanceVulnerabilities from './first_class_instance_security_dashboard_vulnerabilities.vue';
import PipelineVulnerabilities from './pipeline_findings.vue';
import PipelineFindings from './pipeline_findings.vue';
import ProjectPipelineStatus from './project_pipeline_status.vue';
import ProjectVulnerabilities from './project_vulnerabilities.vue';
import SurveyRequestBanner from './survey_request_banner.vue';
......@@ -29,7 +29,7 @@ export default {
GroupVulnerabilities,
InstanceVulnerabilities,
ProjectVulnerabilities,
PipelineVulnerabilities,
PipelineFindings,
Filters,
CsvExportButton,
SurveyRequestBanner,
......@@ -163,7 +163,7 @@ export default {
<group-vulnerabilities v-if="isGroup" :filters="filters" />
<instance-vulnerabilities v-else-if="isInstance" :filters="filters" />
<project-vulnerabilities v-else-if="isProject" :filters="filters" />
<pipeline-vulnerabilities v-else-if="isPipeline" :filters="filters" />
<pipeline-findings v-else-if="isPipeline" :filters="filters" />
</security-dashboard-layout>
</template>
</div>
......
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