1
1
import { Button , Stack , px , rem } from '@mantine/core' ;
2
- import IconButton from '@/components/Button/IconButton' ;
3
2
import { IconFilterHeart , IconMaximize , IconTable , IconTrash } from '@tabler/icons-react' ;
4
3
import { STREAM_PRIMARY_TOOLBAR_CONTAINER_HEIGHT , STREAM_PRIMARY_TOOLBAR_HEIGHT } from '@/constants/theme' ;
5
- import TimeRange from '@/components/Header/TimeRange' ;
6
- import RefreshInterval from '@/components/Header/RefreshInterval' ;
7
- import RefreshNow from '@/components/Header/RefreshNow' ;
8
- import Querier from './Querier' ;
9
4
import { appStoreReducers , useAppStore } from '@/layouts/MainLayout/providers/AppProvider' ;
5
+ import { filterStoreReducers , useFilterStore } from '../providers/FilterProvider' ;
6
+ import { logsStoreReducers , useLogsStore } from '../providers/LogsProvider' ;
10
7
import { useCallback , useEffect } from 'react' ;
11
- import StreamDropdown from '@/components/Header/StreamDropdown' ;
12
- import { notifications } from '@mantine/notifications' ;
13
8
import { useNavigate , useParams } from 'react-router-dom' ;
14
- import _ from 'lodash' ;
15
- import StreamingButton from '@/components/Header/StreamingButton' ;
9
+
10
+ import { CorrelationIcon } from '@/components/Navbar/components/CorrelationIcon' ;
11
+ import IconButton from '@/components/Button/IconButton' ;
12
+ import Querier from './Querier' ;
13
+ import RefreshInterval from '@/components/Header/RefreshInterval' ;
14
+ import RefreshNow from '@/components/Header/RefreshNow' ;
16
15
import ShareButton from '@/components/Header/ShareButton' ;
17
- import { useLogsStore , logsStoreReducers } from '../providers/LogsProvider' ;
18
- import { filterStoreReducers , useFilterStore } from '../providers/FilterProvider' ;
16
+ import StreamDropdown from '@/components/Header/StreamDropdown' ;
17
+ import StreamingButton from '@/components/Header/StreamingButton' ;
18
+ import TimeRange from '@/components/Header/TimeRange' ;
19
+ import _ from 'lodash' ;
19
20
import classes from './styles/PrimaryToolbar.module.css' ;
20
- import { CorrelationIcon } from '@/components/Navbar/components/CorrelationIcon ' ;
21
+ import { notifications } from '@mantine/notifications ' ;
21
22
22
23
const { toggleDeleteModal, onToggleView } = logsStoreReducers ;
23
24
const { toggleSavedFiltersModal } = filterStoreReducers ;
25
+ const { setStreamForCorrelation } = appStoreReducers ;
24
26
const renderMaximizeIcon = ( ) => < IconMaximize size = { px ( '1rem' ) } stroke = { 1.5 } /> ;
25
27
const renderDeleteIcon = ( ) => < IconTrash data-id = "delete-stream-btn" size = { px ( '1rem' ) } stroke = { 1.5 } /> ;
26
28
@@ -46,12 +48,16 @@ const SavedFiltersButton = () => {
46
48
47
49
const AddCorrelationButton = ( ) => {
48
50
const navigate = useNavigate ( ) ;
51
+ const [ , setAppStore ] = useAppStore ( ( ) => null ) ;
49
52
50
53
return (
51
54
< Button
52
55
className = { classes . savedFiltersBtn }
53
56
h = "100%"
54
- onClick = { ( ) => navigate ( '/correlation' ) }
57
+ onClick = { ( ) => {
58
+ setAppStore ( ( store ) => setStreamForCorrelation ( store , store . currentStream || '' ) ) ;
59
+ navigate ( '/correlation' ) ;
60
+ } }
55
61
leftSection = { < CorrelationIcon stroke = { '#000000' } strokeWidth = { 1 } /> } >
56
62
Correlate
57
63
</ Button >
0 commit comments