Skip to content

Commit c702322

Browse files
authored
ref(flags/tagsDrawer): Add empty state to issue flags and tags drawer (#87150)
<img width="1293" alt="SCR-20250314-rsdo" src="https://github.com/user-attachments/assets/f766b111-d47b-4610-9be9-49c81dbf8a40" /> <img width="1294" alt="SCR-20250314-rstz" src="https://github.com/user-attachments/assets/42897526-cda4-4966-81c8-bb2bd64932d3" /> See #86359 (comment) for error and loading states **3/17 update** ![Screenshot 2025-03-17 at 11 14 52 AM](https://github.com/user-attachments/assets/45532a21-e00a-4f08-bc22-3c0612a45699) Updated font size (16px) and text for no search results
1 parent 216093e commit c702322

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

static/app/views/issueDetails/groupFeatureFlags/groupFeatureFlagsDrawerContent.tsx

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import {useMemo} from 'react';
2-
import styled from '@emotion/styled';
32

43
import LoadingError from 'sentry/components/loadingError';
54
import LoadingIndicator from 'sentry/components/loadingIndicator';
65
import {t} from 'sentry/locale';
7-
import {space} from 'sentry/styles/space';
86
import type {Group} from 'sentry/types/group';
97
import useGroupFeatureFlags from 'sentry/views/issueDetails/groupFeatureFlags/useGroupFeatureFlags';
8+
import {
9+
Container,
10+
StyledEmptyStateWarning,
11+
Wrapper,
12+
} from 'sentry/views/issueDetails/groupTags/groupTagsDrawer';
1013
import {TagDistribution} from 'sentry/views/issueDetails/groupTags/tagDistribution';
1114
import type {GroupTag} from 'sentry/views/issueDetails/groupTags/useGroupTags';
1215

@@ -65,6 +68,12 @@ export default function GroupFeatureFlagsDrawerContent({
6568
message={t('There was an error loading feature flags.')}
6669
onRetry={refetch}
6770
/>
71+
) : displayTags.length === 0 ? (
72+
<StyledEmptyStateWarning withIcon>
73+
{data.length === 0
74+
? t('No feature flags were found for this issue')
75+
: t('No feature flags were found for this search')}
76+
</StyledEmptyStateWarning>
6877
) : (
6978
<Wrapper>
7079
<Container>
@@ -75,16 +84,3 @@ export default function GroupFeatureFlagsDrawerContent({
7584
</Wrapper>
7685
);
7786
}
78-
79-
const Wrapper = styled('div')`
80-
display: flex;
81-
flex-direction: column;
82-
gap: ${space(2)};
83-
`;
84-
85-
const Container = styled('div')`
86-
display: grid;
87-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
88-
gap: ${space(2)};
89-
margin-bottom: ${space(2)};
90-
`;

static/app/views/issueDetails/groupTags/groupTagsDrawer.tsx

+21-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {Button} from 'sentry/components/core/button';
77
import {InputGroup} from 'sentry/components/core/input/inputGroup';
88
import {ExportQueryType, useDataExport} from 'sentry/components/dataExport';
99
import {DropdownMenu} from 'sentry/components/dropdownMenu';
10+
import EmptyStateWarning from 'sentry/components/emptyStateWarning';
1011
import {
1112
CrumbContainer,
1213
EventDrawerBody,
@@ -260,21 +261,27 @@ export function GroupTagsDrawer({
260261
{headerActions}
261262
</EventNavigator>
262263
<EventDrawerBody>
263-
{tagKey ? (
264-
<TagDetailsDrawerContent group={group} />
265-
) : tab === FEATURE_FLAGS_TAB ? (
264+
{tab === FEATURE_FLAGS_TAB ? (
266265
<GroupFeatureFlagsDrawerContent
267266
group={group}
268267
environments={environments}
269268
search={search}
270269
/>
270+
) : tagKey ? (
271+
<TagDetailsDrawerContent group={group} />
271272
) : isPending || isHighlightsPending ? (
272273
<LoadingIndicator />
273274
) : isError ? (
274275
<LoadingError
275276
message={t('There was an error loading issue tags.')}
276277
onRetry={refetch}
277278
/>
279+
) : displayTags.length === 0 ? (
280+
<StyledEmptyStateWarning withIcon>
281+
{data.length === 0
282+
? t('No tags were found for this issue')
283+
: t('No tags were found for this search')}
284+
</StyledEmptyStateWarning>
278285
) : (
279286
<Wrapper>
280287
<Container>
@@ -293,13 +300,13 @@ export function GroupTagsDrawer({
293300
);
294301
}
295302

296-
const Wrapper = styled('div')`
303+
export const Wrapper = styled('div')`
297304
display: flex;
298305
flex-direction: column;
299306
gap: ${space(2)};
300307
`;
301308

302-
const Container = styled('div')`
309+
export const Container = styled('div')`
303310
display: grid;
304311
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
305312
gap: ${space(2)};
@@ -312,3 +319,12 @@ const Header = styled('h3')`
312319
font-weight: ${p => p.theme.fontWeightBold};
313320
margin: 0;
314321
`;
322+
323+
export const StyledEmptyStateWarning = styled(EmptyStateWarning)`
324+
border: ${p => p.theme.border} solid 1px;
325+
border-radius: ${p => p.theme.borderRadius};
326+
display: flex;
327+
flex-direction: column;
328+
align-items: center;
329+
font-size: ${p => p.theme.fontSizeLarge};
330+
`;

0 commit comments

Comments
 (0)