Skip to content

Commit

Permalink
Add in the start and end cycle year to the title (#4014)
Browse files Browse the repository at this point in the history
Add cycle tange to program overview title
  • Loading branch information
haneslinger committed May 6, 2023
1 parent bf0e4dc commit 82870f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ angular.module('BE.seed.controller.insights_program', [])
// console.log( "DATA: ", $scope.data)
_build_chart();

// build chart name
compliance_metric_cycles = $scope.cycles.filter(c => $scope.compliance_metric.cycles.includes(c.id))
first_cycle = compliance_metric_cycles.reduce((prev, curr) => prev.start < curr.start ? prev : curr);
last_cycle = compliance_metric_cycles.reduce((prev, curr) => prev.end > curr.end ? prev : curr);
cycle_range = first_cycle == last_cycle? first_cycle.name: first_cycle.name + " - " + last_cycle.name;
$scope.chart_name = $scope.compliance_metric.name + ": " + cycle_range;
}).finally(() => {
spinner_utility.hide()
})
Expand Down
2 changes: 1 addition & 1 deletion seed/static/seed/partials/insights_program.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2 style="font-size:18px;"> {$:: 'Program Overview' | translate $}</h2>
</div>
<div class="col-md-10">
<div style="margin-left: 5vw; margin-right: 5vw">
<h3 style="font-size:18px;">{$ compliance_metric.name $}</h3>
<h3 style="font-size:18px;">{$ chart_name $}</h3>
</div>
<div class="graph" style="margin-left: 5vw; margin-right: 5vw">
<canvas id="program-overview-chart"></canvas>
Expand Down

0 comments on commit 82870f6

Please sign in to comment.