Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type {AggregateField} from 'sentry/views/explore/queryParams/aggregateFie
import {QueryParamsContextProvider} from 'sentry/views/explore/queryParams/context';
import {defaultCursor} from 'sentry/views/explore/queryParams/cursor';
import {defaultMode} from 'sentry/views/explore/queryParams/mode';
import {defaultQuery} from 'sentry/views/explore/queryParams/query';
import {
ReadableQueryParams,
type ReadableQueryParamsOptions,
Expand All @@ -32,7 +31,7 @@ export function ExploreStateQueryParamsProvider({
frozenParams,
}: ExploreStateQueryParamsProviderProps) {
const [mode, _setMode] = useState(defaultMode());
const [query, setQuery] = useResettableState(defaultQuery);
const [query, setQuery] = useResettableState(() => '');

const [cursor, _setCursor] = useState(defaultCursor());
const [fields, _setFields] = useState(defaultFields());
Expand Down
3 changes: 1 addition & 2 deletions static/app/views/explore/logs/logsQueryParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
isGroupBy,
} from 'sentry/views/explore/queryParams/groupBy';
import {getModeFromLocation} from 'sentry/views/explore/queryParams/mode';
import {getQueryFromLocation} from 'sentry/views/explore/queryParams/query';
import {ReadableQueryParams} from 'sentry/views/explore/queryParams/readableQueryParams';
import {
getIdFromLocation,
Expand All @@ -58,7 +57,7 @@ export function getReadableQueryParamsFromLocation(
location: Location
): ReadableQueryParams {
const mode = getModeFromLocation(location, LOGS_MODE_KEY);
const query = getQueryFromLocation(location, LOGS_QUERY_KEY) ?? '';
const query = decodeScalar(location.query[LOGS_QUERY_KEY]) ?? '';

const cursor = getCursorFromLocation(location, LOGS_CURSOR_KEY);
const fields = getFieldsFromLocation(location, LOGS_FIELDS_KEY) ?? defaultLogFields();
Expand Down
11 changes: 0 additions & 11 deletions static/app/views/explore/queryParams/query.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type {ReactNode} from 'react';
import {useCallback, useMemo} from 'react';
import type {Location} from 'history';

import {decodeScalar} from 'sentry/utils/queryString';
import {updateNullableLocation} from 'sentry/utils/url/updateNullableLocation';
import {useLocation} from 'sentry/utils/useLocation';
import {useNavigate} from 'sentry/utils/useNavigate';
import {Mode} from 'sentry/views/explore/contexts/pageParamsContext/mode';
import {QueryParamsContextProvider} from 'sentry/views/explore/queryParams/context';
import {getQueryFromLocation} from 'sentry/views/explore/queryParams/query';
import {ReadableQueryParams} from 'sentry/views/explore/queryParams/readableQueryParams';
import {
getIdFromLocation,
Expand All @@ -20,7 +20,7 @@ import type {WritableQueryParams} from 'sentry/views/explore/queryParams/writabl
const REPLAY_QUERY_KEY = 'query';

function getReadableQueryParamsFromLocation(location: Location): ReadableQueryParams {
const query = getQueryFromLocation(location, REPLAY_QUERY_KEY) ?? '';
const query = decodeScalar(location.query[REPLAY_QUERY_KEY]) ?? '';
const id = getIdFromLocation(location, ID_KEY);
const title = getTitleFromLocation(location, TITLE_KEY);

Expand Down
4 changes: 2 additions & 2 deletions static/app/views/explore/spans/spansQueryParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {Location} from 'history';
import {defined} from 'sentry/utils';
import type {Sort} from 'sentry/utils/discover/fields';
import {DiscoverDatasets} from 'sentry/utils/discover/types';
import {decodeScalar} from 'sentry/utils/queryString';
import {updateNullableLocation} from 'sentry/utils/url/updateNullableLocation';
import {DEFAULT_VISUALIZATION} from 'sentry/views/explore/contexts/pageParamsContext/visualizes';
import type {AggregateField} from 'sentry/views/explore/queryParams/aggregateField';
Expand All @@ -18,7 +19,6 @@ import {
isGroupBy,
} from 'sentry/views/explore/queryParams/groupBy';
import {getModeFromLocation} from 'sentry/views/explore/queryParams/mode';
import {getQueryFromLocation} from 'sentry/views/explore/queryParams/query';
import {ReadableQueryParams} from 'sentry/views/explore/queryParams/readableQueryParams';
import {
getIdFromLocation,
Expand Down Expand Up @@ -64,7 +64,7 @@ export function getReadableQueryParamsFromLocation(
): ReadableQueryParams {
const extrapolate = getExtrapolateFromLocation(location, SPANS_EXTRAPOLATE_KEY);
const mode = getModeFromLocation(location, SPANS_MODE_KEY);
const query = getQueryFromLocation(location, SPANS_QUERY_KEY) ?? '';
const query = decodeScalar(location.query[SPANS_QUERY_KEY]) ?? '';

const cursor = getCursorFromLocation(location, SPANS_CURSOR_KEY);
const fields = getFieldsFromLocation(location, SPANS_FIELD_KEY) ?? defaultFields();
Expand Down
Loading