1
+ import { useCallback } from 'react' ;
1
2
import styled from '@emotion/styled' ;
2
3
import type { Location } from 'history' ;
3
4
5
+ import { Button } from 'sentry/components/button' ;
6
+ import ButtonBar from 'sentry/components/buttonBar' ;
7
+ import FeedbackWidgetButton from 'sentry/components/feedback/widget/feedbackWidgetButton' ;
4
8
import * as Layout from 'sentry/components/layouts/thirds' ;
5
9
import { DatePageFilter } from 'sentry/components/organizations/datePageFilter' ;
6
10
import { EnvironmentPageFilter } from 'sentry/components/organizations/environmentPageFilter' ;
@@ -11,6 +15,8 @@ import {SpanSearchQueryBuilder} from 'sentry/components/performance/spanSearchQu
11
15
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle' ;
12
16
import { t } from 'sentry/locale' ;
13
17
import { space } from 'sentry/styles/space' ;
18
+ import { useLocation } from 'sentry/utils/useLocation' ;
19
+ import { useNavigate } from 'sentry/utils/useNavigate' ;
14
20
import useOrganization from 'sentry/utils/useOrganization' ;
15
21
import usePageFilters from 'sentry/utils/usePageFilters' ;
16
22
@@ -24,6 +30,8 @@ interface ExploreContentProps {
24
30
}
25
31
26
32
export function ExploreContent ( { } : ExploreContentProps ) {
33
+ const location = useLocation ( ) ;
34
+ const navigate = useNavigate ( ) ;
27
35
const organization = useOrganization ( ) ;
28
36
const { selection} = usePageFilters ( ) ;
29
37
@@ -33,29 +41,47 @@ export function ExploreContent({}: ExploreContentProps) {
33
41
? [ 'dataset toggle' as const ]
34
42
: [ ] ;
35
43
44
+ const switchToOldTraceExplorer = useCallback ( ( ) => {
45
+ navigate ( {
46
+ ...location ,
47
+ query : {
48
+ ...location . query ,
49
+ view : 'trace' ,
50
+ } ,
51
+ } ) ;
52
+ } , [ location , navigate ] ) ;
53
+
36
54
return (
37
55
< SentryDocumentTitle title = { t ( 'Explore' ) } orgSlug = { organization . slug } >
38
56
< PageFiltersContainer >
39
57
< Layout . Page >
40
58
< Layout . Header >
41
- < HeaderContent >
59
+ < Layout . HeaderContent >
42
60
< Title > { t ( 'Explore' ) } </ Title >
43
- < FilterActions >
44
- < PageFilterBar condensed >
45
- < ProjectPageFilter />
46
- < EnvironmentPageFilter />
47
- < DatePageFilter />
48
- </ PageFilterBar >
49
- < SpanSearchQueryBuilder
50
- projects = { selection . projects }
51
- initialQuery = { userQuery }
52
- onSearch = { setUserQuery }
53
- searchSource = "explore"
54
- />
55
- </ FilterActions >
56
- </ HeaderContent >
61
+ </ Layout . HeaderContent >
62
+ < Layout . HeaderActions >
63
+ < ButtonBar gap = { 1 } >
64
+ < Button onClick = { switchToOldTraceExplorer } >
65
+ { t ( 'Switch to old Trace Explore' ) }
66
+ </ Button >
67
+ < FeedbackWidgetButton />
68
+ </ ButtonBar >
69
+ </ Layout . HeaderActions >
57
70
</ Layout . Header >
58
71
< Body >
72
+ < FilterActions >
73
+ < PageFilterBar condensed >
74
+ < ProjectPageFilter />
75
+ < EnvironmentPageFilter />
76
+ < DatePageFilter />
77
+ </ PageFilterBar >
78
+ < SpanSearchQueryBuilder
79
+ projects = { selection . projects }
80
+ initialQuery = { userQuery }
81
+ onSearch = { setUserQuery }
82
+ searchSource = "explore"
83
+ />
84
+ </ FilterActions >
59
85
< Side >
60
86
< ExploreToolbar extras = { toolbarExtras } />
61
87
</ Side >
@@ -70,15 +96,12 @@ export function ExploreContent({}: ExploreContentProps) {
70
96
) ;
71
97
}
72
98
73
- const HeaderContent = styled ( Layout . HeaderContent ) `
74
- overflow: visible;
75
- ` ;
76
-
77
99
const Title = styled ( Layout . Title ) `
78
100
margin-bottom: ${ space ( 2 ) } ;
79
101
` ;
80
102
81
103
const FilterActions = styled ( 'div' ) `
104
+ grid-column: 1 / -1;
82
105
display: grid;
83
106
gap: ${ space ( 2 ) } ;
84
107
grid-template-columns: auto;
0 commit comments