@@ -74,47 +74,28 @@ function RelatedIssuesSection({
74
74
// This is important for traces since issues can be for any project in the org
75
75
const baseUrl = `/organizations/${ orgSlug } /issues/?project=-1` ;
76
76
let title : React . ReactNode = null ;
77
- let linkToTrace : React . ReactNode = null ;
77
+ let extraInfo : React . ReactNode = null ;
78
78
let openIssuesButton : React . ReactNode = null ;
79
79
if ( relationType === 'trace_connected' && traceMeta ) {
80
- title = t ( 'Issues in the same trace' ) ;
81
- linkToTrace = (
82
- < small >
83
- { t ( 'These issues were all found within ' ) }
84
- < Link
85
- to = { `/organizations/${ orgSlug } /performance/trace/${ traceMeta . trace_id } /?node=error-${ traceMeta . event_id } ` }
86
- >
87
- { t ( 'this trace' ) }
88
- </ Link >
89
- .
90
- </ small >
91
- ) ;
92
- openIssuesButton = (
93
- < LinkButton
94
- to = { `${ baseUrl } &query=trace:${ traceMeta . trace_id } ` }
95
- size = "xs"
96
- analyticsEventName = "Clicked Open Issues from trace-connected related issues"
97
- analyticsEventKey = "similar_issues.trace_connected_issues_clicked_open_issues"
98
- >
99
- { t ( 'Open in Issues' ) }
100
- </ LinkButton >
101
- ) ;
80
+ ( { title, extraInfo, openIssuesButton} = getTraceConnectedContent (
81
+ traceMeta ,
82
+ baseUrl ,
83
+ orgSlug
84
+ ) ) ;
102
85
} else {
103
- title = t ( 'Issues caused by the same root cause' ) ;
104
- openIssuesButton = (
105
- < LinkButton
106
- to = { `${ baseUrl } &query=issue.id:[${ groupId } ,${ issues } ]` }
107
- size = "xs"
108
- analyticsEventName = "Clicked Open Issues from same-root related issues"
109
- analyticsEventKey = "similar_issues.same_root_cause_clicked_open_issues"
110
- >
111
- { t ( 'Open in Issues' ) }
112
- </ LinkButton >
86
+ title = t ( 'Issues with similar titles' ) ;
87
+ extraInfo = t (
88
+ 'These issues have the same title and may have been caused by the same root cause.'
89
+ ) ;
90
+ openIssuesButton = getLinkButton (
91
+ `${ baseUrl } &query=issue.id:[${ groupId } ,${ issues } ]` ,
92
+ 'Clicked Open Issues from same-root related issues' ,
93
+ 'similar_issues.same_root_cause_clicked_open_issues'
113
94
) ;
114
95
}
115
96
116
97
return (
117
- < HeaderWrapper >
98
+ < Fragment >
118
99
{ isPending ? (
119
100
< LoadingIndicator />
120
101
) : isError ? (
@@ -124,28 +105,67 @@ function RelatedIssuesSection({
124
105
/>
125
106
) : issues . length > 0 ? (
126
107
< Fragment >
127
- < Title > { title } </ Title >
128
- < TextButtonWrapper >
129
- { linkToTrace }
130
- { openIssuesButton }
131
- </ TextButtonWrapper >
108
+ < HeaderWrapper >
109
+ < Title > { title } </ Title >
110
+ < TextButtonWrapper >
111
+ < span > { extraInfo } </ span >
112
+ { openIssuesButton }
113
+ </ TextButtonWrapper >
114
+ </ HeaderWrapper >
132
115
< GroupList
133
116
orgSlug = { orgSlug }
134
117
queryParams = { { query : query } }
135
118
source = "similar-issues-tab"
136
119
canSelectGroups = { false }
137
120
withChart = { false }
121
+ withColumns = { [ 'event' ] }
138
122
/>
139
123
</ Fragment >
140
124
) : null }
141
- </ HeaderWrapper >
125
+ </ Fragment >
142
126
) ;
143
127
}
144
128
129
+ const getTraceConnectedContent = (
130
+ traceMeta : RelatedIssuesResponse [ 'meta' ] ,
131
+ baseUrl : string ,
132
+ orgSlug : string
133
+ ) => {
134
+ const title = t ( 'Issues in the same trace' ) ;
135
+ const url = `/organizations/${ orgSlug } /performance/trace/${ traceMeta . trace_id } /?node=error-${ traceMeta . event_id } ` ;
136
+ const extraInfo = (
137
+ < small >
138
+ { t ( 'These issues were all found within' ) }
139
+ < Link to = { url } > { t ( 'this trace' ) } </ Link > .
140
+ </ small >
141
+ ) ;
142
+ const openIssuesButton = getLinkButton (
143
+ `${ baseUrl } &query=trace:${ traceMeta . trace_id } ` ,
144
+ 'Clicked Open Issues from trace-connected related issues' ,
145
+ 'similar_issues.trace_connected_issues_clicked_open_issues'
146
+ ) ;
147
+
148
+ return { title, extraInfo, openIssuesButton} ;
149
+ } ;
150
+
151
+ const getLinkButton = ( to : string , eventName : string , eventKey : string ) => {
152
+ return (
153
+ < LinkButton
154
+ to = { to }
155
+ size = "xs"
156
+ analyticsEventName = { eventName }
157
+ analyticsEventKey = { eventKey }
158
+ >
159
+ { t ( 'Open in Issues' ) }
160
+ </ LinkButton >
161
+ ) ;
162
+ } ;
163
+
145
164
// Export the component without feature flag controls
146
165
export { GroupRelatedIssues } ;
147
166
148
167
const Title = styled ( 'h4' ) `
168
+ font-size: ${ p => p . theme . fontSizeLarge } ;
149
169
margin-bottom: ${ space ( 0.75 ) } ;
150
170
` ;
151
171
@@ -158,7 +178,9 @@ const HeaderWrapper = styled('div')`
158
178
` ;
159
179
160
180
const TextButtonWrapper = styled ( 'div' ) `
181
+ align-items: center;
161
182
display: flex;
162
183
justify-content: space-between;
163
184
margin-bottom: ${ space ( 1 ) } ;
185
+ width: 100%;
164
186
` ;
0 commit comments