Skip to content

Commit 1615a20

Browse files
michellewzhangandrewshie-sentry
authored andcommitted
ref(flags): reorganize flag files into folders (#90782)
the feature flag files were getting a bit unwieldy. organizes the feature flag related files into more manageable folders new organization is screenshotted below: ## issue details section/"view all flags" drawer: <img width="223" alt="SCR-20250501-mker" src="https://github.com/user-attachments/assets/00f09b3a-3789-45f8-a039-168ea92589ce" /> ### file renames - `eventFeatureFlagList` was renamed to `eventFeatureFlagSection` for clarity - `featureFlagDrawer` was renamed to `eventFeatureFlagDrawer` for clarity about which drawer it's referring to ## distribution drawer files: <img width="276" alt="SCR-20250501-mlkq" src="https://github.com/user-attachments/assets/4443137d-d8fd-470a-baf5-ceb1d7e302ac" />
1 parent 4e4b061 commit 1615a20

25 files changed

+43
-43
lines changed

static/app/components/events/featureFlags/featureFlagInlineCTA.spec.tsx renamed to static/app/components/events/featureFlags/cta/featureFlagInlineCTA.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
22

3-
import FeatureFlagInlineCTA from 'sentry/components/events/featureFlags/featureFlagInlineCTA';
3+
import FeatureFlagInlineCTA from 'sentry/components/events/featureFlags/cta/featureFlagInlineCTA';
44

55
describe('featureFlagInlineCTA', () => {
66
beforeEach(() => {

static/app/components/events/featureFlags/featureFlagInlineCTA.tsx renamed to static/app/components/events/featureFlags/cta/featureFlagInlineCTA.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {Button, LinkButton} from 'sentry/components/core/button';
99
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
1010
import {DropdownMenu} from 'sentry/components/dropdownMenu';
1111
import FeatureFlagSettingsButton from 'sentry/components/events/featureFlags/featureFlagSettingsButton';
12-
import {useFeatureFlagOnboarding} from 'sentry/components/events/featureFlags/useFeatureFlagOnboarding';
12+
import {useFeatureFlagOnboarding} from 'sentry/components/events/featureFlags/onboarding/useFeatureFlagOnboarding';
1313
import {IconClose, IconMegaphone} from 'sentry/icons';
1414
import {t} from 'sentry/locale';
1515
import {space} from 'sentry/styles/space';

static/app/components/events/featureFlags/featureFlagDrawer.spec.tsx renamed to static/app/components/events/featureFlags/eventFeatureFlagDrawer.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {TagsFixture} from 'sentry-fixture/tags';
22

33
import {render, screen, userEvent, within} from 'sentry-test/reactTestingLibrary';
44

5-
import {EventFeatureFlagList} from 'sentry/components/events/featureFlags/eventFeatureFlagList';
5+
import {EventFeatureFlagSection} from 'sentry/components/events/featureFlags/eventFeatureFlagSection';
66
import {
77
MOCK_DATA_SECTION_PROPS,
88
MOCK_DATA_SECTION_PROPS_ONE_EXTRA_FLAG,
@@ -24,7 +24,7 @@ async function renderFlagDrawer() {
2424
bottom: 0,
2525
toJSON: jest.fn(),
2626
}));
27-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS_ONE_EXTRA_FLAG} />);
27+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS_ONE_EXTRA_FLAG} />);
2828
await userEvent.click(screen.getByRole('button', {name: 'View 1 More Flag'}));
2929
return screen.getByRole('complementary', {name: 'Feature flags drawer'});
3030
}

static/app/components/events/featureFlags/featureFlagDrawer.tsx renamed to static/app/components/events/featureFlags/eventFeatureFlagDrawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ interface FlagDrawerProps {
4949
focusControl?: FlagControlOptions;
5050
}
5151

