@unitedstatespowersquadrons/components 1.3.7 → 1.3.9-1
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 → Checks/Check.tsx} +12 -13
- package/Badges/Checks/Run.tsx +22 -0
- package/Badges/Checks/Suite.tsx +20 -0
- package/Badges/Checks/index.ts +13 -0
- package/Badges/index.ts +6 -3
- package/Badges/types.ts +3 -2
- package/package.json +1 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { github, shields } from "
|
|
3
|
-
import { badgeify } from "
|
|
4
|
-
import {
|
|
2
|
+
import { github, shields } from "../remotes";
|
|
3
|
+
import { badgeify } from "../helpers";
|
|
4
|
+
import { CheckConclusion, CheckStatus } from "../types";
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
repo?: string | undefined;
|
|
8
|
+
label: string;
|
|
9
|
+
status: CheckStatus;
|
|
10
|
+
conclusion?: CheckConclusion | undefined;
|
|
11
|
+
skipCi?: boolean;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
if (!suite || !suite.status) return null;
|
|
15
|
-
|
|
16
|
-
const { headBranch, conclusion, skipCi, status } = suite;
|
|
14
|
+
const CheckBadge = (props: Props) => {
|
|
15
|
+
const { conclusion, label, repo, skipCi, status } = props;
|
|
17
16
|
|
|
18
17
|
const suiteBadgeColor = () => {
|
|
19
18
|
if (skipCi) return "lightgray";
|
|
@@ -67,11 +66,11 @@ const SuiteBadge = (props: Props) => {
|
|
|
67
66
|
const color = suiteBadgeColor();
|
|
68
67
|
|
|
69
68
|
const img =
|
|
70
|
-
<img src={`${shields}/badge/${badgeify(
|
|
69
|
+
<img src={`${shields}/badge/${badgeify(label)}-${description() || "Unknown"}-${color}?logo=github`} />;
|
|
71
70
|
|
|
72
71
|
if (!repo || conclusion === "success") return img;
|
|
73
72
|
|
|
74
73
|
return <a href={`${github}/${repo}/actions/workflows/main.yml`} rel="noreferrer" target="_blank">{img}</a>;
|
|
75
74
|
};
|
|
76
75
|
|
|
77
|
-
export default
|
|
76
|
+
export default CheckBadge;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Check from "./Check";
|
|
3
|
+
import { CheckRun } from "../types";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
run?: CheckRun;
|
|
7
|
+
repo?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const RunBadge = (props: Props) => {
|
|
11
|
+
const { repo, run } = props;
|
|
12
|
+
|
|
13
|
+
if (!run || !run.status) return null;
|
|
14
|
+
|
|
15
|
+
const { conclusion, name, status } = run;
|
|
16
|
+
|
|
17
|
+
const skipCi = false;
|
|
18
|
+
|
|
19
|
+
return <Check conclusion={conclusion} label={name} repo={repo} skipCi={skipCi} status={status} />;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default RunBadge;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Check from "./Check";
|
|
3
|
+
import { CheckSuite } from "../types";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
suite?: CheckSuite;
|
|
7
|
+
repo?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const SuiteBadge = (props: Props) => {
|
|
11
|
+
const { suite, repo } = props;
|
|
12
|
+
|
|
13
|
+
if (!suite || !suite.status) return null;
|
|
14
|
+
|
|
15
|
+
const { headBranch, conclusion, skipCi, status } = suite;
|
|
16
|
+
|
|
17
|
+
return <Check conclusion={conclusion} label={headBranch} repo={repo} skipCi={skipCi} status={status} />;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default SuiteBadge;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Check from "./Check";
|
|
2
|
+
import Run from "./Run";
|
|
3
|
+
import Suite from "./Suite";
|
|
4
|
+
|
|
5
|
+
export { default as CheckBadge } from "./Check";
|
|
6
|
+
export { default as CheckRunBadge } from "./Run";
|
|
7
|
+
export { default as CheckSuiteBadge } from "./Suite";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
Check,
|
|
11
|
+
Run,
|
|
12
|
+
Suite,
|
|
13
|
+
};
|
package/Badges/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Badge from "./Badge";
|
|
2
2
|
import Branch from "./Branch";
|
|
3
|
+
import Checks, { CheckBadge, CheckRunBadge, CheckSuiteBadge } from "./Checks";
|
|
3
4
|
import Commit from "./Commit";
|
|
4
5
|
import Date, { dateBadgeColor } from "./Date";
|
|
5
6
|
import Dependency from "./Dependency";
|
|
@@ -9,11 +10,11 @@ import Npm from "./Npm";
|
|
|
9
10
|
import PhpLibrary from "./PhpLibrary";
|
|
10
11
|
import Reachable from "./Reachable";
|
|
11
12
|
import Repo from "./Repo";
|
|
12
|
-
import Suite from "./Suite";
|
|
13
13
|
import Tag from "./Tag";
|
|
14
14
|
|
|
15
15
|
export { default as Badge } from "./Badge";
|
|
16
16
|
export { default as BranchBadge } from "./Branch";
|
|
17
|
+
export { default as Checks } from "./Checks";
|
|
17
18
|
export { default as CommitBadge } from "./Commit";
|
|
18
19
|
export { default as DateBadge, dateBadgeColor } from "./Date";
|
|
19
20
|
export { default as DependencyBadge } from "./Dependency";
|
|
@@ -23,7 +24,6 @@ export { default as NpmBadge } from "./Npm";
|
|
|
23
24
|
export { default as PhpLibraryBadge } from "./PhpLibrary";
|
|
24
25
|
export { default as ReachableBadge } from "./Reachable";
|
|
25
26
|
export { default as RepoBadge } from "./Repo";
|
|
26
|
-
export { default as SuiteBadge } from "./Suite";
|
|
27
27
|
export { default as TagBadge } from "./Tag";
|
|
28
28
|
|
|
29
29
|
export type { CheckSuite, ReachableStatus } from "./types";
|
|
@@ -31,6 +31,10 @@ export type { CheckSuite, ReachableStatus } from "./types";
|
|
|
31
31
|
export default {
|
|
32
32
|
Badge,
|
|
33
33
|
Branch,
|
|
34
|
+
CheckBadge,
|
|
35
|
+
CheckRunBadge,
|
|
36
|
+
CheckSuiteBadge,
|
|
37
|
+
Checks,
|
|
34
38
|
Commit,
|
|
35
39
|
Date,
|
|
36
40
|
Dependency,
|
|
@@ -40,7 +44,6 @@ export default {
|
|
|
40
44
|
PhpLibrary,
|
|
41
45
|
Reachable,
|
|
42
46
|
Repo,
|
|
43
|
-
Suite,
|
|
44
47
|
Tag,
|
|
45
48
|
dateBadgeColor,
|
|
46
49
|
};
|
package/Badges/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type CheckStatus =
|
|
1
|
+
export type CheckStatus =
|
|
2
2
|
| "queued"
|
|
3
3
|
| "in_progress"
|
|
4
4
|
| "requested"
|
|
@@ -6,7 +6,7 @@ type CheckStatus =
|
|
|
6
6
|
| "pending"
|
|
7
7
|
| "completed";
|
|
8
8
|
|
|
9
|
-
type CheckConclusion =
|
|
9
|
+
export type CheckConclusion =
|
|
10
10
|
| "success"
|
|
11
11
|
| "failure"
|
|
12
12
|
| "neutral"
|
|
@@ -23,6 +23,7 @@ export interface CheckSuite {
|
|
|
23
23
|
conclusion?: CheckConclusion;
|
|
24
24
|
updatedAt?: string;
|
|
25
25
|
skipCi: boolean;
|
|
26
|
+
checkRuns?: CheckRun[];
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface CheckRun {
|