@@ -100,10 +100,16 @@ class base {
100100 let totalEstimate = 0 ;
101101 let totalSpent = 0 ;
102102 let spent = 0 ;
103+ let spentFree = 0 ;
103104 let users = { } ;
104105 let projects = { } ;
105106 let times = [ ] ;
106107
108+ let spentFreeLabels = this . config . get ( 'freeLabels' ) ;
109+ if ( undefined === spentFreeLabels ) {
110+ spentFreeLabels = [ ] ;
111+ }
112+
107113 [ 'issues' , 'mergeRequests' ] . forEach ( type => {
108114 this . report [ type ] . forEach ( issue => {
109115 issue . times . forEach ( time => {
@@ -114,6 +120,16 @@ class base {
114120 projects [ time . project_namespace ] += time . seconds ;
115121
116122 spent += time . seconds ;
123+ //if(time.parent.labels)
124+ let free = false ;
125+ time . parent . labels . forEach ( label => {
126+ spentFreeLabels . forEach ( freeLabel => {
127+ free |= ( freeLabel == label ) ;
128+ } ) ;
129+ } ) ;
130+ if ( free ) {
131+ spentFree += time . seconds ;
132+ }
117133 times . push ( time ) ;
118134 } ) ;
119135
@@ -141,10 +157,12 @@ class base {
141157 this . stats = {
142158 'total estimate' : this . config . toHumanReadable ( totalEstimate , 'stats' ) ,
143159 'total spent' : this . config . toHumanReadable ( totalSpent , 'stats' ) ,
144- 'spent' : this . config . toHumanReadable ( spent , 'stats' )
160+ 'spent' : this . config . toHumanReadable ( spent , 'stats' ) ,
161+ 'spent free' : this . config . toHumanReadable ( spentFree , 'stats' ) ,
145162 } ;
146163 this . totalEstimate = totalEstimate ;
147164 this . spent = spent ;
165+ this . spentFree = spentFree ;
148166 this . totalSpent = totalSpent ;
149167 }
150168
0 commit comments