52-
export function FeatureFlagDrawer({
52+
export function EventFeatureFlagDrawer({
5353
group,
5454
event,
5555
project,

static/app/components/events/featureFlags/eventFeatureFlagList.spec.tsx renamed to static/app/components/events/featureFlags/eventFeatureFlagSection.spec.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
waitForDrawerToHide,
1010
} from 'sentry-test/reactTestingLibrary';
1111

12-
import {EventFeatureFlagList} from 'sentry/components/events/featureFlags/eventFeatureFlagList';
12+
import {EventFeatureFlagSection} from 'sentry/components/events/featureFlags/eventFeatureFlagSection';
1313
import {
1414
EMPTY_STATE_SECTION_PROPS,
1515
MOCK_DATA_SECTION_PROPS,
@@ -58,7 +58,7 @@ describe('EventFeatureFlagList', function () {
5858
});
5959
});
6060
it('renders a list of feature flags with a button to view more flags', async function () {
61-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS_ONE_EXTRA_FLAG} />);
61+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS_ONE_EXTRA_FLAG} />);
6262

6363
for (const {flag, result} of MOCK_FLAGS) {
6464
if (result) {
@@ -79,7 +79,7 @@ describe('EventFeatureFlagList', function () {
7979
});
8080

8181
it('toggles the drawer when `view n flags` is clicked', async function () {
82-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS_MANY_FLAGS} />);
82+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS_MANY_FLAGS} />);
8383
const viewAllButton = screen.getByRole('button', {name: 'View 3 More Flags'});
8484
await userEvent.click(viewAllButton);
8585
const drawer = screen.getByRole('complementary', {name: 'Feature flags drawer'});
@@ -90,7 +90,7 @@ describe('EventFeatureFlagList', function () {
9090
});
9191

9292
it('opens the drawer and focuses search when the search button is pressed', async function () {
93-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS} />);
93+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS} />);
9494

9595
const control = screen.getByRole('button', {name: 'Open Feature Flag Search'});
9696
expect(control).toBeInTheDocument();
@@ -106,7 +106,7 @@ describe('EventFeatureFlagList', function () {
106106
});
107107

108108
it('renders a sort dropdown with Evaluation Order as the default', async function () {
109-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS} />);
109+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS} />);
110110

111111
const control = screen.getByRole('button', {name: 'Sort Flags'});
112112
expect(control).toBeInTheDocument();
@@ -116,7 +116,7 @@ describe('EventFeatureFlagList', function () {
116116
});
117117

118118
it('renders a sort dropdown which affects the granular sort dropdown', async function () {
119-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS} />);
119+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS} />);
120120

121121
const control = screen.getByRole('button', {name: 'Sort Flags'});
122122
expect(control).toBeInTheDocument();
@@ -133,7 +133,7 @@ describe('EventFeatureFlagList', function () {
133133
});
134134

135135
it('renders a sort dropdown which hides the invalid options', async function () {
136-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS} />);
136+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS} />);
137137

138138
const control = screen.getByRole('button', {name: 'Sort Flags'});
139139
expect(control).toBeInTheDocument();
@@ -156,7 +156,7 @@ describe('EventFeatureFlagList', function () {
156156
});
157157

