Skip to content

Commit 8a3d936

Browse files
Revert "feat(explore): Add hooks for date page filter props based on data cat… (#103822)"
This reverts commit b535ce8. Co-authored-by: Zylphrex <[email protected]>
1 parent dfbfcd7 commit 8a3d936

31 files changed

+342
-554
lines changed

static/app/types/hooks.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ type OrganizationHeaderProps = {
110110

111111
type ProductSelectionAvailabilityProps = Omit<ProductSelectionProps, 'disabledProducts'>;
112112

113-
type DateRangeQueryLimitFooterProps = {
114-
description: string;
115-
source: string;
116-
};
117-
118113
type FirstPartyIntegrationAlertProps = {
119114
integrations: Integration[];
120115
hideCTA?: boolean;
@@ -194,9 +189,9 @@ type ComponentHooks = {
194189
'component:disabled-member': () => React.ComponentType;
195190
'component:disabled-member-tooltip': () => React.ComponentType<DisabledMemberTooltipProps>;
196191
'component:enhanced-org-stats': () => React.ComponentType<OrganizationStatsProps>;
192+
'component:explore-date-range-query-limit-footer': () => React.ComponentType;
197193
'component:first-party-integration-additional-cta': () => React.ComponentType<FirstPartyIntegrationAdditionalCTAProps>;
198194
'component:first-party-integration-alert': () => React.ComponentType<FirstPartyIntegrationAlertProps>;
199-
'component:header-date-page-filter-upsell-footer': () => React.ComponentType<DateRangeQueryLimitFooterProps>;
200195
'component:header-date-range': () => React.ComponentType<DateRangeProps>;
201196
'component:header-selector-items': () => React.ComponentType<SelectorItemsProps>;
202197
'component:insights-date-range-query-limit-footer': () => React.ComponentType;

static/app/utils/useDatePageFilterProps.tsx

Lines changed: 0 additions & 64 deletions
This file was deleted.

static/app/utils/useMaxPickableDays.spec.tsx

Lines changed: 0 additions & 90 deletions
This file was deleted.

static/app/utils/useMaxPickableDays.tsx

Lines changed: 0 additions & 108 deletions
This file was deleted.

static/app/views/explore/logs/content.tsx

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ import {withoutLoggingSupport} from 'sentry/data/platformCategories';
88
import {platforms} from 'sentry/data/platforms';
99
import {IconMegaphone, IconOpen} from 'sentry/icons';
1010
import {t} from 'sentry/locale';
11-
import {DataCategory} from 'sentry/types/core';
1211
import {defined} from 'sentry/utils';
1312
import {trackAnalytics} from 'sentry/utils/analytics';
1413
import {LogsAnalyticsPageSource} from 'sentry/utils/analytics/logsAnalyticsEvent';
15-
import {useDatePageFilterProps} from 'sentry/utils/useDatePageFilterProps';
1614
import {useFeedbackForm} from 'sentry/utils/useFeedbackForm';
17-
import {useMaxPickableDays} from 'sentry/utils/useMaxPickableDays';
1815
import useOrganization from 'sentry/utils/useOrganization';
1916
import usePageFilters from 'sentry/utils/usePageFilters';
2017
import useProjects from 'sentry/utils/useProjects';
@@ -25,6 +22,7 @@ import {useGetSavedQuery} from 'sentry/views/explore/hooks/useGetSavedQueries';
2522
import {LogsTabOnboarding} from 'sentry/views/explore/logs/logsOnboarding';
2623
import {LogsQueryParamsProvider} from 'sentry/views/explore/logs/logsQueryParamsProvider';
2724
import {LogsTabContent} from 'sentry/views/explore/logs/logsTab';
25+
import {logsPickableDays} from 'sentry/views/explore/logs/utils';
2826
import {
2927
useQueryParamsId,
3028
useQueryParamsTitle,
@@ -60,30 +58,22 @@ function FeedbackButton() {
6058

6159
export 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

Comments
 (0)