Skip to content

Commit d706541

Browse files
authored
Merge branch 'main' into AXON-804-onboarding-experiment-clean-up
2 parents 325a3aa + 6b81896 commit d706541

File tree

4 files changed

+109
-78
lines changed

4 files changed

+109
-78
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
---
44

5+
## What's new in 3.8.9
6+
7+
### Features
8+
9+
### Bug Fixes
10+
11+
- Fixed a bug where Jira site icon is broken in create Jira issue page
12+
513
## What's new in 3.8.8
614

715
### Features

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,9 +1366,9 @@
13661366
"@atlaskit/toggle": "^14.2.0",
13671367
"@atlaskit/tooltip": "^19.2.0",
13681368
"@atlaskit/width-detector": "^4.4.0",
1369-
"@atlassianlabs/guipi-core-components": "^0.1.2",
1370-
"@atlassianlabs/guipi-core-controller": "^0.1.2",
1371-
"@atlassianlabs/guipi-jira-components": "^0.1.2",
1369+
"@atlassianlabs/guipi-core-components": "^1.0.2",
1370+
"@atlassianlabs/guipi-core-controller": "^1.0.2",
1371+
"@atlassianlabs/guipi-jira-components": "^1.0.2",
13721372
"@atlassianlabs/jira-metaui-client": "^1.3.0",
13731373
"@atlassianlabs/jira-metaui-transformer": "^1.3.0",
13741374
"@atlassianlabs/jira-pi-client": "^1.3.0",

src/webviews/components/issue/create-issue-screen/CreateIssuePage.tsx

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,62 @@ const emptyState: ViewState = {
4444
formKey: v4(),
4545
};
4646

47-
const IconOption = (props: any) => (
48-
<components.Option {...props}>
49-
<div ref={props.innerRef} {...props.innerProps} style={{ display: 'flex', alignItems: 'center' }}>
50-
<img src={props.data.avatarUrl} width="24" height="24" alt={props.data.name || 'Avatar'} />
51-
<span style={{ marginLeft: '10px' }}>{props.data.name}</span>
52-
</div>
53-
</components.Option>
54-
);
55-
56-
const IconValue = (props: any) => (
57-
<components.SingleValue {...props}>
58-
<div style={{ display: 'flex', alignItems: 'center' }}>
59-
<img src={props.data.avatarUrl} width="16" height="16" alt={props.data.name || 'Avatar'} />
60-
<span style={{ marginLeft: '10px' }}>{props.data.name}</span>
61-
</div>
62-
</components.SingleValue>
63-
);
47+
const getFaviconUrl = (siteData: any): string | null => {
48+
if (siteData?.baseLinkUrl) {
49+
return `${siteData.baseLinkUrl}/favicon.ico`;
50+
} else if (siteData?.host) {
51+
return `https://${siteData.host}/favicon.ico`;
52+
}
53+
return null;
54+
};
55+
56+
const IconOption = (props: any) => {
57+
const fallbackImg = 'images/jira-icon.svg';
58+
const avatarUrl = getFaviconUrl(props.data) || fallbackImg;
59+
60+
return (
61+
<components.Option {...props}>
62+
<div ref={props.innerRef} {...props.innerProps} style={{ display: 'flex', alignItems: 'center' }}>
63+
<img
64+
src={avatarUrl}
65+
width="24"
66+
height="24"
67+
alt={props.data?.name || 'Avatar'}
68+
onError={(e) => {
69+
if (e.currentTarget.src !== fallbackImg) {
70+
e.currentTarget.src = fallbackImg;
71+
}
72+
}}
73+
/>
74+
<span style={{ marginLeft: '10px' }}>{props.data?.name}</span>
75+
</div>
76+
</components.Option>
77+
);
78+
};
79+
80+
const IconValue = (props: any) => {
81+
const fallbackImg = 'images/jira-icon.svg';
82+
const avatarUrl = getFaviconUrl(props.data) || fallbackImg;
83+
84+
return (
85+
<components.SingleValue {...props}>
86+
<div style={{ display: 'flex', alignItems: 'center' }}>
87+
<img
88+
src={avatarUrl}
89+
width="16"
90+
height="16"
91+
alt={props.data?.name || 'Avatar'}
92+
onError={(e) => {
93+
if (e.currentTarget.src !== fallbackImg) {
94+
e.currentTarget.src = fallbackImg;
95+
}
96+
}}
97+
/>
98+
<span style={{ marginLeft: '10px' }}>{props.data?.name}</span>
99+
</div>
100+
</components.SingleValue>
101+
);
102+
};
64103

65104
export default class CreateIssuePage extends AbstractIssueEditorPage<Emit, Accept, {}, ViewState> {
66105
private advancedFields: FieldUI[] = [];

0 commit comments

Comments
 (0)