Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(replay): query custom tags from replays dataset #78573

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions static/app/views/alerts/rules/metric/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export enum Dataset {
/** Also used for crash free alerts */
METRICS = 'metrics',
ISSUE_PLATFORM = 'search_issues',
REPLAYS = 'replays',
}

export enum EventTypes {
Expand Down
13 changes: 5 additions & 8 deletions static/app/views/replays/list/replaySearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function ReplaySearchBar(props: Props) {
{
orgSlug: organization.slug,
projectIds: projectIds.map(String),
dataset: Dataset.ISSUE_PLATFORM,
dataset: Dataset.REPLAYS,
useCache: true,
enabled: true,
keepPreviousData: false,
Expand All @@ -139,21 +139,18 @@ function ReplaySearchBar(props: Props) {
},
{}
);
const issuePlatformTags: TagCollection = useMemo(() => {
const customTags: TagCollection = useMemo(() => {
return (tagQuery.data ?? []).reduce<TagCollection>((acc, tag) => {
acc[tag.key] = {...tag, kind: FieldKind.TAG};
return acc;
}, {});
}, [tagQuery]);
// tagQuery.isLoading and tagQuery.isError are not used

const filterKeys = useMemo(
() => getReplayFilterKeys(issuePlatformTags),
[issuePlatformTags]
);
const filterKeys = useMemo(() => getReplayFilterKeys(customTags), [customTags]);
const filterKeySections = useMemo(() => {
return getFilterKeySections(issuePlatformTags, organization);
}, [issuePlatformTags, organization]);
return getFilterKeySections(customTags, organization);
}, [customTags, organization]);

const getTagValues = useCallback(
(tag: Tag, searchQuery: string): Promise<string[]> => {
Expand Down
Loading