Browse Source

Revert "fix(issue-views): Load in default view by default if issue views enabled) (#78278)"

This reverts commit ed34944753e4dca98948eeaedd7486a7b6390637.

Co-authored-by: MichaelSun48 <55160142+MichaelSun48@users.noreply.github.com>
getsentry-bot 5 months ago
parent
commit
f2034a88f8
2 changed files with 7 additions and 19 deletions
  1. 3 18
      static/app/utils/withSavedSearches.tsx
  2. 4 1
      static/app/views/issueList/overview.tsx

+ 3 - 18
static/app/utils/withSavedSearches.tsx

@@ -2,7 +2,6 @@ import type {SavedSearch} from 'sentry/types/group';
 import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
 import useOrganization from 'sentry/utils/useOrganization';
 import {useParams} from 'sentry/utils/useParams';
-import {useFetchGroupSearchViews} from 'sentry/views/issueList/queries/useFetchGroupSearchViews';
 import {useFetchSavedSearchesForOrg} from 'sentry/views/issueList/queries/useFetchSavedSearchesForOrg';
 import {useSelectedSavedSearch} from 'sentry/views/issueList/utils/useSelectedSavedSearch';
 
@@ -16,9 +15,6 @@ type InjectedSavedSearchesProps = {
 /**
  * HOC to provide saved search data to class components.
  * When possible, use the hooks directly instead.
- *
- * Note: this HOC will be completely removed when issue views is GA'd, but until then
- * we have to augment it to support both saved searches and issue views.
  */
 function withSavedSearches<P extends InjectedSavedSearchesProps>(
   WrappedComponent: React.ComponentType<P>
@@ -33,12 +29,6 @@ function withSavedSearches<P extends InjectedSavedSearchesProps>(
       },
       {enabled: !organization.features.includes('issue-stream-custom-views')}
     );
-    const {data: groupSearchViews, isPending: areViewsPending} = useFetchGroupSearchViews(
-      {
-        orgSlug: organization.slug,
-      },
-      {enabled: organization.features.includes('issue-stream-custom-views')}
-    );
 
     const params = useParams();
     const selectedSavedSearch = useSelectedSavedSearch();
@@ -48,15 +38,10 @@ function withSavedSearches<P extends InjectedSavedSearchesProps>(
         {...(props as P)}
         savedSearches={props.savedSearches ?? savedSearches}
         savedSearchLoading={
-          organization.features.includes('issue-stream-custom-views')
-            ? areViewsPending
-            : props.savedSearchLoading ?? isPending
-        }
-        savedSearch={
-          organization.features.includes('issue-stream-custom-views') && groupSearchViews
-            ? groupSearchViews[0]
-            : props.savedSearch ?? selectedSavedSearch
+          !organization.features.includes('issue-stream-custom-views') &&
+          (props.savedSearchLoading ?? isPending)
         }
+        savedSearch={props.savedSearch ?? selectedSavedSearch}
         selectedSearchId={params.searchId ?? null}
       />
     );

+ 4 - 1
static/app/views/issueList/overview.tsx

@@ -317,7 +317,10 @@ class IssueListOverview extends Component<Props, State> {
     savedSearch,
     location,
   }: Pick<Props, 'savedSearch' | 'location'>): string {
-    if (savedSearch) {
+    if (
+      !this.props.organization.features.includes('issue-stream-custom-views') &&
+      savedSearch
+    ) {
       return savedSearch.query;
     }