Skip to content

Commit

Permalink
Use feature flag to gate rendering of new component
Browse files Browse the repository at this point in the history
  • Loading branch information
malwilley committed Jan 2, 2025
1 parent 34f14ad commit d518e0b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions static/app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {ModuleName} from 'sentry/views/insights/types';
import {GroupEventDetailsLoading} from 'sentry/views/issueDetails/groupEventDetails/groupEventDetailsLoading';
import {Tab, TabPaths} from 'sentry/views/issueDetails/types';
import IssueListContainer from 'sentry/views/issueList';
import IssueListOverview from 'sentry/views/issueList/overviewFc';
import {OverviewWrapper} from 'sentry/views/issueList/overviewWrapper';
import OrganizationContainer from 'sentry/views/organizationContainer';
import OrganizationLayout from 'sentry/views/organizationLayout';
import OrganizationRoot from 'sentry/views/organizationRoot';
Expand Down Expand Up @@ -1898,8 +1898,8 @@ function buildRoutes() {

const issueListRoutes = (
<Route path="/issues" component={errorHandler(IssueListContainer)} withOrgPath>
<IndexRoute component={errorHandler(IssueListOverview)} />
<Route path="searches/:searchId/" component={errorHandler(IssueListOverview)} />
<IndexRoute component={errorHandler(OverviewWrapper)} />
<Route path="searches/:searchId/" component={errorHandler(OverviewWrapper)} />
</Route>
);

Expand Down
18 changes: 18 additions & 0 deletions static/app/views/issueList/overviewWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
import useOrganization from 'sentry/utils/useOrganization';
import IssueListOverview from 'sentry/views/issueList/overview';
import IssueListOverviewFc from 'sentry/views/issueList/overviewFc';

type OverviewWrapperProps = RouteComponentProps<{}, {searchId?: string}>;

// This is a temporary wrapper to allow us to migrate to the refactored issue stream component.
// Remove once feature flag is retired.
export function OverviewWrapper(props: OverviewWrapperProps) {
const organization = useOrganization();

if (organization.features.includes('issue-stream-functional-refactor')) {
return <IssueListOverviewFc {...props} />;
}

return <IssueListOverview {...props} />;
}

0 comments on commit d518e0b

Please sign in to comment.