Skip to content

Commit c164836

Browse files
committed
Add separate step icons
1 parent f2b0087 commit c164836

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

src/treeViews/icons.ts

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,64 @@ export function getIconForWorkflowRun({
2828
case "completed": {
2929
switch (conclusion) {
3030
case "success":
31-
return getAbsoluteIconPath("conclusions/success.svg");
31+
return getAbsoluteIconPath("workflowruns/wr_success.svg");
3232

3333
case "failure":
34-
return getAbsoluteIconPath("conclusions/failure.svg");
34+
return getAbsoluteIconPath("workflowruns/wr_failure.svg");
3535

3636
case "skipped":
37+
return getAbsoluteIconPath("workflowruns/wr_skipped.svg");
38+
3739
case "cancelled":
38-
return getAbsoluteIconPath("conclusions/cancelled.svg");
40+
return getAbsoluteIconPath("workflowruns/wr_cancelled.svg");
3941
}
42+
4043
break;
4144
}
4245

4346
case "queued":
44-
return getAbsoluteIconPath("statuses/queued.svg");
47+
return getAbsoluteIconPath("workflowruns/wr_queued.svg");
4548

4649
case "waiting":
47-
return getAbsoluteIconPath("statuses/waiting.svg");
50+
return getAbsoluteIconPath("workflowruns/wr_waiting.svg");
51+
52+
case "inprogress":
53+
case "in_progress":
54+
return getAbsoluteIconPath("workflowruns/wr_inprogress.svg");
55+
}
56+
57+
return "";
58+
}
59+
60+
export function getIconForWorkflowStep({
61+
status,
62+
conclusion
63+
}: StatusAndConclusion): string | vscode.ThemeIcon | {light: string | vscode.Uri; dark: string | vscode.Uri} {
64+
switch (status) {
65+
case "completed": {
66+
switch (conclusion) {
67+
case "success":
68+
return getAbsoluteIconPath("steps/step_success.svg");
69+
70+
case "failure":
71+
return getAbsoluteIconPath("steps/step_failure.svg");
72+
73+
case "skipped":
74+
return getAbsoluteIconPath("steps/step_skipped.svg");
75+
76+
case "cancelled":
77+
return getAbsoluteIconPath("steps/step_cancelled.svg");
78+
}
79+
80+
break;
81+
}
82+
83+
case "queued":
84+
return getAbsoluteIconPath("statuses/step_queued.svg");
4885

4986
case "inprogress":
5087
case "in_progress":
51-
return new vscode.ThemeIcon("sync~spin");
88+
return getAbsoluteIconPath("steps/step_inprogress.svg");
5289
}
5390

5491
return "";

src/treeViews/workflows/workflowStepNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from "vscode";
22
import {GitHubRepoContext} from "../../git/repository";
33
import {WorkflowStep} from "../../model";
44
import {WorkflowJob} from "../../store/WorkflowJob";
5-
import {getIconForWorkflowRun} from "../icons";
5+
import {getIconForWorkflowStep} from "../icons";
66

77
export class WorkflowStepNode extends vscode.TreeItem {
88
constructor(
@@ -23,6 +23,6 @@ export class WorkflowStepNode extends vscode.TreeItem {
2323
arguments: [this]
2424
};
2525

26-
this.iconPath = getIconForWorkflowRun(this.step);
26+
this.iconPath = getIconForWorkflowStep(this.step);
2727
}
2828
}

0 commit comments

Comments
 (0)