Skip to content

Commit 300f19d

Browse files
authored
feat(replays): Make replayId a default column on Discover views (getsentry#40961)
This PR makes the default fields used on the discover view include replayId and the replay link button if the feature is enabled. Closes getsentry#39716
1 parent 5dc17b0 commit 300f19d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

static/app/views/eventsV2/results.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,14 @@ export class Results extends Component<Props, State> {
298298

299299
// If the view is not valid, redirect to a known valid state.
300300
const {location, organization, selection, isHomepage, savedQuery} = this.props;
301-
const query = isHomepage && savedQuery ? omit(savedQuery, 'id') : DEFAULT_EVENT_VIEW;
301+
const isReplayEnabled = organization.features.includes('session-replay-ui');
302+
const defaultEventView = Object.assign({}, DEFAULT_EVENT_VIEW, {
303+
fields: isReplayEnabled
304+
? DEFAULT_EVENT_VIEW.fields.concat(['replayId'])
305+
: DEFAULT_EVENT_VIEW.fields,
306+
});
307+
308+
const query = isHomepage && savedQuery ? omit(savedQuery, 'id') : defaultEventView;
302309
const nextEventView = EventView.fromNewQueryWithLocation(query, location);
303310
if (nextEventView.project.length === 0 && selection.projects) {
304311
nextEventView.project = selection.projects;

0 commit comments

Comments
 (0)