@unitedstatespowersquadrons/components 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Badges/Suite.tsx +23 -11
- package/Badges/types.ts +27 -2
- package/package.json +1 -1
package/Badges/Suite.tsx
CHANGED
|
@@ -18,6 +18,27 @@ const SuiteBadge = (props: Props) => {
|
|
|
18
18
|
const suiteBadgeColor = () => {
|
|
19
19
|
if (skipCi) return "lightgray";
|
|
20
20
|
|
|
21
|
+
const conclusionColor = () => {
|
|
22
|
+
switch (conclusion) {
|
|
23
|
+
case "success": return "brightgreen";
|
|
24
|
+
|
|
25
|
+
case "failure":
|
|
26
|
+
case "timed_out":
|
|
27
|
+
case "action_required":
|
|
28
|
+
return "red";
|
|
29
|
+
|
|
30
|
+
case "cancelled": return "orange";
|
|
31
|
+
|
|
32
|
+
case "neutral":
|
|
33
|
+
case "skipped":
|
|
34
|
+
case "stale":
|
|
35
|
+
case undefined:
|
|
36
|
+
return "lightgray";
|
|
37
|
+
|
|
38
|
+
default: return conclusion satisfies never;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
21
42
|
switch (status) {
|
|
22
43
|
case "queued":
|
|
23
44
|
case "in_progress":
|
|
@@ -26,18 +47,9 @@ const SuiteBadge = (props: Props) => {
|
|
|
26
47
|
case "pending":
|
|
27
48
|
return "yellow";
|
|
28
49
|
|
|
29
|
-
case "completed":
|
|
30
|
-
switch (conclusion) {
|
|
31
|
-
case "success": return "brightgreen";
|
|
32
|
-
case "failure":
|
|
33
|
-
case "timed_out":
|
|
34
|
-
case "action_required": return "red";
|
|
35
|
-
case "cancelled": return "orange";
|
|
36
|
-
default: return "lightgray";
|
|
37
|
-
}
|
|
50
|
+
case "completed": return conclusionColor();
|
|
38
51
|
|
|
39
|
-
default:
|
|
40
|
-
return "lightgray";
|
|
52
|
+
default: return status satisfies never;
|
|
41
53
|
}
|
|
42
54
|
};
|
|
43
55
|
|
package/Badges/types.ts
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
type CheckStatus =
|
|
2
|
+
| "queued"
|
|
3
|
+
| "in_progress"
|
|
4
|
+
| "requested"
|
|
5
|
+
| "waiting"
|
|
6
|
+
| "pending"
|
|
7
|
+
| "completed";
|
|
8
|
+
|
|
9
|
+
type CheckConclusion =
|
|
10
|
+
| "success"
|
|
11
|
+
| "failure"
|
|
12
|
+
| "neutral"
|
|
13
|
+
| "cancelled"
|
|
14
|
+
| "timed_out"
|
|
15
|
+
| "skipped"
|
|
16
|
+
| "action_required"
|
|
17
|
+
| "stale";
|
|
18
|
+
|
|
1
19
|
export interface CheckSuite {
|
|
2
20
|
headBranch: string;
|
|
3
21
|
headAha?: string;
|
|
4
|
-
status:
|
|
5
|
-
conclusion?:
|
|
22
|
+
status: CheckStatus;
|
|
23
|
+
conclusion?: CheckConclusion;
|
|
6
24
|
updatedAt?: string;
|
|
7
25
|
skipCi: boolean;
|
|
26
|
+
checkRuns?: CheckRun[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CheckRun {
|
|
30
|
+
name: string;
|
|
31
|
+
status: CheckStatus;
|
|
32
|
+
conclusion?: CheckConclusion;
|
|
8
33
|
}
|
|
9
34
|
|
|
10
35
|
export interface ReachableStatus {
|