Browse Source

feat(related_issues): Create separate sections for each relation type (#70789)

In https://github.com/getsentry/sentry/pull/70504 I added support for
the type parameter which allows getting the data for same-root issues vs
trace-connected issues separately.

This UI change allows each related issues section to fetch and render
the data independently, thus, making the page load faster.

These changes are required to support fetching trace-connected issues
from the Issues Details page without also fetching same-root-connected
data.

---------

Co-authored-by: Scott Cooper <scttcper@gmail.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Armen Zambrano G 10 months ago
parent
commit
4014ab3a51
1 changed files with 5 additions and 5 deletions
  1. 5 5
      static/app/views/issueDetails/groupRelatedIssues/index.tsx

+ 5 - 5
static/app/views/issueDetails/groupRelatedIssues/index.tsx

@@ -79,9 +79,9 @@ function RelatedIssuesSection({
   // project=-1 allows ensuring that the query will show issues from any projects for the org
   // This is important for traces since issues can be for any project in the org
   const baseUrl = `/organizations/${orgSlug}/issues/?project=-1`;
-  let title;
-  let linkToTrace;
-  let openIssuesButton;
+  let title: React.ReactNode = null;
+  let linkToTrace: React.ReactNode = null;
+  let openIssuesButton: React.ReactNode = null;
   if (relationType === 'trace_connected' && traceMeta) {
     title = t('Issues in the same trace');
     linkToTrace = (
@@ -132,8 +132,8 @@ function RelatedIssuesSection({
       ) : issues.length > 0 ? (
         <Fragment>
           <TextButtonWrapper>
-            {linkToTrace ?? null}
-            {openIssuesButton ?? null}
+            {linkToTrace}
+            {openIssuesButton}
           </TextButtonWrapper>
           <GroupList
             orgSlug={orgSlug}