Skip to content

Commit 0141523

Browse files
committed
Fixes graph not rendering when unable to locate an icon
1 parent e63888c commit 0141523

File tree

4 files changed

+28
-11
lines changed

4 files changed

+28
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21891,7 +21891,7 @@
2189121891
"vscode:prepublish": "pnpm run bundle"
2189221892
},
2189321893
"dependencies": {
21894-
"@gitkraken/gitkraken-components": "13.0.0-vnext.2",
21894+
"@gitkraken/gitkraken-components": "13.0.0-vnext.3",
2189521895
"@gitkraken/provider-apis": "0.28.5",
2189621896
"@gitkraken/shared-web-components": "0.1.1-rc.15",
2189721897
"@gk-nzaytsev/fast-string-truncated-width": "1.1.0",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/webviews/apps/plus/graph/graph-wrapper/graph-wrapper.react.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,14 @@ const createIconElements = () => {
124124
'files',
125125
'worktree',
126126
'issue-github',
127+
'issue-githubEnterprise',
127128
'issue-gitlab',
129+
'issue-gitlabSelfHosted',
128130
'issue-jiraCloud',
131+
'issue-jiraServer',
132+
'issue-azureDevops',
133+
'issue-bitbucket',
134+
'undefined-icon',
129135
];
130136

131137
const miniIconList = ['upstream-ahead', 'upstream-behind'];
@@ -148,7 +154,8 @@ const createIconElements = () => {
148154
const iconElementLibrary = createIconElements();
149155

150156
const getIconElementLibrary: GetExternalIcon = (iconKey: string) => {
151-
return iconElementLibrary[iconKey];
157+
const icon = iconKey in iconElementLibrary ? iconKey : 'undefined-icon';
158+
return iconElementLibrary[icon];
152159
};
153160

154161
const getClientPlatform = (): GraphPlatform => {

src/webviews/apps/plus/graph/graph.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,21 +850,24 @@ button:not([disabled]),
850850
}
851851
}
852852

853-
&--issue-github {
853+
&--issue-github,
854+
&--issue-githubEnterprise {
854855
&::before {
855856
font-family: codicon;
856857
@include iconUtils.codicon('issues');
857858
}
858859
}
859860

860-
&--issue-gitlab {
861+
&--issue-gitlab,
862+
&--issue-gitlabSelfHosted {
861863
&::before {
862864
font-family: codicon;
863865
@include iconUtils.codicon('issues');
864866
}
865867
}
866868

867-
&--issue-jiraCloud {
869+
&--issue-jiraCloud,
870+
&--issue-jiraServer {
868871
&::before {
869872
font-family: 'glicons';
870873
@include iconUtils.glicon('provider-jira');
@@ -884,6 +887,13 @@ button:not([disabled]),
884887
@include iconUtils.codicon('issues');
885888
}
886889
}
890+
891+
&--undefined-icon {
892+
&::before {
893+
font-family: codicon;
894+
@include iconUtils.codicon('blank');
895+
}
896+
}
887897
}
888898

889899
// header - move to graph.css.ts

0 commit comments

Comments
 (0)