158158
it('allows sort dropdown to affect displayed flags', async function () {
159-
render(<EventFeatureFlagList {...MOCK_DATA_SECTION_PROPS} />);
159+
render(<EventFeatureFlagSection {...MOCK_DATA_SECTION_PROPS} />);
160160

161161
const [webVitalsFlag, enableReplay] = MOCK_FLAGS.filter(f => f.result === true);
162162

@@ -206,7 +206,7 @@ describe('EventFeatureFlagList', function () {
206206
});
207207

208208
it('renders empty state if project has flags', function () {
209-
render(<EventFeatureFlagList {...EMPTY_STATE_SECTION_PROPS} />);
209+
render(<EventFeatureFlagSection {...EMPTY_STATE_SECTION_PROPS} />);
210210

211211
const control = screen.queryByRole('button', {name: 'Sort Flags'});
212212
expect(control).not.toBeInTheDocument();
@@ -223,7 +223,7 @@ describe('EventFeatureFlagList', function () {
223223
it('renders cta if event.contexts.flags is not set and should show cta', async function () {
224224
const org = OrganizationFixture({features: ['feature-flag-cta']});
225225

226-
render(<EventFeatureFlagList {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, {
226+
render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, {
227227
organization: org,
228228
});
229229

@@ -244,7 +244,7 @@ describe('EventFeatureFlagList', function () {
244244
const org = OrganizationFixture({features: ['feature-flag-cta']});
245245

246246
render(
247-
<EventFeatureFlagList {...NO_FLAG_CONTEXT_WITH_FLAGS_SECTION_PROPS_NO_CTA} />,
247+
<EventFeatureFlagSection {...NO_FLAG_CONTEXT_WITH_FLAGS_SECTION_PROPS_NO_CTA} />,
248248
{
249249
organization: org,
250250
}
@@ -265,7 +265,7 @@ describe('EventFeatureFlagList', function () {
265265
it('renders nothing if event.contexts.flags is not set and should not show cta - wrong platform', async function () {
266266
const org = OrganizationFixture({features: ['feature-flag-cta']});
267267

268-
render(<EventFeatureFlagList {...NO_FLAG_CONTEXT_SECTION_PROPS_NO_CTA} />, {
268+
render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS_NO_CTA} />, {
269269
organization: org,
270270
});
271271

@@ -287,7 +287,7 @@ describe('EventFeatureFlagList', function () {
287287
it('renders nothing if event.contexts.flags is not set and should not show cta - no feature flag', async function () {
288288
const org = OrganizationFixture({features: ['fake-feature-flag']});
289289

290-
render(<EventFeatureFlagList {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, {
290+
render(<EventFeatureFlagSection {...NO_FLAG_CONTEXT_SECTION_PROPS_CTA} />, {
291291
organization: org,
292292
});
293293

static/app/components/events/featureFlags/eventFeatureFlagList.tsx renamed to static/app/components/events/featureFlags/eventFeatureFlagSection.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import AnalyticsArea from 'sentry/components/analyticsArea';
55
import {Button} from 'sentry/components/core/button';
66
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
77
import EmptyStateWarning from 'sentry/components/emptyStateWarning';
8+
import FeatureFlagInlineCTA from 'sentry/components/events/featureFlags/cta/featureFlagInlineCTA';
89
import {
910
CardContainer,
10-
FeatureFlagDrawer,
11-
} from 'sentry/components/events/featureFlags/featureFlagDrawer';
12-
import FeatureFlagInlineCTA from 'sentry/components/events/featureFlags/featureFlagInlineCTA';
11+
EventFeatureFlagDrawer,
12+
} from 'sentry/components/events/featureFlags/eventFeatureFlagDrawer';
1313
import FeatureFlagSettingsButton from 'sentry/components/events/featureFlags/featureFlagSettingsButton';
1414
import FeatureFlagSort from 'sentry/components/events/featureFlags/featureFlagSort';
1515
import {
@@ -39,21 +39,21 @@ import {useOrganizationFlagLog} from 'sentry/views/issueDetails/streamline/hooks
3939
import {useIssueDetailsEventView} from 'sentry/views/issueDetails/streamline/hooks/useIssueDetailsDiscoverQuery';
4040
import {InterimSection} from 'sentry/views/issueDetails/streamline/interimSection';
4141

42-
export function EventFeatureFlagList(props: EventFeatureFlagListProps) {
42+
export function EventFeatureFlagSection(props: EventFeatureFlagSectionProps) {
4343
return (
4444
<AnalyticsArea name="event_feature_flag_list">
4545
<BaseEventFeatureFlagList {...props} />
4646
</AnalyticsArea>
4747
);
4848
}
4949

50-
type EventFeatureFlagListProps = {
50+
type EventFeatureFlagSectionProps = {
5151
event: Event;
5252
group: Group;
5353
project: Project;
5454
};
5555

56-
function BaseEventFeatureFlagList({event, group, project}: EventFeatureFlagListProps) {
56+
function BaseEventFeatureFlagList({event, group, project}: EventFeatureFlagSectionProps) {
5757
const openForm = useFeedbackForm();
5858
const feedbackButton = openForm ? (
5959
<Button
@@ -183,7 +183,7 @@ function BaseEventFeatureFlagList({event, group, project}: EventFeatureFlagListP
183183
});
184184
openDrawer(
185185
() => (
186-
<FeatureFlagDrawer
186+
<EventFeatureFlagDrawer
187187
group={group}
188188
event={event}
189189
project={project}

static/app/components/events/featureFlags/featureFlagOnboardingLayout.tsx renamed to static/app/components/events/featureFlags/onboarding/featureFlagOnboardingLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {useMemo} from 'react';
22
import styled from '@emotion/styled';
33

44
import {LinkButton} from 'sentry/components/core/button';
5-
import OnboardingAdditionalFeatures from 'sentry/components/events/featureFlags/onboardingAdditionalFeatures';
5+
import OnboardingAdditionalFeatures from 'sentry/components/events/featureFlags/onboarding/onboardingAdditionalFeatures';
66
import {AuthTokenGeneratorProvider} from 'sentry/components/onboarding/gettingStartedDoc/authTokenGenerator';
77
import type {OnboardingLayoutProps} from 'sentry/components/onboarding/gettingStartedDoc/onboardingLayout';
88
import {Step} from 'sentry/components/onboarding/gettingStartedDoc/step';

static/app/components/events/featureFlags/featureFlagOnboardingSidebar.tsx renamed to static/app/components/events/featureFlags/onboarding/featureFlagOnboardingSidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import HighlightTopRightPattern from 'sentry-images/pattern/highlight-top-right.
66

77
import {LinkButton} from 'sentry/components/core/button';
88
import {CompactSelect} from 'sentry/components/core/compactSelect';
9-
import {FeatureFlagOnboardingLayout} from 'sentry/components/events/featureFlags/featureFlagOnboardingLayout';
10-
import {FeatureFlagOtherPlatformOnboarding} from 'sentry/components/events/featureFlags/featureFlagOtherPlatformOnboarding';
9+
import {FeatureFlagOnboardingLayout} from 'sentry/components/events/featureFlags/onboarding/featureFlagOnboardingLayout';
10+
import {FeatureFlagOtherPlatformOnboarding} from 'sentry/components/events/featureFlags/onboarding/featureFlagOtherPlatformOnboarding';
1111
import {SdkProviderEnum} from 'sentry/components/events/featureFlags/utils';
1212
import RadioGroup from 'sentry/components/forms/controls/radioGroup';
1313
import useDrawer from 'sentry/components/globalDrawer';

static/app/components/events/featureFlags/featureFlagOtherPlatformOnboarding.tsx renamed to static/app/components/events/featureFlags/onboarding/featureFlagOtherPlatformOnboarding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
33
import {Flex} from 'sentry/components/container/flex';
44
import {Alert} from 'sentry/components/core/alert';
55
import {LinkButton} from 'sentry/components/core/button';
6-
import OnboardingAdditionalFeatures from 'sentry/components/events/featureFlags/onboardingAdditionalFeatures';
6+
import OnboardingAdditionalFeatures from 'sentry/components/events/featureFlags/onboarding/onboardingAdditionalFeatures';
77
import {AuthTokenGeneratorProvider} from 'sentry/components/onboarding/gettingStartedDoc/authTokenGenerator';
88
import {t} from 'sentry/locale';
99
import {space} from 'sentry/styles/space';

0 commit comments

Comments
 (0)