File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/app/components/usage/actions/charts/chart-line-usage-daily Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 8
8
</ mat-button-toggle-group >
9
9
< mat-button-toggle-group name ="timeType " aria-label ="Toggle Time " [value] ="timeType " (change) ="timeType = $event.value; redrawChart() ">
10
10
< mat-button-toggle value ="total "> Total</ mat-button-toggle >
11
+ < mat-button-toggle value ="run "> Run</ mat-button-toggle >
11
12
< mat-button-toggle value ="daily "> Day</ mat-button-toggle >
12
13
< mat-button-toggle value ="weekly "> Week</ mat-button-toggle >
13
14
< mat-button-toggle value ="monthly "> Month</ mat-button-toggle >
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export class ChartLineUsageDailyComponent implements OnChanges {
51
51
} ;
52
52
updateFromInput : boolean = false ;
53
53
chartType : 'repo' | 'total' | 'sku' | 'user' | 'workflow' = 'sku' ;
54
- timeType : 'total' | 'daily' | 'weekly' | 'monthly' | 'rolling20' | 'rolling7' = 'rolling20' ;
54
+ timeType : 'total' | 'run' | ' daily' | 'weekly' | 'monthly' | 'rolling20' | 'rolling7' = 'rolling20' ;
55
55
rollingDays = 20 ;
56
56
57
57
constructor (
@@ -67,10 +67,12 @@ export class ChartLineUsageDailyComponent implements OnChanges {
67
67
ngOnChanges ( ) {
68
68
this . rollingDays = Number ( this . timeType . split ( 'rolling' ) [ 1 ] ) ;
69
69
const seriesDays = this . data . reduce (
70
- ( acc , line ) => {
70
+ ( acc , line , index ) => {
71
71
let name = 'Total' ;
72
72
let timeKey = 'total' ;
73
- if ( this . timeType === 'daily' ) {
73
+ if ( this . timeType === 'run' ) {
74
+ timeKey = `${ line . actionsWorkflow } ${ line . date } ${ index } ` ;
75
+ } else if ( this . timeType === 'daily' ) {
74
76
timeKey = line . date . toISOString ( ) . split ( 'T' ) [ 0 ] ;
75
77
} else if ( this . timeType === 'weekly' ) {
76
78
timeKey = this . getWeekOfYear ( line . date ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments