Skip to content

Commit 44646a9

Browse files
committed
change to return 2 values
1 parent badcf7e commit 44646a9

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

web_src/js/runstatus.js

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,35 @@ import {svg} from './svg.js';
44
function runstatus(status, size = 16, className = '') {
55
switch (status) {
66
case 'success':
7-
return svg('octicon-check-circle-fill', size, className);
7+
return [
8+
svg('octicon-check-circle-fill', size, className),
9+
'green'
10+
];
811
case 'skipped':
9-
return svg('octicon-skip', size, className);
12+
return [
13+
svg('octicon-skip', size, className),
14+
'ui text grey'
15+
];
1016
case 'waiting':
11-
return svg('octicon-clock', size, className);
17+
return [
18+
svg('octicon-clock', size, className),
19+
'ui text yellow'
20+
];
1221
case 'blocked':
13-
return svg('octicon-blocked', size, className);
22+
return [
23+
svg('octicon-blocked', size, className),
24+
'ui text yellow'
25+
];
1426
case 'running':
15-
return svg('octicon-meter', size, className);
27+
return [
28+
svg('octicon-meter', size, className),
29+
'ui text yellow'
30+
];
1631
default:
17-
return svg('octicon-x-circle-fill', size, className);
18-
}
19-
}
20-
21-
function spanclass(status) {
22-
switch (status) {
23-
case 'success':
24-
return 'green';
25-
case 'skipped':
26-
return 'ui text grey';
27-
case 'waiting':
28-
return 'ui text yellow';
29-
case 'blocked':
30-
return 'ui text yellow';
31-
case 'running':
32-
return 'ui text yellow';
33-
default:
34-
return 'red';
32+
return [
33+
svg('octicon-x-circle-fill', size, className),
34+
'red'
35+
];
3536
}
3637
}
3738

@@ -47,10 +48,7 @@ export const RunStatus = {
4748
runstatus() {
4849
return runstatus(this.status, this.size, this.className);
4950
},
50-
spanclass() {
51-
return spanclass(this.status);
52-
}
5351
},
5452

55-
template: `<span v-html="runstatus" :class="spanclass"/>`
53+
template: `<span v-html="runstatus[0]" :class="runstatus[1]"/>`
5654
};

0 commit comments

Comments
 (0)