Skip to content

Commit 0041a02

Browse files
Added method placeholders in method comparison
1 parent 8a04a10 commit 0041a02

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

report-ng/app/src/components/history/run-comparison/method-table.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
></a>
6767
<a if.bind="!methodHistory.methodRunId && !methodHistory.methodHistoryAvailable"
6868
innerhtml.bind="methodHistory.methodIdentifier"></a>
69+
<div if.bind="!methodHistory.currentStatus">(${methodHistory.methodIdentifier})</div>
6970
<div
7071
if.bind="methodHistory.changedFailureAspect && methodHistory.pastStatus === methodHistory.currentStatus"
7172
class="st1"

report-ng/app/src/components/history/run-comparison/method-table.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {bindable} from "aurelia-templating";
2424
import {bindingMode} from "aurelia-binding";
2525
import "./method-table.scss";
2626
import {IComparableMethod} from "./run-comparison";
27+
import {ClassName, ClassNameValueConverter} from "../../../value-converters/class-name-value-converter";
2728

2829
@autoinject()
2930
export class MethodTable {
@@ -37,4 +38,18 @@ export class MethodTable {
3738

3839
constructor() {
3940
}
41+
42+
methodsChanged() {
43+
if (this.methods) {
44+
let converter = new ClassNameValueConverter();
45+
this.methods = this.methods.sort((a, b) => {
46+
const aClass = converter.toView(a.classIdentifier, ClassName.simpleName);
47+
const bClass = converter.toView(b.classIdentifier, ClassName.simpleName);
48+
if (aClass < bClass) return -1;
49+
if (aClass > bClass) return 1;
50+
return 0;
51+
});
52+
}
53+
54+
}
4055
}

report-ng/app/src/components/history/run-comparison/run-comparison.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export interface IComparableMethod {
3636
methodHistoryAvailable: boolean
3737
}
3838

39+
interface IRunToCompare {
40+
historyIndex: number,
41+
startTime: number
42+
}
43+
44+
3945
@autoinject()
4046
export class RunComparison extends AbstractViewModel {
4147
private _historyStatistics: HistoryStatistics;
@@ -147,7 +153,3 @@ export class RunComparison extends AbstractViewModel {
147153
}
148154
}
149155

150-
interface IRunToCompare {
151-
historyIndex: number,
152-
startTime: number
153-
}

report-ng/app/src/value-converters/class-name-value-converter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ export class ClassNameValueConverter {
2828
switch (mode) {
2929
case ClassName.package:
3030
if (value.lastIndexOf('.') > 0) {
31-
return value.substr(0, value.lastIndexOf('.'));
31+
return value.substring(0, value.lastIndexOf('.'));
3232
} else {
3333
return '';
3434
}
3535
case ClassName.simpleName:
3636
if (value.lastIndexOf('.') > 0) {
37-
return value.substr(value.lastIndexOf('.') + 1);
37+
return value.substring(value.lastIndexOf('.') + 1);
3838
}
3939
case ClassName.full:
4040
return value;

0 commit comments

Comments
 (0)