diff --git a/app/assets/javascripts/application/bugs_by_severity.coffee b/app/assets/javascripts/application/bugs_by_severity.coffee index 3c0db1906fb40d8ff1ed97bb80e6bf40d2fee3c5..c442dd5640c18dc942bf6884bf35e1490da0d786 100644 --- a/app/assets/javascripts/application/bugs_by_severity.coffee +++ b/app/assets/javascripts/application/bugs_by_severity.coffee @@ -25,6 +25,14 @@ BugsClosedBySeverityPerMonthChart = (element) -> )) @charts.StackedBarChart(element, query.query_string, query.view_string) +BugsAllStatesBySeverityPerMonthChart = (element) -> + query = @queries.ScopedQuery(@queries.AllIssuablesCreatedPerMonthQuery( + @query_strings.Bugs, + @query_strings.Severities, + @query_strings.IssuesScope + )) + @charts.StackedBarChart(element, query.query_string, query.view_string) + $(document).ready () -> if document.getElementById('cumulative-bugs-created-severity-month') CumulativeBugsCreatedBySeverityPerMonthChart(document.getElementById('cumulative-bugs-created-severity-month')) @@ -32,3 +40,5 @@ $(document).ready () -> BugsCreatedBySeverityPerMonthChart(document.getElementById('bugs-created-severity-month')) if document.getElementById('bugs-closed-severity-month') BugsClosedBySeverityPerMonthChart(document.getElementById('bugs-closed-severity-month')) + if document.getElementById('bugs-all-states-severity-month') + BugsAllStatesBySeverityPerMonthChart(document.getElementById('bugs-all-states-severity-month')) diff --git a/app/assets/javascripts/application/queries.coffee b/app/assets/javascripts/application/queries.coffee index b52b4d82000b994be57a5fdf235b35ab5d8cd8bf..51fd5df6061f71098cb74afc913dcf0f01c55c3f 100644 --- a/app/assets/javascripts/application/queries.coffee +++ b/app/assets/javascripts/application/queries.coffee @@ -39,6 +39,21 @@ project_query = (group_path, project_path, view_string, inner_query) -> } } ' + + AllIssuablesCreatedPerMonthQuery: (filter_labels_string, collection_labels_string, issuable_scope) -> + view_string: 'issuables_created_per_month', + query_string: ' + issuables_created_per_month(filter_labels:' + filter_labels_string + ', collection_labels: ' + collection_labels_string + ', issuable_scope: ' + issuable_scope + ') { + labels + datasets { + label + data + borderColor + backgroundColor + } + } + ' + IssuablesCreatedPerMonthQuery: (state_string, filter_labels_string, collection_labels_string, issuable_scope) -> view_string: 'issuables_created_per_month', query_string: ' diff --git a/app/views/shared/_bugs_by_severity.html.haml b/app/views/shared/_bugs_by_severity.html.haml index dc8b21074fe9a7fe67d6ac1b621d1da6a511f5d2..c608c73107af0574f0f6a8d307394946761b1bea 100644 --- a/app/views/shared/_bugs_by_severity.html.haml +++ b/app/views/shared/_bugs_by_severity.html.haml @@ -24,7 +24,7 @@ .card-body %div %div.text-wrap - %p Displays number of open bugs created in a particular month grouped by their severity label + %p Displays number of open bugs created in a particular month grouped by their severity label. (This excludes bugs that have since been closed) .row.row-cards .col-lg-12 .card @@ -36,3 +36,14 @@ %div %div.text-wrap %p Displays number of bugs closed in a particular month grouped by their severity label + .row.row-cards + .col-lg-12 + .card + .card-header + %h3.card-title Bugs by Severity in all States + .card-body + %canvas#bugs-all-states-severity-month + .card-body + %div + %div.text-wrap + %p Displays number of bugs opened in a particular month grouped by their severity label. (This includes bugs that have since been closed)