@@ -5,6 +5,7 @@ import {getJson} from "../../utils/requests";
5
5
import {STATUS_DATA_NEW_URL } from " ../../urls" ;
6
6
import {withLoading } from " ../../utils/loading" ;
7
7
import {formatSecondsAsDuration } from " ../../utils/formatting" ;
8
+ import {useExpandedStore } from " ../../utils/expansion" ;
8
9
import {
9
10
BenchmarkRequest ,
10
11
BenchmarkRequestStatus ,
@@ -97,6 +98,15 @@ function formatStatus(status: BenchmarkRequestStatus): string {
97
98
}
98
99
}
99
100
101
+ function hasErrors(errors : Dict <string >) {
102
+ return Object .keys (errors ).length !== 0 ;
103
+ }
104
+
105
+ function getErrorsLength(errors : Dict <string >) {
106
+ const errorsLen = Object .keys (errors ).length ;
107
+ return ` ${errorsLen } ${errorsLen > 1 ? " s" : " " } ` ;
108
+ }
109
+
100
110
function PullRequestLink({request }: {request: BenchmarkRequest }) {
101
111
if (request .requestType === " Release" ) {
102
112
return " " ;
@@ -108,6 +118,9 @@ function PullRequestLink({request}: {request: BenchmarkRequest}) {
108
118
);
109
119
}
110
120
121
+ const {toggleExpanded : toggleExpandedErrors, isExpanded : hasExpandedErrors} =
122
+ useExpandedStore ();
123
+
111
124
loadStatusData (loading );
112
125
</script >
113
126
@@ -145,10 +158,28 @@ loadStatusData(loading);
145
158
req.status === "Completed" && req.hasPendingJobs ? "*" : ""
146
159
}}
147
160
</td >
148
- <td v-html =" req.createdAt " ></td >
161
+ <td v-html =" req.completedAt " ></td >
149
162
<td v-html =" getDuration(req)" ></td >
150
- <td >
151
- <pre >{{ req.errors }}</pre >
163
+
164
+ <td v-if =" hasErrors(req.errors)" >
165
+ <button @click =" toggleExpandedErrors(req.tag)" >
166
+ {{ hasExpandedErrors(req.tag) ? "Hide" : "Show" }}
167
+ {{ getErrorsLength(req.errors) }}
168
+ </button >
169
+ </td >
170
+ <td v-else ></td >
171
+ </tr >
172
+
173
+ <tr v-if =" hasExpandedErrors(req.tag)" >
174
+ <td colspan =" 7" style =" padding : 10px 0 " >
175
+ <div v-for =" benchmark in Object.entries(req.errors)" >
176
+ <div >
177
+ <details open >
178
+ <summary >{{ benchmark[0] }}</summary >
179
+ <pre class =" error" >{{ benchmark[1] }}</pre >
180
+ </details >
181
+ </div >
182
+ </div >
152
183
</td >
153
184
</tr >
154
185
</template >
0 commit comments