diff --git a/scripts/type-coverage.ts b/scripts/type-coverage.ts index f3daff403d88..55b389b8091c 100644 --- a/scripts/type-coverage.ts +++ b/scripts/type-coverage.ts @@ -204,12 +204,11 @@ function recordNonNull( hits: NonNullHit[], sourceFile: ts.SourceFile, node: ts.Node, - kind: NonNullHit['kind'], - codeNode?: ts.Node + kind: NonNullHit['kind'] ) { const pos = ts.getLineAndCharacterOfPosition(sourceFile, node.getStart(sourceFile)); const relPath = path.relative(process.cwd(), sourceFile.fileName); - const code = textPreview((codeNode ?? node).getText(sourceFile)); + const code = textPreview(node.getText(sourceFile)); hits.push({ file: relPath, line: pos.line + 1, @@ -224,12 +223,11 @@ function recordTypeAssertion( sourceFile: ts.SourceFile, node: ts.Node, kind: TypeAssertionHit['kind'], - targetType: string, - codeNode?: ts.Node + targetType: string ) { const pos = ts.getLineAndCharacterOfPosition(sourceFile, node.getStart(sourceFile)); const relPath = path.relative(process.cwd(), sourceFile.fileName); - const code = textPreview((codeNode ?? node).getText(sourceFile)); + const code = textPreview(node.getText(sourceFile)); hits.push({ file: relPath, line: pos.line + 1, @@ -240,9 +238,13 @@ function recordTypeAssertion( }); } -function textPreview(s: string, max = 80) { +const TEXT_PREVIEW_MAX_LENGTH = 80; + +function textPreview(s: string) { const one = s.replace(/\s+/g, ' ').trim(); - return one.length <= max ? one : one.slice(0, max - 1) + '…'; + return one.length <= TEXT_PREVIEW_MAX_LENGTH + ? one + : one.slice(0, TEXT_PREVIEW_MAX_LENGTH - 1) + '…'; } function countBindingPatternElements( diff --git a/static/app/actionCreators/dashboards.tsx b/static/app/actionCreators/dashboards.tsx index fb87526561c2..778807170542 100644 --- a/static/app/actionCreators/dashboards.tsx +++ b/static/app/actionCreators/dashboards.tsx @@ -28,7 +28,7 @@ import {getResultsLimit} from 'sentry/views/dashboards/widgetBuilder/utils'; export function fetchDashboards( api: Client, orgSlug: string, - query?: {filter?: DashboardFilter; sort?: string} + query?: {filter?: DashboardFilter} ) { const promise: Promise = api.requestPromise( `/organizations/${orgSlug}/dashboards/`, diff --git a/static/app/actionCreators/group.tsx b/static/app/actionCreators/group.tsx index f648e1925220..43c3e3737f50 100644 --- a/static/app/actionCreators/group.tsx +++ b/static/app/actionCreators/group.tsx @@ -202,7 +202,6 @@ type FetchIssueTagValuesParameters = { organization: Organization; tagKey: string; cursor?: QueryParamValue; - environment?: string[]; sort?: string | string[]; }; @@ -210,7 +209,6 @@ export function issueTagValuesApiOptions({ organization, groupId, tagKey, - environment, sort, cursor, }: FetchIssueTagValuesParameters) { @@ -223,7 +221,7 @@ export function issueTagValuesApiOptions({ issueId: groupId, key: tagKey, }, - query: {environment, sort, cursor}, + query: {sort, cursor}, staleTime: 0, } ), diff --git a/static/app/actionCreators/navigation.tsx b/static/app/actionCreators/navigation.tsx index 29658c8e5cf3..5d5e215a6f1b 100644 --- a/static/app/actionCreators/navigation.tsx +++ b/static/app/actionCreators/navigation.tsx @@ -3,7 +3,6 @@ import type {Location, Query} from 'history'; import {openModal} from 'sentry/actionCreators/modal'; import {ContextPickerModalContainer as ContextPickerModal} from 'sentry/components/contextPickerModal'; import {ProjectsStore} from 'sentry/stores/projectsStore'; -import type {ApiQueryKey} from 'sentry/utils/api/apiQueryKey'; import {replaceRouterParams} from 'sentry/utils/replaceRouterParams'; import {normalizeUrl} from 'sentry/utils/url/normalizeUrl'; import type {ReactRouter3Navigate} from 'sentry/utils/useNavigate'; @@ -11,8 +10,7 @@ import type {ReactRouter3Navigate} from 'sentry/utils/useNavigate'; export function navigateTo( to: string | {pathname: string; query?: Query}, navigate: ReactRouter3Navigate, - location: Location | undefined, - configQueryKey?: ApiQueryKey + location: Location | undefined ) { let pathname: string; if (typeof to === 'string') { @@ -31,12 +29,7 @@ export function navigateTo( typeof comingFromProjectId === 'string' ? comingFromProjectId : undefined ); - if ( - needOrg || - needTeam || - (needProject && (needProjectId || !projectById)) || - configQueryKey - ) { + if (needOrg || needTeam || (needProject && (needProjectId || !projectById))) { openModal( modalProps => ( { modalProps.closeModal(); return window.setTimeout(() => navigate(normalizeUrl(path)), 0); diff --git a/static/app/actionCreators/organizations.tsx b/static/app/actionCreators/organizations.tsx index f50476132e13..8d5c04e33b4e 100644 --- a/static/app/actionCreators/organizations.tsx +++ b/static/app/actionCreators/organizations.tsx @@ -9,7 +9,6 @@ import {GuideStore} from 'sentry/stores/guideStore'; import {OrganizationsStore} from 'sentry/stores/organizationsStore'; import {OrganizationStore} from 'sentry/stores/organizationStore'; import {ProjectsStore} from 'sentry/stores/projectsStore'; -import {TeamStore} from 'sentry/stores/teamStore'; import type {Organization} from 'sentry/types/organization'; import {normalizeUrl} from 'sentry/utils/url/normalizeUrl'; @@ -175,11 +174,6 @@ type FetchOrganizationDetailsParams = { */ loadProjects?: boolean; - /** - * Should load teams in TeamStore? - */ - loadTeam?: boolean; - /** * Should set as active organization? */ @@ -188,7 +182,7 @@ type FetchOrganizationDetailsParams = { export async function fetchOrganizationDetails( api: Client, orgId: string, - {setActive, loadProjects, loadTeam}: FetchOrganizationDetailsParams + {setActive, loadProjects}: FetchOrganizationDetailsParams ) { const data = await api.requestPromise(`/organizations/${orgId}/`, { query: { @@ -200,10 +194,6 @@ export async function fetchOrganizationDetails( setActiveOrganization(data); } - if (loadTeam) { - TeamStore.loadInitialData(data.teams, false, null); - } - if (loadProjects) { ProjectsStore.loadInitialData(data.projects || []); } diff --git a/static/app/actionCreators/prompts.tsx b/static/app/actionCreators/prompts.tsx index 2354cb8cf048..83f705b7b7c5 100644 --- a/static/app/actionCreators/prompts.tsx +++ b/static/app/actionCreators/prompts.tsx @@ -48,10 +48,6 @@ type PromptCheckParams = { */ feature: string | string[]; organization: OrganizationSummary; - /** - * The numeric project ID as a string - */ - projectId?: string; }; type PromptCheckHookParams = { @@ -101,7 +97,6 @@ export async function promptsCheck( ): Promise { const query = { feature: params.feature, - ...(params.projectId === undefined ? {} : {project_id: params.projectId}), }; const url = `/organizations/${params.organization.slug}/prompts-activity/`; const response: PromptResponse = await api.requestPromise(url, { @@ -150,7 +145,6 @@ function usePromptsCheck( export function usePrompts({ features, organization, - projectId, daysToSnooze, options, isDismissed = promptIsDismissed, @@ -160,10 +154,9 @@ export function usePrompts({ daysToSnooze?: number; isDismissed?: (prompt: PromptData, daysToSnooze?: number) => boolean; options?: Partial>; - projectId?: string; }) { const api = useApi({persistInFlight: true}); - const prompts = usePromptsCheck({feature: features, organization, projectId}, options); + const prompts = usePromptsCheck({feature: features, organization}, options); const queryClient = useQueryClient(); const isPromptDismissed = useMemo(() => { if (prompts.isSuccess) { @@ -186,7 +179,6 @@ export function usePrompts({ } promptsUpdate(api, { organization, - projectId, feature, status: 'dismissed', }); @@ -198,7 +190,6 @@ export function usePrompts({ makePromptsCheckQueryKey({ organization, feature: features, - projectId, }), existingData => { const dismissedTs = Date.now() / 1000; @@ -209,7 +200,7 @@ export function usePrompts({ } ); }, - [api, organization, projectId, queryClient, features] + [api, organization, queryClient, features] ); const snoozePrompt = useCallback( @@ -219,7 +210,6 @@ export function usePrompts({ } promptsUpdate(api, { organization, - projectId, feature, status: 'snoozed', }); @@ -231,7 +221,6 @@ export function usePrompts({ makePromptsCheckQueryKey({ organization, feature: features, - projectId, }), existingData => { const snoozedTs = Date.now() / 1000; @@ -242,7 +231,7 @@ export function usePrompts({ } ); }, - [api, organization, projectId, queryClient, features] + [api, organization, queryClient, features] ); const showPrompt = useCallback( @@ -252,7 +241,6 @@ export function usePrompts({ } promptsUpdate(api, { organization, - projectId, feature, status: 'visible', }); @@ -264,7 +252,6 @@ export function usePrompts({ makePromptsCheckQueryKey({ organization, feature: features, - projectId, }), existingData => { return { @@ -274,7 +261,7 @@ export function usePrompts({ } ); }, - [api, organization, projectId, queryClient, features] + [api, organization, queryClient, features] ); return { @@ -423,12 +410,10 @@ export async function batchedPromptsCheck( features: T, params: { organization: OrganizationSummary; - projectId?: string; } ): Promise> { const query = { feature: features, - ...(params.projectId === undefined ? {} : {project_id: params.projectId}), }; const url = `/organizations/${params.organization.slug}/prompts-activity/`; const response: PromptResponse = await api.requestPromise(url, { diff --git a/static/app/actionCreators/savedSearches.tsx b/static/app/actionCreators/savedSearches.tsx index a77eaaa38158..4d0ce4bb13bf 100644 --- a/static/app/actionCreators/savedSearches.tsx +++ b/static/app/actionCreators/savedSearches.tsx @@ -84,13 +84,11 @@ function recentSearchesApiOptions({ namespace, orgSlug, savedSearchType, - query, }: { limit: number; orgSlug: string; savedSearchType: SavedSearchType | null; namespace?: string; - query?: string; }) { return { ...apiOptions.as()( @@ -98,7 +96,7 @@ function recentSearchesApiOptions({ { path: savedSearchType === null ? skipToken : {organizationIdOrSlug: orgSlug}, query: { - query: encodeNamespacedRecentSearch(namespace, query), + query: encodeNamespacedRecentSearch(namespace), type: savedSearchType, limit, }, @@ -120,7 +118,6 @@ type RecentSearchesQueryOptions = Omit< export function useFetchRecentSearches( { - query, savedSearchType, limit = MAX_AUTOCOMPLETE_RECENT_SEARCHES, namespace, @@ -128,7 +125,6 @@ export function useFetchRecentSearches( savedSearchType: SavedSearchType | null; limit?: number; namespace?: string; - query?: string; }, options: RecentSearchesQueryOptions = {} ) { @@ -139,7 +135,6 @@ export function useFetchRecentSearches( limit, namespace, orgSlug: organization.slug, - query, savedSearchType, }), ...options, diff --git a/static/app/components/backendJsonFormAdapter/choiceMapperAdapter.tsx b/static/app/components/backendJsonFormAdapter/choiceMapperAdapter.tsx index 8dde71148684..b24d77f6f255 100644 --- a/static/app/components/backendJsonFormAdapter/choiceMapperAdapter.tsx +++ b/static/app/components/backendJsonFormAdapter/choiceMapperAdapter.tsx @@ -382,7 +382,7 @@ export function ChoiceMapperTable({ * Transform choice tuples from the backend config into Select options. */ function transformMappedChoices( - selector?: {choices?: Array<[string, string]>; placeholder?: string} | unknown + selector?: {choices?: Array<[string, string]>} | unknown ): Array<{label: string; value: string}> { if (!selector || typeof selector !== 'object') { return []; diff --git a/static/app/components/core/chat/thinkingBlock.tsx b/static/app/components/core/chat/thinkingBlock.tsx index 53ef7386b591..c19d5a48fc44 100644 --- a/static/app/components/core/chat/thinkingBlock.tsx +++ b/static/app/components/core/chat/thinkingBlock.tsx @@ -9,24 +9,22 @@ import {IconSeer} from 'sentry/icons'; import {getDuration} from 'sentry/utils/duration/getDuration'; import {SECOND} from 'sentry/utils/formatters'; +const ELAPSED_TIME_TICK_INTERVAL_MS = 100; + /** * Returns elapsed ms between `startTime` and `endTime`. - * While `endTime` is undefined, ticks every `intervalMs` to keep the value live. + * While `endTime` is undefined, ticks every ELAPSED_TIME_TICK_INTERVAL_MS to keep the value live. */ -function useElapsedTime( - startTime: Date, - endTime: Date | undefined, - intervalMs = 100 -): number { +function useElapsedTime(startTime: Date, endTime: Date | undefined): number { const [now, setNow] = useState(() => new Date()); useEffect(() => { if (endTime) { return; } - const id = setInterval(() => setNow(new Date()), intervalMs); + const id = setInterval(() => setNow(new Date()), ELAPSED_TIME_TICK_INTERVAL_MS); return () => clearInterval(id); - }, [endTime, intervalMs]); + }, [endTime]); return (endTime ?? now).getTime() - startTime.getTime(); } @@ -37,13 +35,15 @@ function useElapsedTime( * in even thirds so they fit the reserved space and never shift layout as the * count changes. Decorative — hidden from AT. */ -function AnimatedEllipsis({intervalMs = 400}: {intervalMs?: number}) { +const ELLIPSIS_TICK_INTERVAL_MS = 400; + +function AnimatedEllipsis() { const [count, setCount] = useState(1); useEffect(() => { - const id = setInterval(() => setCount(c => (c % 3) + 1), intervalMs); + const id = setInterval(() => setCount(c => (c % 3) + 1), ELLIPSIS_TICK_INTERVAL_MS); return () => clearInterval(id); - }, [intervalMs]); + }, []); return ( ; -}): KeyValueListData { +export function getSpringContextData({data}: {data: SpringContext}): KeyValueListData { return getContextKeys({data}).map(ctxKey => { switch (ctxKey) { case SpringContextKeys.ACTIVE_PROFILES: @@ -32,7 +26,6 @@ export function getSpringContextData({ key: ctxKey, subject: ctxKey, value: data[ctxKey], - meta: meta?.[ctxKey]?.[''], }; } }); diff --git a/static/app/components/events/interfaces/frame/utils.tsx b/static/app/components/events/interfaces/frame/utils.tsx index 03bbb941d3ff..88b9dd54ce74 100644 --- a/static/app/components/events/interfaces/frame/utils.tsx +++ b/static/app/components/events/interfaces/frame/utils.tsx @@ -56,18 +56,16 @@ export function isExpandable({ registers, emptySourceNotation, platform, - isOnlyFrame, hasScmSourceContext, }: { frame: Frame; registers: StacktraceType['registers']; emptySourceNotation?: boolean; hasScmSourceContext?: boolean; - isOnlyFrame?: boolean; platform?: string; }) { return !!( - (!isOnlyFrame && emptySourceNotation) || + emptySourceNotation || hasContextSource(frame) || hasContextVars(frame) || hasContextRegisters(registers) || diff --git a/static/app/components/events/interfaces/spans/spanTreeModel.tsx b/static/app/components/events/interfaces/spans/spanTreeModel.tsx index 85bee5f6d308..7aa9793cd602 100644 --- a/static/app/components/events/interfaces/spans/spanTreeModel.tsx +++ b/static/app/components/events/interfaces/spans/spanTreeModel.tsx @@ -15,7 +15,6 @@ import type { SpanChildrenLookupType, SpanType, TraceBound, - TraceInfo, TreeDepthType, } from './types'; import type {SpanBoundsType, SpanGeneratedBoundsType} from './utils'; @@ -54,19 +53,15 @@ export class SpanTreeModel { // An entry in this set indicates that all siblings with the op and description should be left ungrouped expandedSiblingGroups = new Set(); - traceInfo: TraceInfo | undefined = undefined; - constructor( parentSpan: SpanType, childSpans: SpanChildrenLookupType, api: Client, - isRoot = false, - traceInfo?: TraceInfo + isRoot = false ) { this.api = api; this.span = parentSpan; this.isRoot = isRoot; - this.traceInfo = traceInfo; const spanID = getSpanID(parentSpan); const spanChildren = childSpans?.[spanID] ?? []; @@ -78,7 +73,7 @@ export class SpanTreeModel { delete childSpans[spanID]; this.children = spanChildren.map(span => { - return new SpanTreeModel(span, childSpans, api, false, this.traceInfo); + return new SpanTreeModel(span, childSpans, api); }); makeObservable(this, { @@ -781,10 +776,9 @@ export class SpanTreeModel { SpanSubTimingMark.HTTP_RESPONSE_START ); // Response start is a better approximation - const spanTimeOffset = - responseStart && !this.traceInfo - ? responseStart - parsedTrace.traceEndTimestamp - : this.span.start_timestamp - parsedTrace.traceStartTimestamp; + const spanTimeOffset = responseStart + ? responseStart - parsedTrace.traceEndTimestamp + : this.span.start_timestamp - parsedTrace.traceStartTimestamp; parsedTrace.traceStartTimestamp += spanTimeOffset; parsedTrace.traceEndTimestamp += spanTimeOffset; @@ -801,9 +795,7 @@ export class SpanTreeModel { const parsedRootSpan = new SpanTreeModel( rootSpan, parsedTrace.childSpans, - this.api, - false, - this.traceInfo + this.api ); this.embeddedChildren.push(parsedRootSpan); this.fetchEmbeddedChildrenState = 'idle'; @@ -838,12 +830,8 @@ export class SpanTreeModel { generateTraceBounds = (): TraceBound => { return { spanId: this.span.span_id, - traceStartTimestamp: this.traceInfo - ? this.traceInfo.startTimestamp - : this.span.start_timestamp, - traceEndTimestamp: this.traceInfo - ? this.traceInfo.endTimestamp - : this.span.timestamp, + traceStartTimestamp: this.span.start_timestamp, + traceEndTimestamp: this.span.timestamp, }; }; } diff --git a/static/app/components/events/interfaces/spans/types.tsx b/static/app/components/events/interfaces/spans/types.tsx index 42a9e0c9c68f..8b0b4f37f6ce 100644 --- a/static/app/components/events/interfaces/spans/types.tsx +++ b/static/app/components/events/interfaces/spans/types.tsx @@ -256,39 +256,3 @@ export type DescendantGroup = { group: SpanTreeModel[]; occurrence?: number; }; - -export type TraceInfo = { - /** - * The very latest end timestamp in the trace. - */ - endTimestamp: number; - /** - * The errors in the trace. - */ - errors: Set; - /** - * The maximum generation in the trace. - */ - maxGeneration: number; - /** - * The performance Issues on the trace - */ - performanceIssues: Set; - /** - * The projects in the trace - */ - projects: Set; - /** - * The very earliest start timestamp in the trace. - */ - startTimestamp: number; - /** - * The number of events that are not transactions, - * appearing as its own row in the trace view - */ - trailingOrphansCount: number; - /** - * The transactions in the trace. - */ - transactions: Set; -}; diff --git a/static/app/components/events/interfaces/spans/waterfallModel.tsx b/static/app/components/events/interfaces/spans/waterfallModel.tsx index e00d4c5b3fed..9a57b5d8957c 100644 --- a/static/app/components/events/interfaces/spans/waterfallModel.tsx +++ b/static/app/components/events/interfaces/spans/waterfallModel.tsx @@ -17,7 +17,6 @@ import type { ParsedTraceType, RawSpanType, TraceBound, - TraceInfo, } from './types'; import {boundsGenerator, generateRootSpan, getSpanID, parseTrace} from './utils'; @@ -39,25 +38,16 @@ export class WaterfallModel { hiddenSpanSubTrees: Set; traceBounds: TraceBound[]; focusedSpanIds: Set | undefined = undefined; - traceInfo: TraceInfo | undefined = undefined; - - constructor( - event: Readonly, - affectedSpanIds?: string[], - focusedSpanIds?: string[], - hiddenSpanSubTrees?: Set, - traceInfo?: TraceInfo - ) { + + constructor(event: Readonly) { this.event = event; - this.traceInfo = traceInfo; this.parsedTrace = parseTrace(event); const rootSpan = generateRootSpan(this.parsedTrace); this.rootSpan = new SpanTreeModel( rootSpan, this.parsedTrace.childSpans, this.api, - true, - traceInfo + true ); // Track the trace bounds of the current transaction and the trace bounds of @@ -68,20 +58,9 @@ export class WaterfallModel { // Set of span IDs whose sub-trees should be hidden. This is used for the // span tree toggling product feature. - this.hiddenSpanSubTrees = hiddenSpanSubTrees ?? new Set(); - - // When viewing the span waterfall from a Performance Issue, a set of span IDs may be provided - - this.affectedSpanIds = affectedSpanIds; - - if (affectedSpanIds || focusedSpanIds) { - affectedSpanIds ??= []; - focusedSpanIds ??= []; - this.focusedSpanIds = new Set([...affectedSpanIds, ...focusedSpanIds]); - } + this.hiddenSpanSubTrees = new Set(); - // If the set of span IDs is provided, this waterfall is for an embedded span tree - this.isEmbeddedSpanTree = !!this.focusedSpanIds; + this.isEmbeddedSpanTree = false; makeObservable(this, { parsedTrace: observable, @@ -296,15 +275,8 @@ export class WaterfallModel { viewEnd: number; viewStart: number; // in [0, 1] }) => { - const bounds = this.traceInfo - ? { - traceEndTimestamp: this.traceInfo.endTimestamp, - traceStartTimestamp: this.traceInfo.startTimestamp, - } - : this.getTraceBounds(); - return boundsGenerator({ - ...bounds, + ...this.getTraceBounds(), viewStart, viewEnd, }); diff --git a/static/app/components/forms/model.tsx b/static/app/components/forms/model.tsx index 328efe09872a..ec91a96dec94 100644 --- a/static/app/components/forms/model.tsx +++ b/static/app/components/forms/model.tsx @@ -410,17 +410,9 @@ export class FormModel { return (this.getError(id) || []).length === 0; } - doApiRequest({ - apiEndpoint, - apiMethod, - data, - }: { - data: Record; - apiEndpoint?: string; - apiMethod?: RequestMethod; - }) { - const endpoint = apiEndpoint || this.options.apiEndpoint || ''; - const method = apiMethod || this.options.apiMethod; + doApiRequest({data}: {data: Record}) { + const endpoint = this.options.apiEndpoint || ''; + const method = this.options.apiMethod; return this.api.requestPromise(endpoint, { method, @@ -430,19 +422,14 @@ export class FormModel { /** * Set the value of the form field - * if quiet is true, we skip callbacks, validations */ - setValue(id: string, value: FieldValue, {quiet}: {quiet?: boolean} = {}) { + setValue(id: string, value: FieldValue) { const transformInput = this.getDescriptor(id, 'transformInput'); const finalValue = typeof transformInput === 'function' ? transformInput(value) : value; this.fields.set(id, finalValue); - if (quiet) { - return; - } - if (this.options.onFieldChange) { this.options.onFieldChange(id, finalValue); } diff --git a/static/app/components/mentionInput/mentionInput.tsx b/static/app/components/mentionInput/mentionInput.tsx index 859cac4e4853..2cdf7297c28e 100644 --- a/static/app/components/mentionInput/mentionInput.tsx +++ b/static/app/components/mentionInput/mentionInput.tsx @@ -173,7 +173,7 @@ export function MentionInput({ }); const hasSuggestions = queryStatus === 'success' && suggestionCount > 0; - const updateActiveMention = (nextValue = value) => { + const updateActiveMention = () => { const input = inputRef.current; if (!input) { setActiveMention(null); @@ -182,7 +182,7 @@ export function MentionInput({ const selection = getEditorSelection(input); const nextActiveMention = selection - ? findActiveMention(nextValue, selection.start, selection.end, sources) + ? findActiveMention(value, selection.start, selection.end, sources) : null; const nextRequestKey = getRequestKey(nextActiveMention); setActiveMention( diff --git a/static/app/components/overrideOrDefault.tsx b/static/app/components/overrideOrDefault.tsx index 31c0392efcb6..6cbd8c793c84 100644 --- a/static/app/components/overrideOrDefault.tsx +++ b/static/app/components/overrideOrDefault.tsx @@ -1,5 +1,4 @@ import type {ComponentProps} from 'react'; -import {lazy, Suspense} from 'react'; import {getOverride} from 'sentry/overrideRegistry'; import type {OverrideName, Overrides} from 'sentry/types/overrides'; @@ -13,12 +12,6 @@ interface Params { * Component that will be shown if no hook is available */ defaultComponent?: ReturnType | (() => ReturnType); - /** - * This is a function that returns a promise (more specifically a function - * that returns the result of a dynamic import using `import()`. This will - * use React.Suspense and React.lazy to render the component. - */ - defaultComponentPromise?: () => Promise>; } /** @@ -40,25 +33,11 @@ interface Params { export function OverrideOrDefault({ overrideName, defaultComponent, - defaultComponentPromise, }: Params): React.FunctionComponent>> { type Props = ComponentProps>; // Defining the props here is unnecessary and slow for typescript function getDefaultComponent(): React.ComponentType | undefined { - if (defaultComponentPromise) { - // Lazy adds a complicated type that is not important - const DefaultComponent: React.ComponentType = lazy(defaultComponentPromise); - - return function (props: Props) { - return ( - - - - ); - }; - } - return defaultComponent; } diff --git a/static/app/components/profiling/flamegraph/collapsibleTimeline.tsx b/static/app/components/profiling/flamegraph/collapsibleTimeline.tsx index 4a7ec3084851..da445c90ecbe 100644 --- a/static/app/components/profiling/flamegraph/collapsibleTimeline.tsx +++ b/static/app/components/profiling/flamegraph/collapsibleTimeline.tsx @@ -49,10 +49,10 @@ function CollapsibleTimeline(props: CollapsibleTimelineProps) { const StyledButton = Button; -export function CollapsibleTimelineLoadingIndicator({size}: {size?: number}) { +export function CollapsibleTimelineLoadingIndicator() { return ( - + ); } diff --git a/static/app/components/profiling/flamegraph/interactions/useWheelCenterZoom.tsx b/static/app/components/profiling/flamegraph/interactions/useWheelCenterZoom.tsx index a96b81b9ff78..11f4f32a294e 100644 --- a/static/app/components/profiling/flamegraph/interactions/useWheelCenterZoom.tsx +++ b/static/app/components/profiling/flamegraph/interactions/useWheelCenterZoom.tsx @@ -9,12 +9,11 @@ import {getCenterScaleMatrixFromMousePosition} from 'sentry/utils/profiling/gl/u export function useWheelCenterZoom( canvas: FlamegraphCanvas | null, view: CanvasView | null, - canvasPoolManager: CanvasPoolManager, - disable = false + canvasPoolManager: CanvasPoolManager ) { const zoom = useCallback( (evt: WheelEvent) => { - if (!canvas || !view || disable) { + if (!canvas || !view) { return; } @@ -31,7 +30,7 @@ export function useWheelCenterZoom( view, ]); }, - [canvas, view, canvasPoolManager, disable] + [canvas, view, canvasPoolManager] ); return zoom; diff --git a/static/app/components/replays/canvasReplayerPlugin.tsx b/static/app/components/replays/canvasReplayerPlugin.tsx index 0a10d6820f43..4b57675764d4 100644 --- a/static/app/components/replays/canvasReplayerPlugin.tsx +++ b/static/app/components/replays/canvasReplayerPlugin.tsx @@ -198,14 +198,14 @@ export function canvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin { return cloneNode; } - async function preload(currentEvent?: eventWithTime, preloadCount = PRELOAD_SIZE) { + async function preload(currentEvent?: eventWithTime) { const foundIndex = nextPreloadIndex > -1 ? nextPreloadIndex : findIndex(canvasMutationEvents, currentEvent); const startIndex = foundIndex > -1 ? foundIndex : 0; const eventsToPreload = canvasMutationEvents - .slice(startIndex, startIndex + preloadCount) + .slice(startIndex, startIndex + PRELOAD_SIZE) .filter( ({timestamp}) => !currentEvent || timestamp - currentEvent.timestamp <= BUFFER_TIME diff --git a/static/app/components/searchQueryBuilder/tokens/filter/parsers/string/parser.tsx b/static/app/components/searchQueryBuilder/tokens/filter/parsers/string/parser.tsx index b76b8231400f..559f409dc5e5 100644 --- a/static/app/components/searchQueryBuilder/tokens/filter/parsers/string/parser.tsx +++ b/static/app/components/searchQueryBuilder/tokens/filter/parsers/string/parser.tsx @@ -1,7 +1,6 @@ import {parse} from 'sentry/components/searchQueryBuilder/tokens/filter/parsers/grammar.pegjs'; import { TokenConverter, - type SearchConfig, type Token, type TokenResult, } from 'sentry/components/searchSyntax/parser'; @@ -14,11 +13,10 @@ import { * - Does not disallow spaces or parens outside of quoted values */ export function parseMultiSelectFilterValue( - value: string, - config?: Partial + value: string ): TokenResult | null { try { - return parse(value, {TokenConverter, config, startRule: 'text_in_list'}); + return parse(value, {TokenConverter, startRule: 'text_in_list'}); } catch (e) { return null; } diff --git a/static/app/components/searchQueryBuilder/tokens/filter/utils.tsx b/static/app/components/searchQueryBuilder/tokens/filter/utils.tsx index ab501dba92e4..2670c5ab48a6 100644 --- a/static/app/components/searchQueryBuilder/tokens/filter/utils.tsx +++ b/static/app/components/searchQueryBuilder/tokens/filter/utils.tsx @@ -125,16 +125,13 @@ interface EscapeTagValueOptions { forceQuote?: boolean; } -export function escapeTagValue( - value: string, - options: EscapeTagValueOptions = {} -): string { +export function escapeTagValue(value: string): string { if (!value) { return ''; } // Wrap in quotes if there is a space or parens - const shouldEscape = shouldEscapeTagValue(value, options); + const shouldEscape = shouldEscapeTagValue(value); return shouldEscape ? `"${escapeDoubleQuotes(value)}"` : value; } diff --git a/static/app/components/searchQueryBuilder/tokens/freeText.tsx b/static/app/components/searchQueryBuilder/tokens/freeText.tsx index aeb6200ba66e..34d44544934c 100644 --- a/static/app/components/searchQueryBuilder/tokens/freeText.tsx +++ b/static/app/components/searchQueryBuilder/tokens/freeText.tsx @@ -119,13 +119,12 @@ function replaceFocusedWordWithFilter( value: string, cursorPosition: number, key: string, - getFieldDefinition: FieldDefinitionGetter, - operator?: TermOperator + getFieldDefinition: FieldDefinitionGetter ) { return replaceFocusedWord( value, cursorPosition, - getInitialFilterText(key, getFieldDefinition(key), operator) + getInitialFilterText(key, getFieldDefinition(key)) ); } diff --git a/static/app/components/seer/preferredAgentDropdownMenu.tsx b/static/app/components/seer/preferredAgentDropdownMenu.tsx index f5a57cbae0a4..417774bfcf19 100644 --- a/static/app/components/seer/preferredAgentDropdownMenu.tsx +++ b/static/app/components/seer/preferredAgentDropdownMenu.tsx @@ -2,7 +2,7 @@ import {useQuery} from '@tanstack/react-query'; import {Link} from '@sentry/scraps/link'; -import {DropdownMenu, type DropdownMenuProps} from 'sentry/components/dropdownMenu'; +import {DropdownMenu} from 'sentry/components/dropdownMenu'; import {DropdownMenuFooter} from 'sentry/components/dropdownMenu/footer'; import {t} from 'sentry/locale'; import {seerAgentIntegrationsSelectQueryOptions} from 'sentry/utils/seer/preferredAgent'; @@ -11,12 +11,10 @@ import {useOrganization} from 'sentry/utils/useOrganization'; export function PreferredAgentDropdownMenu({ isDisabled, - size = 'xs', onChange, }: { isDisabled: boolean; onChange: (value: AutofixAgentSelectOption) => void; - size?: DropdownMenuProps['size']; }) { const organization = useOrganization(); const {data: agentOptions = []} = useQuery( @@ -26,7 +24,7 @@ export function PreferredAgentDropdownMenu({ return ( ({ diff --git a/static/app/components/seer/stoppingPointDropdownMenu.tsx b/static/app/components/seer/stoppingPointDropdownMenu.tsx index dbb5c5c05366..5bb3d03863f2 100644 --- a/static/app/components/seer/stoppingPointDropdownMenu.tsx +++ b/static/app/components/seer/stoppingPointDropdownMenu.tsx @@ -1,7 +1,7 @@ import {Flex} from '@sentry/scraps/layout'; import {ExternalLink} from '@sentry/scraps/link'; -import {DropdownMenu, type DropdownMenuProps} from 'sentry/components/dropdownMenu'; +import {DropdownMenu} from 'sentry/components/dropdownMenu'; import {DropdownMenuFooter} from 'sentry/components/dropdownMenu/footer'; import {IconOpen} from 'sentry/icons/iconOpen'; import {t} from 'sentry/locale'; @@ -10,18 +10,16 @@ import type {SeerAutofixStoppingPoint} from 'sentry/utils/seer/types'; export function StoppingPointDropdownMenu({ isDisabled, - size = 'xs', onChange, }: { isDisabled: boolean; onChange: (value: SeerAutofixStoppingPoint) => void; - size?: DropdownMenuProps['size']; }) { const stoppingPointOptions = useStoppingPointSelectOptions(); return ( ({ key: option.value, diff --git a/static/app/components/timeRangeSelector/utils.tsx b/static/app/components/timeRangeSelector/utils.tsx index a6e1d5250806..ca319ae8d955 100644 --- a/static/app/components/timeRangeSelector/utils.tsx +++ b/static/app/components/timeRangeSelector/utils.tsx @@ -115,14 +115,11 @@ export function parseStatsPeriod( * @param relative Relative stats period * @return either one of the default "Last x days" string, "Other" if period is valid on the backend, or "Invalid period" otherwise */ -export function getRelativeSummary( - relative: string, - relativeOptions?: Record -): string { +export function getRelativeSummary(relative: string): string { try { const defaultRelativePeriodString = // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message - relativeOptions?.[relative] ?? DEFAULT_RELATIVE_PERIODS[relative]; + DEFAULT_RELATIVE_PERIODS[relative]; if (defaultRelativePeriodString) { return defaultRelativePeriodString; @@ -297,8 +294,6 @@ export const timeRangeAutoCompleteFilter = function ( options: { maxDateRange?: number; maxDays?: number; - supportedPeriods?: RelativeUnitsMapping; - supportedUnits?: RelativePeriodUnit[]; } ): TimeRangeItem[] { return _timeRangeAutoCompleteFilter(items, filterValue, { diff --git a/static/app/components/tours/useAssistant.tsx b/static/app/components/tours/useAssistant.tsx index e5a5420f8cce..2a1c89ab83b7 100644 --- a/static/app/components/tours/useAssistant.tsx +++ b/static/app/components/tours/useAssistant.tsx @@ -29,7 +29,6 @@ export function useAssistant( interface MutateAssistantData { guide: string; status: 'viewed' | 'dismissed' | 'restart'; - useful?: boolean; } // Matching the logic from src/sentry/api/endpoints/assistant.py diff --git a/static/app/data/platformCategories.tsx b/static/app/data/platformCategories.tsx index 45149023d54a..ae7a0cbe89f4 100644 --- a/static/app/data/platformCategories.tsx +++ b/static/app/data/platformCategories.tsx @@ -706,7 +706,7 @@ export const replayFrontendPlatforms: readonly PlatformKey[] = [ ]; // These are the mobile platforms that can set up replay. -export const replayMobilePlatforms: PlatformKey[] = [ +const replayMobilePlatforms: PlatformKey[] = [ 'android', 'apple-ios', 'react-native', diff --git a/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx b/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx index b35d288d4e11..78250017ea7d 100644 --- a/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx +++ b/static/app/gettingStartedDocs/javascript/agentMonitoring.tsx @@ -364,10 +364,8 @@ export function agentMonitoring({ packageName = '@sentry/browser', clientConfigFileName, serverConfigFileName, - minVersion = MIN_REQUIRED_VERSION, }: { clientConfigFileName?: string; - minVersion?: string; packageName?: `@sentry/${string}`; serverConfigFileName?: string; } = {}): OnboardingConfig { @@ -375,14 +373,14 @@ export function agentMonitoring({ introduction: params => ( ), install: params => getInstallStep(params, { packageName, - minVersion, + minVersion: MIN_REQUIRED_VERSION, }), configure: params => { const selected = getAgentIntegration(params); diff --git a/static/app/gettingStartedDocs/node/agentMonitoring.tsx b/static/app/gettingStartedDocs/node/agentMonitoring.tsx index 2548fd2bb044..6ed29243afbf 100644 --- a/static/app/gettingStartedDocs/node/agentMonitoring.tsx +++ b/static/app/gettingStartedDocs/node/agentMonitoring.tsx @@ -804,23 +804,21 @@ const text = lastMessage.content;`, export const agentMonitoring = ({ packageName = '@sentry/node', configFileName, - minVersion = MIN_REQUIRED_VERSION, }: { configFileName?: string; - minVersion?: string; packageName?: `@sentry/${string}`; } = {}): OnboardingConfig => ({ introduction: params => ( ), install: params => getInstallStep(params, { packageName, - minVersion, + minVersion: MIN_REQUIRED_VERSION, }), configure: params => { const selected = getAgentIntegration(params); diff --git a/static/app/gettingStartedDocs/node/utils.tsx b/static/app/gettingStartedDocs/node/utils.tsx index a52cef6c7f16..b7f3d4f70b34 100644 --- a/static/app/gettingStartedDocs/node/utils.tsx +++ b/static/app/gettingStartedDocs/node/utils.tsx @@ -111,11 +111,8 @@ function getProfilingImport(defaultMode?: 'esm' | 'cjs'): string { /** * Import Snippet for the Node and Serverless SDKs without other packages (like profiling). */ -export function getSentryImportSnippet( - packageName: `@sentry/${string}`, - defaultMode?: 'esm' | 'cjs' -): string { - return getImport(packageName, defaultMode).join('\n'); +export function getSentryImportSnippet(packageName: `@sentry/${string}`): string { + return getImport(packageName).join('\n'); } export function getImportInstrumentSnippet( diff --git a/static/app/gettingStartedDocs/python/logs.tsx b/static/app/gettingStartedDocs/python/logs.tsx index 7a520bfcb131..ca603ac37d0d 100644 --- a/static/app/gettingStartedDocs/python/logs.tsx +++ b/static/app/gettingStartedDocs/python/logs.tsx @@ -50,11 +50,7 @@ logger.error('Something went wrong')`, ], }); -export const logs = ({ - packageName = 'sentry-sdk', -}: { - packageName?: string; -} = {}): OnboardingConfig => ({ +export const logs = (): OnboardingConfig => ({ install: () => [ { type: StepType.INSTALL, @@ -69,7 +65,7 @@ export const logs = ({ ), }, getPythonInstallCodeBlock({ - packageName, + packageName: 'sentry-sdk', minimumVersion: '2.35.0', }), ], diff --git a/static/app/gettingStartedDocs/python/profiling.tsx b/static/app/gettingStartedDocs/python/profiling.tsx index ac33e7b2fdae..74bf4b146588 100644 --- a/static/app/gettingStartedDocs/python/profiling.tsx +++ b/static/app/gettingStartedDocs/python/profiling.tsx @@ -96,10 +96,8 @@ export const alternativeProfiling = (params: DocsParams): ContentBlock => ({ }); export const profiling = ({ - basePackage = 'sentry-sdk', traceLifecycle = 'trace', }: { - basePackage?: string; traceLifecycle?: 'manual' | 'trace'; } = {}): OnboardingConfig => ({ install: () => [ @@ -116,7 +114,7 @@ export const profiling = ({ ), }, getPythonInstallCodeBlock({ - packageName: basePackage, + packageName: 'sentry-sdk', minimumVersion: '2.24.1', }), ], diff --git a/static/app/stores/guideStore.tsx b/static/app/stores/guideStore.tsx index ea1bd88dc086..0a086290d67a 100644 --- a/static/app/stores/guideStore.tsx +++ b/static/app/stores/guideStore.tsx @@ -93,7 +93,7 @@ interface GuideStoreDefinition extends StrictStoreDefinition { setForceHide(forceHide: boolean): void; teardown(): void; unregisterAnchor(target: string): void; - updateCurrentGuide(dismissed?: boolean): void; + updateCurrentGuide(): void; updatePrevGuide(nextGuide: Guide | null): void; } @@ -249,7 +249,7 @@ const storeConfig: GuideStoreDefinition = { * - If the user has already seen the guide, don't show the guide * - Otherwise show the guide */ - updateCurrentGuide(dismissed?: boolean) { + updateCurrentGuide() { const {anchors, guides, forceShow} = this.state; let guideOptions = guides @@ -298,7 +298,7 @@ const storeConfig: GuideStoreDefinition = { this.state = {...this.state, currentGuide: nextGuide, currentStep}; this.trigger(this.state); - getOverride('callback:on-guide-update')?.(nextGuide, {dismissed}); + getOverride('callback:on-guide-update')?.(nextGuide, {dismissed: undefined}); }, }; diff --git a/static/app/stores/onboardingDrawerStore.tsx b/static/app/stores/onboardingDrawerStore.tsx index 14a0a96b9e49..02c0157e16db 100644 --- a/static/app/stores/onboardingDrawerStore.tsx +++ b/static/app/stores/onboardingDrawerStore.tsx @@ -5,7 +5,7 @@ import type {StrictStoreDefinition} from './types'; type ActivePanelType = Readonly; interface OnboardingDrawerStoreDefinition extends StrictStoreDefinition { - close(hash?: string): void; + close(): void; open(panel: OnboardingDrawerKey): void; toggle(panel: OnboardingDrawerKey): void; @@ -43,13 +43,8 @@ const storeConfig: OnboardingDrawerStoreDefinition = { } }, - close(hash?: string) { + close() { this.state = ''; - - if (hash) { - window.location.hash = window.location.hash.replace(`#${hash}`, ''); - } - this.trigger(this.state); }, diff --git a/static/app/utils/analytics/makeAnalyticsFunction.tsx b/static/app/utils/analytics/makeAnalyticsFunction.tsx index f67f20477211..8243cf07a9f2 100644 --- a/static/app/utils/analytics/makeAnalyticsFunction.tsx +++ b/static/app/utils/analytics/makeAnalyticsFunction.tsx @@ -24,7 +24,6 @@ type Options = Parameters[1]; * Generates functions used to track an event for analytics. * Each function can only handle the event types specified by the * generic for EventParameters and the events in eventKeyToNameMap. - * Can specifcy default options with the defaultOptions argument as well. * Can make orgnization required with the second generic. */ export function makeAnalyticsFunction< @@ -32,10 +31,7 @@ export function makeAnalyticsFunction< // This is used to provide a nice curried type for consumers. // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters OrgRequirement extends OptionalOrg = OptionalOrg, ->( - eventKeyToNameMap: Record, - defaultOptions?: Options -) { +>(eventKeyToNameMap: Record) { /** * Function used for analytics of specifc types determined from factory function * Uses the current session ID or generates a new one if startSession == true. @@ -60,8 +56,7 @@ export function makeAnalyticsFunction< } // only apply options if required to make mock assertions easier - if (options || defaultOptions) { - options = {...defaultOptions, ...options}; + if (options) { rawTrackAnalyticsEvent(params, options); } else { rawTrackAnalyticsEvent(params); diff --git a/static/app/utils/discover/charts.tsx b/static/app/utils/discover/charts.tsx index 228e0f736cd3..622a05fb667b 100644 --- a/static/app/utils/discover/charts.tsx +++ b/static/app/utils/discover/charts.tsx @@ -33,13 +33,12 @@ import {categorizeDuration} from './categorizeDuration'; */ export function tooltipFormatter( value: number | null, - outputType: AggregationOutputType = 'number', - unit?: DataUnit + outputType: AggregationOutputType = 'number' ): string { if (!defined(value)) { return '\u2014'; } - return tooltipFormatterUsingAggregateOutputType(value, outputType, unit); + return tooltipFormatterUsingAggregateOutputType(value, outputType); } /** @@ -95,19 +94,13 @@ export function axisLabelFormatter( value: number, outputType: AggregationOutputType, abbreviation = false, - durationUnit?: number, - rateUnit?: RateUnit, - decimalPlaces?: number, - sizeUnit?: DataUnit + durationUnit?: number ): string { return axisLabelFormatterUsingAggregateOutputType( value, outputType, abbreviation, - durationUnit, - rateUnit, - decimalPlaces, - sizeUnit + durationUnit ); } diff --git a/static/app/utils/discover/eventView.tsx b/static/app/utils/discover/eventView.tsx index 0c865e8a154a..cb8c3e1993c6 100644 --- a/static/app/utils/discover/eventView.tsx +++ b/static/app/utils/discover/eventView.tsx @@ -142,12 +142,8 @@ function getSortKeyFromField( return getSortField(fieldString, tableMeta); } -export function isFieldSortable( - field: Field, - tableMeta?: MetaType, - useFunctionFormat?: boolean -): boolean { - return !!getSortKeyFromField(field, tableMeta, useFunctionFormat); +export function isFieldSortable(field: Field, tableMeta?: MetaType): boolean { + return !!getSortKeyFromField(field, tableMeta); } const decodeFields = (location: Location): Field[] => { diff --git a/static/app/utils/discover/urls.tsx b/static/app/utils/discover/urls.tsx index a2c9d1891262..2aaed6ff7809 100644 --- a/static/app/utils/discover/urls.tsx +++ b/static/app/utils/discover/urls.tsx @@ -107,12 +107,10 @@ export function eventDetailsRouteWithEventView({ organization, eventSlug, eventView, - isHomepage, }: { eventSlug: string; eventView: EventView; organization: Organization; - isHomepage?: boolean; }) { const pathname = eventDetailsRoute({ organization, @@ -121,7 +119,7 @@ export function eventDetailsRouteWithEventView({ return { pathname, - query: {...eventView.generateQueryStringObject(), homepage: isHomepage}, + query: {...eventView.generateQueryStringObject()}, }; } diff --git a/static/app/utils/integrationUtil.tsx b/static/app/utils/integrationUtil.tsx index c6d08870e4bb..eb192aa11621 100644 --- a/static/app/utils/integrationUtil.tsx +++ b/static/app/utils/integrationUtil.tsx @@ -270,19 +270,16 @@ export const getIntegrationSourceUrl = ( } }; -export function getCodeOwnerIcon( - provider: CodeOwner['provider'], - iconSize: SVGIconProps['size'] = 'md' -) { +export function getCodeOwnerIcon(provider: CodeOwner['provider']) { switch (provider ?? '') { case 'github': - return ; + return ; case 'gitlab': - return ; + return ; case 'perforce': - return ; + return ; default: - return ; + return ; } } /** diff --git a/static/app/utils/performance/contexts/metricsEnhancedPerformanceDataContext.tsx b/static/app/utils/performance/contexts/metricsEnhancedPerformanceDataContext.tsx index f5d6ff53c6bf..91eddcaa5280 100644 --- a/static/app/utils/performance/contexts/metricsEnhancedPerformanceDataContext.tsx +++ b/static/app/utils/performance/contexts/metricsEnhancedPerformanceDataContext.tsx @@ -71,7 +71,7 @@ export function MEPDataProvider({ // co-located since a local provider doesn't work in that case. interface PerformanceDataMultipleMetaContext { metricsExtractedDataMap: ExtractedDataMap; - setIsMetricsExtractedData: (mapKey: MetricsResultsMetaMapKey, value?: boolean) => void; + setIsMetricsExtractedData: (mapKey: MetricsResultsMetaMapKey, value: boolean) => void; } const MetricsResultsMetaContext = createContext< @@ -86,7 +86,7 @@ export function MetricsResultsMetaProvider({children}: {children: ReactNode}) { const [metricsExtractedDataMap, _setMetricsExtractedDataMap] = useState(new Map()); const setIsMetricsExtractedData = useCallback( - (mapKey: MetricsResultsMetaMapKey, value?: boolean) => { + (mapKey: MetricsResultsMetaMapKey, value: boolean) => { if (mapKey.id) { metricsExtractedDataMap.set(mapKey.id, value); } diff --git a/static/app/utils/performance/contexts/metricsEnhancedSetting.tsx b/static/app/utils/performance/contexts/metricsEnhancedSetting.tsx index 7b624c6be79a..6ac99500c341 100644 --- a/static/app/utils/performance/contexts/metricsEnhancedSetting.tsx +++ b/static/app/utils/performance/contexts/metricsEnhancedSetting.tsx @@ -73,11 +73,9 @@ export function canUseMetricsData(organization: Organization) { export function MEPSettingProvider({ children, location, - _hasMEPState, forceTransactions, }: { children: ReactNode; - _hasMEPState?: MEPState; forceTransactions?: boolean; location?: Location; }) { @@ -99,8 +97,6 @@ export function MEPSettingProvider({ const metricSettingFromParam = allowedStates.find(s => s === _metricSettingFromParam) ?? defaultMetricsState; - const isControlledMEP = _hasMEPState !== undefined; - const [_metricSettingState, _setMetricSettingState] = useReducer( (_: MEPState, next: MEPState) => next, metricSettingFromParam @@ -131,7 +127,7 @@ export function MEPSettingProvider({ AutoSampleState.UNSET ); - const metricSettingState = isControlledMEP ? _hasMEPState : _metricSettingState; + const metricSettingState = _metricSettingState; const shouldQueryProvideMEPAutoParams = canUseMEP && metricSettingState === MEPState.AUTO; diff --git a/static/app/utils/performance/histogram/utils.tsx b/static/app/utils/performance/histogram/utils.tsx index 6b9363e5b63a..3d96fdd23205 100644 --- a/static/app/utils/performance/histogram/utils.tsx +++ b/static/app/utils/performance/histogram/utils.tsx @@ -25,19 +25,17 @@ export function computeBuckets(data: HistogramData) { export function formatHistogramData( data: HistogramData, { - precision, type, additionalFieldsFn, }: { additionalFieldsFn?: any; - precision?: number; type?: ColumnType; } = {} ) { const formatter = (value: number): string => { switch (type) { case 'duration': { - const decimalPlaces = precision ?? (value < 1000 ? 0 : 3); + const decimalPlaces = value < 1000 ? 0 : 3; return getDuration(value / 1000, decimalPlaces, true); } case 'number': { @@ -45,7 +43,7 @@ export function formatHistogramData( // have the same label, if the number of bins doesn't visually match what is // expected, check that this rounding is correct. If this issue persists, // consider formatting the bin as a string in the response - const factor = 10 ** (precision ?? 0); + const factor = 10 ** 0; return (Math.round((value + Number.EPSILON) * factor) / factor).toLocaleString(); } default: diff --git a/static/app/utils/profiling/canvasView.tsx b/static/app/utils/profiling/canvasView.tsx index 06b6797275b0..e9716b8d7257 100644 --- a/static/app/utils/profiling/canvasView.tsx +++ b/static/app/utils/profiling/canvasView.tsx @@ -166,7 +166,6 @@ export class CanvasView { configView: Rect, overrides?: { width: {max?: number; min?: number}; - height?: {max?: number; min?: number}; } ) { this.configView = computeClampedConfigView(configView, { @@ -178,7 +177,6 @@ export class CanvasView { height: { min: this.minHeight, max: this.configSpace.height, - ...overrides?.height, }, }); } diff --git a/static/app/utils/profiling/hooks/useProfileEventsStats.tsx b/static/app/utils/profiling/hooks/useProfileEventsStats.tsx index dc7021054fd5..03d701487347 100644 --- a/static/app/utils/profiling/hooks/useProfileEventsStats.tsx +++ b/static/app/utils/profiling/hooks/useProfileEventsStats.tsx @@ -13,19 +13,15 @@ interface UseProfileEventsStatsOptions { referrer: string; yAxes: readonly F[]; datetime?: PageFilterDatetime; - enabled?: boolean; - interval?: string; query?: string; } export function useProfileEventsStats({ dataset, datetime, - interval, query, referrer, yAxes, - enabled = true, }: UseProfileEventsStatsOptions) { const organization = useOrganization(); const {selection} = usePageFilters(); @@ -50,13 +46,11 @@ export function useProfileEventsStats({ environment: selection.environments, ...normalizeDateTimeParams(datetime ?? selection.datetime), yAxis: yAxes, - interval, query, partial: 1, }, staleTime: Infinity, }), - enabled, }); const transformed = useMemo( diff --git a/static/app/utils/profiling/hooks/useProfileFunctionTrends.tsx b/static/app/utils/profiling/hooks/useProfileFunctionTrends.tsx index c8d58293b848..eda5f645faf9 100644 --- a/static/app/utils/profiling/hooks/useProfileFunctionTrends.tsx +++ b/static/app/utils/profiling/hooks/useProfileFunctionTrends.tsx @@ -2,7 +2,6 @@ import {useQuery} from '@tanstack/react-query'; import {normalizeDateTimeParams} from 'sentry/components/pageFilters/parse'; import {usePageFilters} from 'sentry/components/pageFilters/usePageFilters'; -import type {PageFilterDatetime} from 'sentry/types/core'; import {apiOptions, selectJsonWithHeaders} from 'sentry/utils/api/apiOptions'; import {useOrganization} from 'sentry/utils/useOrganization'; @@ -12,22 +11,14 @@ interface UseProfileFunctionTrendsOptions { trendFunction: 'p50()' | 'p75()' | 'p95()' | 'p99()'; trendType: TrendType; cursor?: string; - datetime?: PageFilterDatetime; - enabled?: boolean; limit?: number; - projects?: Array; query?: string; - refetchOnMount?: boolean; } export function useProfileFunctionTrends({ cursor, - datetime, - projects, - enabled, limit, query, - refetchOnMount, trendFunction, trendType, }: UseProfileFunctionTrendsOptions) { @@ -40,9 +31,9 @@ export function useProfileFunctionTrends({ { path: {organizationIdOrSlug: organization.slug}, query: { - project: projects || selection.projects, + project: selection.projects, environment: selection.environments, - ...normalizeDateTimeParams(datetime ?? selection.datetime), + ...normalizeDateTimeParams(selection.datetime), function: trendFunction, trend: trendType, query, @@ -54,8 +45,6 @@ export function useProfileFunctionTrends({ ), select: selectJsonWithHeaders, refetchOnWindowFocus: false, - refetchOnMount, retry: false, - enabled, }); } diff --git a/static/app/utils/profiling/hooks/useProfileFunctions.tsx b/static/app/utils/profiling/hooks/useProfileFunctions.tsx index c00b75fb9f37..ae30253f489b 100644 --- a/static/app/utils/profiling/hooks/useProfileFunctions.tsx +++ b/static/app/utils/profiling/hooks/useProfileFunctions.tsx @@ -18,7 +18,6 @@ interface UseProfileFunctionsOptions { limit?: number; projects?: Array; query?: string; - refetchOnMount?: boolean; } export function useProfileFunctionsOptions({ @@ -60,7 +59,6 @@ export function useProfileFunctionsOptions({ export function useProfileFunctions({ enabled, - refetchOnMount, ...rest }: UseProfileFunctionsOptions) { const options = useProfileFunctionsOptions(rest); @@ -68,7 +66,6 @@ export function useProfileFunctions({ return useQuery({ ...options, refetchOnWindowFocus: false, - refetchOnMount, retry: false, enabled, }); diff --git a/static/app/utils/profiling/hooks/useProfileTopEventsStats.tsx b/static/app/utils/profiling/hooks/useProfileTopEventsStats.tsx index 03e64c78d823..cca96d4b53f0 100644 --- a/static/app/utils/profiling/hooks/useProfileTopEventsStats.tsx +++ b/static/app/utils/profiling/hooks/useProfileTopEventsStats.tsx @@ -3,7 +3,7 @@ import {useQuery} from '@tanstack/react-query'; import {normalizeDateTimeParams} from 'sentry/components/pageFilters/parse'; import {usePageFilters} from 'sentry/components/pageFilters/usePageFilters'; -import type {PageFilters, PageFilterDatetime} from 'sentry/types/core'; +import type {PageFilters} from 'sentry/types/core'; import type {EventsStatsSeries} from 'sentry/types/organization'; import {apiOptions} from 'sentry/utils/api/apiOptions'; import {defined} from 'sentry/utils/defined'; @@ -17,18 +17,14 @@ interface UseProfileTopEventsStatsOptions { referrer: string; topEvents: number; yAxes: readonly F[]; - datetime?: PageFilterDatetime; enabled?: boolean; - interval?: string; projects?: PageFilters['projects']; query?: string; } export function useProfileTopEventsStats({ dataset, - datetime, fields, - interval, others, query, projects, @@ -49,9 +45,8 @@ export function useProfileTopEventsStats({ referrer, project: projects ?? selection.projects, environment: selection.environments, - ...normalizeDateTimeParams(datetime ?? selection.datetime), + ...normalizeDateTimeParams(selection.datetime), yAxis: yAxes, - interval, query, topEvents, excludeOther: others ? '0' : '1', diff --git a/static/app/utils/profiling/renderers/sampleTickRenderer.tsx b/static/app/utils/profiling/renderers/sampleTickRenderer.tsx index 0cb8461672df..b0a7ec1d3dd9 100644 --- a/static/app/utils/profiling/renderers/sampleTickRenderer.tsx +++ b/static/app/utils/profiling/renderers/sampleTickRenderer.tsx @@ -48,11 +48,7 @@ class SampleTickRenderer { this.context = getContext(canvas, '2d'); } - draw( - configViewToPhysicalSpace: mat3, - configView: Rect, - context: CanvasRenderingContext2D = this.context - ): void { + draw(configViewToPhysicalSpace: mat3, configView: Rect): void { if (this.intervals.length === 0) { return; } @@ -62,8 +58,8 @@ class SampleTickRenderer { this.theme.SIZES.LABEL_FONT_PADDING * window.devicePixelRatio * 2 - this.theme.SIZES.LABEL_FONT_PADDING; - context.strokeStyle = `rgba(${this.theme.COLORS.SAMPLE_TICK_COLOR.join(',')})`; - context.lineWidth = this.theme.SIZES.INTERNAL_SAMPLE_TICK_LINE_WIDTH; + this.context.strokeStyle = `rgba(${this.theme.COLORS.SAMPLE_TICK_COLOR.join(',')})`; + this.context.lineWidth = this.theme.SIZES.INTERNAL_SAMPLE_TICK_LINE_WIDTH; for (const interval of this.intervals) { if (interval < configView.left) { @@ -79,7 +75,7 @@ class SampleTickRenderer { interval * configViewToPhysicalSpace[0] + configViewToPhysicalSpace[6] ); - context.strokeRect(physicalIntervalPosition, 0, 0, height); + this.context.strokeRect(physicalIntervalPosition, 0, 0, height); } } } diff --git a/static/app/utils/profiling/renderers/selectedFrameRenderer.tsx b/static/app/utils/profiling/renderers/selectedFrameRenderer.tsx index 9e941e351395..a86ad42845e9 100644 --- a/static/app/utils/profiling/renderers/selectedFrameRenderer.tsx +++ b/static/app/utils/profiling/renderers/selectedFrameRenderer.tsx @@ -12,25 +12,22 @@ class SelectedFrameRenderer { this.context = getContext(canvas, '2d'); } - // We allow for passing of different contexts, this allows us to use a - // single instance of the renderer to draw overlays on multiple canvases draw( frames: Rect[], style: {BORDER_COLOR: string; BORDER_WIDTH: number}, - configViewToPhysicalSpace: mat3, - context: CanvasRenderingContext2D = this.context + configViewToPhysicalSpace: mat3 ): void { - context.strokeStyle = style.BORDER_COLOR; - context.lineWidth = style.BORDER_WIDTH; + this.context.strokeStyle = style.BORDER_COLOR; + this.context.lineWidth = style.BORDER_WIDTH; for (const frame of frames) { const frameInPhysicalSpace = frame.transformRect(configViewToPhysicalSpace); - context.beginPath(); + this.context.beginPath(); // We draw the border in the center of the flamegraph, so we need to decrease // the width by border width and negatively offset it by half the border width - context.strokeRect( + this.context.strokeRect( frameInPhysicalSpace.x + style.BORDER_WIDTH, frameInPhysicalSpace.y + style.BORDER_WIDTH, frameInPhysicalSpace.width - style.BORDER_WIDTH * 2, diff --git a/static/app/utils/profiling/routes.tsx b/static/app/utils/profiling/routes.tsx index ca0bfa4ba2bd..4be0473ff88b 100644 --- a/static/app/utils/profiling/routes.tsx +++ b/static/app/utils/profiling/routes.tsx @@ -143,14 +143,12 @@ export function generateProfileRouteFromProfileReference({ frameName, framePackage, reference, - query, }: { organization: Organization; projectSlug: Project['slug']; reference: Profiling.BaseProfileReference | Profiling.ProfileReference; frameName?: string; framePackage?: string; - query?: Location['query']; }): LocationDescriptor { if (typeof reference === 'string') { return generateProfileFlamechartRouteWithQuery({ @@ -158,7 +156,6 @@ export function generateProfileRouteFromProfileReference({ projectSlug, profileId: reference, query: { - ...query, frameName, framePackage, }, @@ -179,7 +176,6 @@ export function generateProfileRouteFromProfileReference({ start: new Date(Math.floor(reference.start * 1e3)).toISOString(), end: new Date(Math.ceil(reference.end * 1e3)).toISOString(), query: dropUndefinedKeys({ - ...query, frameName, framePackage, eventId, @@ -193,7 +189,7 @@ export function generateProfileRouteFromProfileReference({ organization, projectSlug, profileId: reference.profile_id, - query: dropUndefinedKeys({...query, frameName, framePackage}), + query: dropUndefinedKeys({frameName, framePackage}), }); } diff --git a/static/app/utils/queryClient.tsx b/static/app/utils/queryClient.tsx index 55b70a73f84d..3c550904b2f3 100644 --- a/static/app/utils/queryClient.tsx +++ b/static/app/utils/queryClient.tsx @@ -1,7 +1,6 @@ import type { QueryClient, QueryClientConfig, - SetDataOptions, Updater, UseQueryOptions, UseQueryResult, @@ -122,8 +121,7 @@ export function getApiQueryData( export function setApiQueryData( queryClient: QueryClient, queryKey: ApiQueryKey, - updater: Updater, - options?: SetDataOptions + updater: Updater ): TResponseData | undefined { // eslint-disable-next-line @sentry/no-query-data-type-parameters const updateResult = queryClient.setQueryData>( @@ -139,8 +137,7 @@ export function setApiQueryData( return previous; } return {json: newData, headers: previous?.headers ?? {}}; - }, - options + } ); return updateResult?.json; diff --git a/static/app/utils/repositories/repoQueryOptions.ts b/static/app/utils/repositories/repoQueryOptions.ts index 7bfd6f2966c5..81a7493da0d6 100644 --- a/static/app/utils/repositories/repoQueryOptions.ts +++ b/static/app/utils/repositories/repoQueryOptions.ts @@ -53,7 +53,6 @@ export function organizationRepositoriesInfiniteOptions({ export function organizationRepositoriesWithSettingsInfiniteOptions({ organization, query, - staleTime, }: { organization: Organization; query?: { @@ -64,7 +63,6 @@ export function organizationRepositoriesWithSettingsInfiniteOptions({ sort?: Sort; status?: 'active' | 'deleted'; }; - staleTime?: number; }) { const sortQuery = query?.sort ? encodeSort(query.sort) : undefined; return apiOptions.asInfinite()( @@ -72,7 +70,7 @@ export function organizationRepositoriesWithSettingsInfiniteOptions({ { path: {organizationIdOrSlug: organization.slug}, query: {expand: 'settings', per_page: 100, ...query, sort: sortQuery}, - staleTime: staleTime ?? 0, + staleTime: 0, } ); } diff --git a/static/app/utils/timeSeries/determineSeriesConfidence.tsx b/static/app/utils/timeSeries/determineSeriesConfidence.tsx index 5be036963f81..d81618447a13 100644 --- a/static/app/utils/timeSeries/determineSeriesConfidence.tsx +++ b/static/app/utils/timeSeries/determineSeriesConfidence.tsx @@ -4,10 +4,7 @@ import type {TimeSeries} from 'sentry/views/dashboards/widgets/common/types'; // Timeseries with more than this ratio of low confidence intervals will be considered low confidence const LOW_CONFIDENCE_THRESHOLD = 0.25; -export function determineTimeSeriesConfidence( - timeSeries: TimeSeries, - threshold = LOW_CONFIDENCE_THRESHOLD -): Confidence { +export function determineTimeSeriesConfidence(timeSeries: TimeSeries): Confidence { const {lowConfidence, highConfidence, nullConfidence} = timeSeries.values.reduce( (acc, item) => { if (item.confidence === 'low') { @@ -22,7 +19,12 @@ export function determineTimeSeriesConfidence( {lowConfidence: 0, highConfidence: 0, nullConfidence: 0} ); - return finalConfidence(lowConfidence, highConfidence, nullConfidence, threshold); + return finalConfidence( + lowConfidence, + highConfidence, + nullConfidence, + LOW_CONFIDENCE_THRESHOLD + ); } function finalConfidence( diff --git a/static/app/utils/tokenizeSearch.tsx b/static/app/utils/tokenizeSearch.tsx index bdc67b1a4062..0053c0ba1256 100644 --- a/static/app/utils/tokenizeSearch.tsx +++ b/static/app/utils/tokenizeSearch.tsx @@ -362,7 +362,7 @@ export class MutableSearch { * Adds the filter values separated by OR operators. This is in contrast to * addFilterValues, which implicitly separates each filter value with an AND operator. */ - addDisjunctionFilterValues(key: string, values: string[], shouldEscape = true) { + addDisjunctionFilterValues(key: string, values: string[]) { if (values.length === 0) { return this; } @@ -372,7 +372,7 @@ export class MutableSearch { if (i > 0) { this.addOp('OR'); } - this.addFilterValue(key, values[i]!, shouldEscape); + this.addFilterValue(key, values[i]!, true); } this.addOp(')'); return this; diff --git a/static/app/utils/useCommitters.tsx b/static/app/utils/useCommitters.tsx index 5422578c5ed0..5a62c30c4374 100644 --- a/static/app/utils/useCommitters.tsx +++ b/static/app/utils/useCommitters.tsx @@ -2,7 +2,6 @@ import type {Group} from 'sentry/types/group'; import type {Committer} from 'sentry/types/integrations'; import type {ApiQueryKey} from 'sentry/utils/api/apiQueryKey'; import {getApiUrl} from 'sentry/utils/api/getApiUrl'; -import type {UseApiQueryOptions} from 'sentry/utils/queryClient'; import {useApiQuery} from 'sentry/utils/queryClient'; import {usePrevious} from 'sentry/utils/usePrevious'; @@ -35,10 +34,7 @@ const makeCommittersQueryKey = ( ), ]; -export function useCommitters( - {eventId, projectSlug, group}: UseCommittersProps, - options: Partial> = {} -) { +export function useCommitters({eventId, projectSlug, group}: UseCommittersProps) { const org = useOrganization(); const previousGroupId = usePrevious(group.id); return useApiQuery( @@ -50,7 +46,6 @@ export function useCommitters( placeholderData: previousData => { return group.id === previousGroupId ? previousData : undefined; }, - ...options, } ); } diff --git a/static/app/utils/useIssueEventOwners.tsx b/static/app/utils/useIssueEventOwners.tsx index 2331edaef78c..93c258bba588 100644 --- a/static/app/utils/useIssueEventOwners.tsx +++ b/static/app/utils/useIssueEventOwners.tsx @@ -1,6 +1,5 @@ import type {ApiQueryKey} from 'sentry/utils/api/apiQueryKey'; import {getApiUrl} from 'sentry/utils/api/getApiUrl'; -import type {UseApiQueryOptions} from 'sentry/utils/queryClient'; import {useApiQuery} from 'sentry/utils/queryClient'; import {useOrganization} from 'sentry/utils/useOrganization'; import type {EventOwners} from 'sentry/views/issueDetails/header/getOwnerList'; @@ -24,10 +23,7 @@ const makeCommittersQueryKey = ( }), ]; -export function useIssueEventOwners( - {eventId, projectSlug}: UseIssueEventOwnersProps, - options: Partial> = {} -) { +export function useIssueEventOwners({eventId, projectSlug}: UseIssueEventOwnersProps) { const org = useOrganization(); return useApiQuery( makeCommittersQueryKey(org.slug, projectSlug, eventId), @@ -35,7 +31,6 @@ export function useIssueEventOwners( staleTime: Infinity, retry: false, enabled: !!eventId, - ...options, } ); } diff --git a/static/app/utils/useTeams.tsx b/static/app/utils/useTeams.tsx index e94ee93feeb1..0992d130c4fc 100644 --- a/static/app/utils/useTeams.tsx +++ b/static/app/utils/useTeams.tsx @@ -84,7 +84,6 @@ type Options = { type FetchTeamOptions = { cursor?: State['nextCursor']; - ids?: string[]; lastSearch?: State['lastSearch']; limit?: Options['limit']; search?: State['lastSearch']; @@ -98,7 +97,7 @@ type FetchTeamOptions = { async function fetchTeams( api: Client, orgId: string, - {slugs, ids, search, limit, lastSearch, cursor}: FetchTeamOptions = {} + {slugs, search, limit, lastSearch, cursor}: FetchTeamOptions = {} ) { const query: { cursor?: typeof cursor; @@ -110,10 +109,6 @@ async function fetchTeams( query.query = slugs.map(slug => `slug:${slug}`).join(' '); } - if (ids !== undefined && ids.length > 0) { - query.query = ids.map(id => `id:${id}`).join(' '); - } - if (search) { query.query = `${query.query ?? ''} ${search}`.trim(); } diff --git a/static/app/utils/withApi.tsx b/static/app/utils/withApi.tsx index 95219adb9565..ff2c05e05bd1 100644 --- a/static/app/utils/withApi.tsx +++ b/static/app/utils/withApi.tsx @@ -18,11 +18,10 @@ type WrappedProps

= Omit & Partial( - WrappedComponent: React.ComponentType

, - options: Parameters[0] = {} + WrappedComponent: React.ComponentType

) => { function WithApi({api: propsApi, ...props}: WrappedProps

) { - const api = useApi({api: propsApi, ...options}); + const api = useApi({api: propsApi}); // TODO(any): HoC prop types not working w/ emotion https://github.com/emotion-js/emotion/issues/3261 return ; diff --git a/static/app/views/alerts/wizard/utils.tsx b/static/app/views/alerts/wizard/utils.tsx index f0e0993d34f0..9e375a83a4e2 100644 --- a/static/app/views/alerts/wizard/utils.tsx +++ b/static/app/views/alerts/wizard/utils.tsx @@ -1,13 +1,7 @@ import type {Organization} from 'sentry/types/organization'; -import { - Dataset, - EventTypes, - SessionsAggregate, -} from 'sentry/views/alerts/rules/metric/types'; +import {Dataset, SessionsAggregate} from 'sentry/views/alerts/rules/metric/types'; import {isLogsEnabled} from 'sentry/views/explore/logs/isLogsEnabled'; import {canUseMetricsAlertsUI} from 'sentry/views/explore/metrics/metricsFlags'; -import {TraceItemDataset} from 'sentry/views/explore/types'; -import {deprecateTransactionAlerts} from 'sentry/views/insights/common/utils/hasEAPAlerts'; import type {MetricAlertType, WizardRuleTemplate} from './options'; @@ -62,12 +56,7 @@ const alertTypeIdentifiers: Record< export function getAlertTypeFromAggregateDataset({ aggregate, dataset, - eventTypes, - organization, -}: Pick & { - eventTypes?: EventTypes[]; - organization?: Organization; -}): MetricAlertType { +}: Pick): MetricAlertType { // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message const identifierForDataset = alertTypeIdentifiers[dataset]; const matchingAlertTypeEntry = Object.entries(identifierForDataset).find( @@ -77,24 +66,6 @@ export function getAlertTypeFromAggregateDataset({ matchingAlertTypeEntry && (matchingAlertTypeEntry[0] as MetricAlertType); if (dataset === Dataset.EVENTS_ANALYTICS_PLATFORM) { - const traceItemType = getTraceItemTypeForDatasetAndEventType(dataset, eventTypes); - if ( - organization && - hasLogAlerts(organization) && - traceItemType === TraceItemDataset.LOGS - ) { - return 'trace_item_logs'; - } - if ( - organization && - hasTraceMetricsAlerts(organization) && - traceItemType === TraceItemDataset.TRACEMETRICS - ) { - return 'trace_item_metrics'; - } - if (organization && deprecateTransactionAlerts(organization)) { - return alertType ?? 'eap_metrics'; - } return 'eap_metrics'; } return alertType ? alertType : 'custom_transactions'; @@ -107,19 +78,3 @@ export function hasLogAlerts(organization: Organization): boolean { export function hasTraceMetricsAlerts(organization: Organization): boolean { return canUseMetricsAlertsUI(organization); } - -function getTraceItemTypeForDatasetAndEventType( - dataset: Dataset, - eventTypes?: EventTypes[] -) { - if (dataset === Dataset.EVENTS_ANALYTICS_PLATFORM) { - if (eventTypes?.includes(EventTypes.TRACE_ITEM_LOG)) { - return TraceItemDataset.LOGS; - } - if (eventTypes?.includes(EventTypes.TRACE_ITEM_METRIC)) { - return TraceItemDataset.TRACEMETRICS; - } - return TraceItemDataset.SPANS; - } - return null; -} diff --git a/static/app/views/app/globalAlerts.tsx b/static/app/views/app/globalAlerts.tsx index 596969570ea5..e86b74d6b45a 100644 --- a/static/app/views/app/globalAlerts.tsx +++ b/static/app/views/app/globalAlerts.tsx @@ -103,10 +103,10 @@ export function GlobalAlertProvider({children}: Props) { const timersRef = useRef(new Map()); const closeAlert = useCallback( - (alert: StoredGlobalAlert, muteDurationSeconds = DEFAULT_MUTE_DURATION_SECONDS) => { + (alert: StoredGlobalAlert) => { if (alert.id !== undefined) { const muted = readMutedAlerts(); - muted[alert.id] = Math.floor(Date.now() / 1000) + muteDurationSeconds; + muted[alert.id] = Math.floor(Date.now() / 1000) + DEFAULT_MUTE_DURATION_SECONDS; writeMutedAlerts(muted); } diff --git a/static/app/views/autofixIssuesDemo/useAutofixIssues.tsx b/static/app/views/autofixIssuesDemo/useAutofixIssues.tsx index 675003b40a2f..7f05a63692a8 100644 --- a/static/app/views/autofixIssuesDemo/useAutofixIssues.tsx +++ b/static/app/views/autofixIssuesDemo/useAutofixIssues.tsx @@ -97,23 +97,7 @@ export interface AutofixIssue extends Issue { interface UseAutofixIssuesParams { cursor?: string; - // Gates the issues request; pass page-filters readiness so the initial - // fetch waits for the restored project selection. Defaults to true. - enabled?: boolean; - // Fetch exactly these group ids instead of searching the stream. The - // endpoint ignores every other query component in this mode, so a - // deep-linked issue resolves even outside the list's filters/pagination. - groupIds?: string[]; - // Project ids to scope the issue stream to (page-filters selection: [] is - // "My Projects", [-1] is all). Defaults to all accessible projects. - projects?: number[]; query?: string; - // One-shot questions asked about each run (repeatable `question` param, - // capped at 5 by the endpoint). Defaults to this page's demo set. - questions?: string[]; - // Runs-endpoint filter to enrich issues with. Defaults to the explorer runs - // autofix creates; pass e.g. 'type:explorer' to include all trigger sources. - runsQuery?: string; } interface UseAutofixIssuesResult { @@ -132,11 +116,6 @@ interface UseAutofixIssuesResult { export function useAutofixIssues({ query, cursor, - enabled = true, - groupIds: pinnedGroupIds, - projects, - questions = DEMO_QUESTIONS, - runsQuery: runsQueryFilter = RUNS_QUERY, }: UseAutofixIssuesParams): UseAutofixIssuesResult { const organization = useOrganization(); @@ -147,10 +126,7 @@ export function useAutofixIssues({ query: { query: withRequiredFilter(query ?? ''), cursor, - group: pinnedGroupIds, - // In group-id mode the page-filters project selection must not hide - // the deep-linked issue — the backend still enforces access. - project: pinnedGroupIds ? -1 : (projects ?? -1), + project: -1, statsPeriod: '90d', // Explicit endpoint default: last-seen desc selects the issues still // actively occurring as the candidate pool; callers order the loaded @@ -160,7 +136,6 @@ export function useAutofixIssues({ }, staleTime: QUERY_STALE_TIME, }), - enabled, select: selectJsonWithHeaders, }); @@ -176,8 +151,8 @@ export function useAutofixIssues({ apiOptions.as()('/organizations/$organizationIdOrSlug/seer/runs/', { path: {organizationIdOrSlug: organization.slug}, query: { - query: `${runsQueryFilter} group:${groupId}`, - question: questions, + query: `${RUNS_QUERY} group:${groupId}`, + question: DEMO_QUESTIONS, per_page: 1, }, staleTime: QUERY_STALE_TIME, diff --git a/static/app/views/automations/hooks/index.tsx b/static/app/views/automations/hooks/index.tsx index 55c9079ff6b8..a23d987abb0e 100644 --- a/static/app/views/automations/hooks/index.tsx +++ b/static/app/views/automations/hooks/index.tsx @@ -35,7 +35,6 @@ export const automationsApiOptions = ( detector?: string[]; ids?: string[]; limit?: number; - priorityDetector?: string; projects?: number[]; query?: string; sortBy?: string; @@ -45,7 +44,6 @@ export const automationsApiOptions = ( ? { query: options.query, sortBy: options.sortBy, - priorityDetector: options.priorityDetector, id: options.ids, per_page: options.limit, cursor: options.cursor, diff --git a/static/app/views/automations/pathnames.tsx b/static/app/views/automations/pathnames.tsx index 89cb83726085..bd817985ddad 100644 --- a/static/app/views/automations/pathnames.tsx +++ b/static/app/views/automations/pathnames.tsx @@ -6,15 +6,8 @@ export const makeAutomationBasePathname = (orgSlug: string) => { return normalizeUrl(`/organizations/${orgSlug}/monitors/alerts/`); }; -export const makeAutomationCreatePathname = ( - orgSlug: string, - query: { - connectedIds?: string[]; - } = {} -) => { - return normalizeUrl( - `${makeAutomationBasePathname(orgSlug)}new/?${qs.stringify(query)}` - ); +export const makeAutomationCreatePathname = (orgSlug: string) => { + return normalizeUrl(`${makeAutomationBasePathname(orgSlug)}new/?${qs.stringify({})}`); }; export const makeAutomationDetailsPathname = (orgSlug: string, automationId: string) => { diff --git a/static/app/views/dashboards/controls.tsx b/static/app/views/dashboards/controls.tsx index 6a311b656bcc..315b33413e02 100644 --- a/static/app/views/dashboards/controls.tsx +++ b/static/app/views/dashboards/controls.tsx @@ -81,12 +81,11 @@ function LegacyDashboardControls({ }: Props) { const [isFavorited, setIsFavorited] = useState(dashboard.isFavorited); const queryClient = useQueryClient(); - function renderCancelButton(label = t('Cancel'), variant?: 'transparent') { + function renderCancelButton(label = t('Cancel')) { return (