Commit 127aa6fa authored by Filipa Lacerda's avatar Filipa Lacerda

Improve CSS scroll and DRY the show all button

parent a53a95fa
...@@ -34,16 +34,21 @@ export default { ...@@ -34,16 +34,21 @@ export default {
required: false, required: false,
default: () => [], default: () => [],
}, },
isFullReportVisible: {
type: Boolean,
required: false,
default: false,
},
type: { type: {
type: String, type: String,
required: true, required: true,
}, },
}, },
data() {
return {
isFullReportVisible: false,
};
},
methods: {
openFullReport() {
this.isFullReportVisible = true;
},
},
}; };
</script> </script>
<template> <template>
...@@ -81,5 +86,14 @@ export default { ...@@ -81,5 +86,14 @@ export default {
status="success" status="success"
:issues="resolvedIssues" :issues="resolvedIssues"
/> />
<button
v-if="allIssues.length && !isFullReportVisible"
type="button"
class="btn-link btn-blank prepend-left-10 js-expand-full-list break-link"
@click="openFullReport"
>
{{ s__("ciReport|Show complete code vulnerabilities report") }}
</button>
</div> </div>
</template> </template>
...@@ -78,7 +78,6 @@ export default { ...@@ -78,7 +78,6 @@ export default {
return { return {
collapseText: __('Expand'), collapseText: __('Expand'),
isCollapsed: true, isCollapsed: true,
isFullReportVisible: false,
}; };
}, },
...@@ -125,9 +124,6 @@ export default { ...@@ -125,9 +124,6 @@ export default {
const text = this.isCollapsed ? __('Expand') : __('Collapse'); const text = this.isCollapsed ? __('Expand') : __('Collapse');
this.collapseText = text; this.collapseText = text;
}, },
openFullReport() {
this.isFullReportVisible = true;
},
}, },
}; };
</script> </script>
...@@ -182,17 +178,7 @@ export default { ...@@ -182,17 +178,7 @@ export default {
:resolved-issues="resolvedIssues" :resolved-issues="resolvedIssues"
:all-issues="allIssues" :all-issues="allIssues"
:type="type" :type="type"
:is-full-report-visible="isFullReportVisible"
/> />
<button
v-if="allIssues.length && !isFullReportVisible"
type="button"
class="btn-link btn-blank prepend-left-10 js-expand-full-list break-link"
@click="openFullReport"
>
{{ s__("ciReport|Show complete code vulnerabilities report") }}
</button>
</slot> </slot>
</div> </div>
</section> </section>
......
...@@ -207,17 +207,7 @@ ...@@ -207,17 +207,7 @@
:resolved-issues="sast.resolvedIssues" :resolved-issues="sast.resolvedIssues"
:all-issues="sast.allIssues" :all-issues="sast.allIssues"
:type="$options.sast" :type="$options.sast"
:is-full-report-visible="isSastFullReportVisible"
/> />
<button
v-if="sast.allIssues.length && !isSastFullReportVisible"
type="button"
class="btn-link btn-blank prepend-left-10 js-expand-full-list-sast break-link"
@click="openSASTFullReport"
>
{{ s__("ciReport|Show complete code vulnerabilities report") }}
</button>
</template> </template>
<template v-if="dependencyScanningHeadPath"> <template v-if="dependencyScanningHeadPath">
...@@ -236,17 +226,7 @@ ...@@ -236,17 +226,7 @@
:resolved-issues="dependencyScanning.resolvedIssues" :resolved-issues="dependencyScanning.resolvedIssues"
:all-issues="dependencyScanning.allIssues" :all-issues="dependencyScanning.allIssues"
:type="$options.sast" :type="$options.sast"
:is-full-report-visible="isDependencyScanningFullReportVisible"
/> />
<button
v-if="dependencyScanning.allIssues.length && !isDependencyScanningFullReportVisible"
type="button"
class="btn-link btn-blank prepend-left-10 js-expand-full-list-dss break-link"
@click="openDependencyScanningFullReport"
>
{{ s__("ciReport|Show complete code vulnerabilities report") }}
</button>
</template> </template>
<template v-if="sastContainerHeadPath"> <template v-if="sastContainerHeadPath">
......
.split-report-section { .split-report-section {
border-bottom: 1px solid $gray-darker; border-bottom: 1px solid $gray-darker;
.report-block-list { .report-block-container {
max-height: 500px; max-height: 500px;
overflow: auto; overflow: auto;
} }
......
...@@ -213,8 +213,8 @@ describe('Grouped security reports app', () => { ...@@ -213,8 +213,8 @@ describe('Grouped security reports app', () => {
it('render show all issues button for sast', done => { it('render show all issues button for sast', done => {
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('.js-expand-full-list-sast')).not.toBeNull(); expect(vm.$el.querySelector('js-sast-issue-list .js-expand-full-list')).not.toBeNull();
vm.$el.querySelector('.js-expand-full-list-sast').click(); vm.$el.querySelector('.js-sast-issue-list .js-expand-full-list').click();
vm vm
.$nextTick() .$nextTick()
...@@ -230,8 +230,8 @@ describe('Grouped security reports app', () => { ...@@ -230,8 +230,8 @@ describe('Grouped security reports app', () => {
it('render show all issues button for dependency scanning', done => { it('render show all issues button for dependency scanning', done => {
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('.js-expand-full-list-dss')).not.toBeNull(); expect(vm.$el.querySelector('js-dss-issue-list .js-expand-full-list')).not.toBeNull();
vm.$el.querySelector('.js-expand-full-list-dss').click(); vm.$el.querySelector('js-dss-issue-list .js-expand-full-list').click();
vm vm
.$nextTick() .$nextTick()
......
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