@@ -8,13 +8,10 @@ import {withoutLoggingSupport} from 'sentry/data/platformCategories';
88import { platforms } from 'sentry/data/platforms' ;
99import { IconMegaphone , IconOpen } from 'sentry/icons' ;
1010import { t } from 'sentry/locale' ;
11- import { DataCategory } from 'sentry/types/core' ;
1211import { defined } from 'sentry/utils' ;
1312import { trackAnalytics } from 'sentry/utils/analytics' ;
1413import { LogsAnalyticsPageSource } from 'sentry/utils/analytics/logsAnalyticsEvent' ;
15- import { useDatePageFilterProps } from 'sentry/utils/useDatePageFilterProps' ;
1614import { useFeedbackForm } from 'sentry/utils/useFeedbackForm' ;
17- import { useMaxPickableDays } from 'sentry/utils/useMaxPickableDays' ;
1815import useOrganization from 'sentry/utils/useOrganization' ;
1916import usePageFilters from 'sentry/utils/usePageFilters' ;
2017import useProjects from 'sentry/utils/useProjects' ;
@@ -25,6 +22,7 @@ import {useGetSavedQuery} from 'sentry/views/explore/hooks/useGetSavedQueries';
2522import { LogsTabOnboarding } from 'sentry/views/explore/logs/logsOnboarding' ;
2623import { LogsQueryParamsProvider } from 'sentry/views/explore/logs/logsQueryParamsProvider' ;
2724import { LogsTabContent } from 'sentry/views/explore/logs/logsTab' ;
25+ import { logsPickableDays } from 'sentry/views/explore/logs/utils' ;
2826import {
2927 useQueryParamsId ,
3028 useQueryParamsTitle ,
@@ -60,30 +58,22 @@ function FeedbackButton() {
6058
6159export default function LogsContent ( ) {
6260 const organization = useOrganization ( ) ;
63- const maxPickableDays = useMaxPickableDays ( {
64- dataCategories : [ DataCategory . LOG_BYTE ] ,
65- organization,
66- } ) ;
67- const datePageFilterProps = useDatePageFilterProps ( maxPickableDays ) ;
61+ const { defaultPeriod, maxPickableDays, relativeOptions} = logsPickableDays ( ) ;
6862
6963 const onboardingProject = useOnboardingProject ( { property : 'hasLogs' } ) ;
7064
7165 return (
7266 < SentryDocumentTitle title = { t ( 'Logs' ) } orgSlug = { organization ?. slug } >
7367 < PageFiltersContainer
74- maxPickableDays = { datePageFilterProps . maxPickableDays }
75- defaultSelection = {
76- datePageFilterProps . defaultPeriod
77- ? {
78- datetime : {
79- period : datePageFilterProps . defaultPeriod ,
80- start : null ,
81- end : null ,
82- utc : null ,
83- } ,
84- }
85- : undefined
86- }
68+ maxPickableDays = { maxPickableDays }
69+ defaultSelection = { {
70+ datetime : {
71+ period : defaultPeriod ,
72+ start : null ,
73+ end : null ,
74+ utc : null ,
75+ } ,
76+ } }
8777 >
8878 < LogsQueryParamsProvider
8979 analyticsPageSource = { LogsAnalyticsPageSource . EXPLORE_LOGS }
@@ -97,10 +87,16 @@ export default function LogsContent() {
9787 < LogsTabOnboarding
9888 organization = { organization }
9989 project = { onboardingProject }
100- datePageFilterProps = { datePageFilterProps }
90+ defaultPeriod = { defaultPeriod }
91+ maxPickableDays = { maxPickableDays }
92+ relativeOptions = { relativeOptions }
10193 />
10294 ) : (
103- < LogsTabContent datePageFilterProps = { datePageFilterProps } />
95+ < LogsTabContent
96+ defaultPeriod = { defaultPeriod }
97+ maxPickableDays = { maxPickableDays }
98+ relativeOptions = { relativeOptions }
99+ />
104100 ) }
105101 </ LogsPageDataProvider >
106102 </ TraceItemAttributeProvider >
0 commit comments