Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions static/app/views/explore/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ export function viewSamplesTarget({
});
}

type MaxPickableDays = 7 | 14 | 30;
type DefaultPeriod = '24h' | '7d' | '14d' | '30d';
type MaxPickableDays = 7 | 14 | 30 | 90;
type DefaultPeriod = '24h' | '7d' | '14d' | '30d' | '90d';

export interface PickableDays {
defaultPeriod: DefaultPeriod;
Expand All @@ -370,21 +370,21 @@ export function limitMaxPickableDays(organization: Organization): PickableDays {
7: '7d',
14: '14d',
30: '30d',
90: '90d',
};

const relativeOptions: Array<[DefaultPeriod, ReactNode]> = [
['7d', t('Last 7 days')],
['14d', t('Last 14 days')],
['30d', t('Last 30 days')],
['90d', t('Last 90 days')],
];

const maxPickableDays: MaxPickableDays = organization.features.includes(
'visibility-explore-range-high'
)
? 30
: organization.features.includes('visibility-explore-range-medium')
? 14
: 7;
? 90
: 30;
const defaultPeriod: DefaultPeriod = defaultPeriods[maxPickableDays];

const index = relativeOptions.findIndex(([period, _]) => period === defaultPeriod) + 1;
Expand Down
Loading