Skip to content

Commit a227186

Browse files
authored
ref(flags): add settings button to issues CTA (#87205)
Include this dropdown button in CTA to stay consistent w/other states ![Screenshot 2025-03-17 at 11 32 41 AM](https://github.com/user-attachments/assets/5fb21bc7-c575-46b2-9eef-9b5d745ef327) Padding is preserved in has flags state ![Screenshot 2025-03-17 at 11 29 54 AM](https://github.com/user-attachments/assets/0ec5454e-0edd-4450-a645-c99b3e3f8b14)
1 parent b2f0020 commit a227186

File tree

3 files changed

+71
-56
lines changed

3 files changed

+71
-56
lines changed

static/app/components/events/featureFlags/eventFeatureFlagList.tsx

+20-55
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import styled from '@emotion/styled';
33

44
import ButtonBar from 'sentry/components/buttonBar';
55
import {Button} from 'sentry/components/core/button';
6-
import {DropdownMenu} from 'sentry/components/dropdownMenu';
76
import EmptyStateWarning from 'sentry/components/emptyStateWarning';
87
import {
98
CardContainer,
109
FeatureFlagDrawer,
1110
} from 'sentry/components/events/featureFlags/featureFlagDrawer';
1211
import FeatureFlagInlineCTA from 'sentry/components/events/featureFlags/featureFlagInlineCTA';
12+
import FeatureFlagSettingsButton from 'sentry/components/events/featureFlags/featureFlagSettingsButton';
1313
import FeatureFlagSort from 'sentry/components/events/featureFlags/featureFlagSort';
1414
import {
1515
FlagControlOptions,
@@ -20,7 +20,7 @@ import {
2020
import useDrawer from 'sentry/components/globalDrawer';
2121
import KeyValueData from 'sentry/components/keyValueData';
2222
import {featureFlagOnboardingPlatforms} from 'sentry/data/platformCategories';
23-
import {IconMegaphone, IconSearch, IconSettings} from 'sentry/icons';
23+
import {IconMegaphone, IconSearch} from 'sentry/icons';
2424
import {t, tn} from 'sentry/locale';
2525
import type {Event, FeatureFlag} from 'sentry/types/event';
2626
import {type Group, IssueCategory} from 'sentry/types/group';
@@ -229,54 +229,24 @@ export function EventFeatureFlagList({
229229
const actions = (
230230
<ButtonBar gap={1}>
231231
{feedbackButton}
232-
<Fragment>
233-
<DropdownMenu
234-
position="bottom-end"
235-
triggerProps={{
236-
showChevron: false,
237-
icon: <IconSettings />,
238-
'aria-label': t('Feature Flag Settings'),
239-
}}
240-
size="xs"
241-
items={[
242-
{
243-
key: 'settings',
244-
label: t('Set Up Change Tracking'),
245-
details: (
246-
<ChangeTrackingDetails>
247-
{t(
248-
'Listen for additions, removals, and modifications to your feature flags.'
249-
)}
250-
</ChangeTrackingDetails>
251-
),
252-
to: `/settings/${organization.slug}/feature-flags/change-tracking/`,
253-
},
254-
{
255-
key: 'docs',
256-
label: t('Read the Docs'),
257-
externalHref:
258-
'https://docs.sentry.io/product/issues/issue-details/feature-flags/',
259-
},
260-
]}
261-
/>
262-
{hasFlags && (
263-
<Fragment>
264-
<Button
265-
aria-label={t('Open Feature Flag Search')}
266-
icon={<IconSearch size="xs" />}
267-
size="xs"
268-
title={t('Open Search')}
269-
onClick={() => onViewAllFlags(FlagControlOptions.SEARCH)}
270-
/>
271-
<FeatureFlagSort
272-
orderBy={orderBy}
273-
sortBy={sortBy}
274-
setSortBy={setSortBy}
275-
setOrderBy={setOrderBy}
276-
/>
277-
</Fragment>
278-
)}
279-
</Fragment>
232+
<FeatureFlagSettingsButton orgSlug={organization.slug} />
233+
{hasFlags && (
234+
<Fragment>
235+
<Button
236+
aria-label={t('Open Feature Flag Search')}
237+
icon={<IconSearch size="xs" />}
238+
size="xs"
239+
title={t('Open Search')}
240+
onClick={() => onViewAllFlags(FlagControlOptions.SEARCH)}
241+
/>
242+
<FeatureFlagSort
243+
orderBy={orderBy}
244+
sortBy={sortBy}
245+
setSortBy={setSortBy}
246+
setOrderBy={setOrderBy}
247+
/>
248+
</Fragment>
249+
)}
280250
</ButtonBar>
281251
);
282252

@@ -332,11 +302,6 @@ export function EventFeatureFlagList({
332302
);
333303
}
334304

335-
const ChangeTrackingDetails = styled('div')`
336-
max-width: 200px;
337-
white-space: normal;
338-
`;
339-
340305
const StyledEmptyStateWarning = styled(EmptyStateWarning)`
341306
border: ${p => p.theme.border} solid 1px;
342307
border-radius: ${p => p.theme.borderRadius};

static/app/components/events/featureFlags/featureFlagInlineCTA.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {usePrompt} from 'sentry/actionCreators/prompts';
44
import ButtonBar from 'sentry/components/buttonBar';
55
import {Button, LinkButton} from 'sentry/components/core/button';
66
import {DropdownMenu} from 'sentry/components/dropdownMenu';
7+
import FeatureFlagSettingsButton from 'sentry/components/events/featureFlags/featureFlagSettingsButton';
78
import {useFeatureFlagOnboarding} from 'sentry/components/events/featureFlags/useFeatureFlagOnboarding';
89
import {IconClose, IconMegaphone} from 'sentry/icons';
910
import {t} from 'sentry/locale';
@@ -55,7 +56,12 @@ export default function FeatureFlagInlineCTA({projectId}: {projectId: string}) {
5556
return null;
5657
}
5758

58-
const actions = <ButtonBar gap={1}>{feedbackButton}</ButtonBar>;
59+
const actions = (
60+
<ButtonBar gap={1}>
61+
{feedbackButton}
62+
<FeatureFlagSettingsButton orgSlug={organization.slug} />
63+
</ButtonBar>
64+
);
5965

6066
return (
6167
<InterimSection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import styled from '@emotion/styled';
2+
3+
import {DropdownMenu} from 'sentry/components/dropdownMenu';
4+
import {IconSettings} from 'sentry/icons';
5+
import {t} from 'sentry/locale';
6+
7+
export default function FeatureFlagSettingsButton({orgSlug}: {orgSlug: string}) {
8+
return (
9+
<DropdownMenu
10+
position="bottom-end"
11+
triggerProps={{
12+
showChevron: false,
13+
icon: <IconSettings />,
14+
'aria-label': t('Feature Flag Settings'),
15+
}}
16+
size="xs"
17+
items={[
18+
{
19+
key: 'settings',
20+
label: t('Set Up Change Tracking'),
21+
details: (
22+
<ChangeTrackingDetails>
23+
{t(
24+
'Listen for additions, removals, and modifications to your feature flags.'
25+
)}
26+
</ChangeTrackingDetails>
27+
),
28+
to: `/settings/${orgSlug}/feature-flags/change-tracking/`,
29+
},
30+
{
31+
key: 'docs',
32+
label: t('Read the Docs'),
33+
externalHref:
34+
'https://docs.sentry.io/product/issues/issue-details/feature-flags/',
35+
},
36+
]}
37+
/>
38+
);
39+
}
40+
41+
const ChangeTrackingDetails = styled('div')`
42+
max-width: 200px;
43+
white-space: normal;
44+
`;

0 commit comments

Comments
 (0)