Skip to content

Commit

Permalink
fix(core): allow grouping by time on cancelled executions (#4896)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Feb 22, 2018
1 parent 211647b commit 6a79063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/scripts/modules/core/src/domain/IExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IExecution extends IOrchestratedItem {
appConfig?: any;
application: string;
buildInfo?: any;
buildTime?: number;
canceledBy?: string;
cancellationReason?: string;
context?: { [key: string]: any };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export class ExecutionFilterService {
}

private groupByTimeBoundary(executions: IExecution[]): {[boundaryName: string]: IExecution[]} {
return groupBy(executions, (execution) => boundaries.find((boundary) => moment(execution.startTime).isAfter(boundary.after())).name);
return groupBy(executions, (execution) =>
boundaries.find((boundary) =>
// executions that were cancelled before ever starting will not have a startTime, just a buildTime
moment(execution.startTime || execution.buildTime).isAfter(boundary.after())).name);
}

@Debounce(25)
Expand Down

0 comments on commit 6a79063

Please sign in to comment.