Skip to content

DAST on-demand scans empty tabs

What does this MR do and why?

This implements the 4 primary tabs in the DAST scans index page.

In this iteration, we're only showing the tabs with 0 item counters and empty states for each. In the next iteration, we'll start fetching some actual data for the All tab.

Screenshots or screen recordings

Tab Preview
All Screen_Shot_2021-10-08_at_12.07.26_PM
Running Screen_Shot_2021-10-08_at_12.07.42_PM
Finished Screen_Shot_2021-10-08_at_12.07.52_PM
Scheduled Screen_Shot_2021-10-08_at_12.08.04_PM

How to set up and validate locally

The app currently assumes that there is no pipeline to show and renders an empty state instead of the tabs. To get the tabs to show up, an internal property needs to be changed manually. This will of course not be needed anymore once the app fetches actual data from the API.

  1. Enable the index page.

    Feature.enable(:dast_view_scans)
  2. Force the app to show the tabs instead of the empty state by applying the following patch:

    diff --git a/ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans.vue b/ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans.vue
    index 3dcdbbdae8a..d9a7182e896 100644
    --- a/ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans.vue
    +++ b/ee/app/assets/javascripts/on_demand_scans/components/on_demand_scans.vue
    @@ -34,7 +34,7 @@ export default {
    data() {
    return {
    activeTabIndex: 0,
    -      hasData: false,
    +      hasData: true,
    };
    },
    computed: {

    To apply the patch, copy the whole code block and run pbpaste | git apply in the gitlab/ directory.

  3. Visit the index page at /:namespace/:project/on_demand_scans.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #341359 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports