Skip to content

Commit 4fa8f63

Browse files
authored
fix(ui): Typescript 4 misc fixes (#20703)
1 parent 1eb9cb4 commit 4fa8f63

File tree

11 files changed

+13
-24
lines changed

11 files changed

+13
-24
lines changed

src/sentry/static/sentry/app/components/button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ const getIconMargin = ({size, hasChildren}: IconProps) => {
358358
return size && size.endsWith('small') ? '6px' : '8px';
359359
};
360360

361-
const Icon = styled('span')<IconProps>`
361+
const Icon = styled('span')<IconProps & Omit<StyledButtonProps, 'theme'>>`
362362
display: flex;
363363
align-items: center;
364364
margin-right: ${getIconMargin};

src/sentry/static/sentry/app/components/events/groupingInfo/utils.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function hasNonContributingComponent(component: EventGroupComponent | und
1515
}
1616

1717
export function shouldInlineComponentValue(component: EventGroupComponent) {
18-
return component.values.every(value => !isObject(value));
18+
return (component.values as EventGroupComponent[]).every(value => !isObject(value));
1919
}
2020

2121
export function groupingComponentFilter(

src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export const setBodyUserSelect = (nextValues: UserSelectValues): UserSelectValue
307307
// MozUserSelect is not typed in TS
308308
// @ts-ignore
309309
MozUserSelect: document.body.style.MozUserSelect,
310+
// msUserSelect is not typed in TS
311+
// @ts-ignore
310312
msUserSelect: document.body.style.msUserSelect,
311313
webkitUserSelect: document.body.style.webkitUserSelect,
312314
};
@@ -315,6 +317,8 @@ export const setBodyUserSelect = (nextValues: UserSelectValues): UserSelectValue
315317
// MozUserSelect is not typed in TS
316318
// @ts-ignore
317319
document.body.style.MozUserSelect = nextValues.MozUserSelect || '';
320+
// msUserSelect is not typed in TS
321+
// @ts-ignore
318322
document.body.style.msUserSelect = nextValues.msUserSelect || '';
319323
document.body.style.webkitUserSelect = nextValues.webkitUserSelect || '';
320324

src/sentry/static/sentry/app/components/selectMembers/index.tsx

-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import PropTypes from 'prop-types';
21
import React from 'react';
32
import debounce from 'lodash/debounce';
43
import styled from '@emotion/styled';
@@ -14,7 +13,6 @@ import IdBadge from 'app/components/idBadge';
1413
import MemberListStore from 'app/stores/memberListStore';
1514
import ProjectsStore from 'app/stores/projectsStore';
1615
import SelectControl from 'app/components/forms/selectControl';
17-
import SentryTypes from 'app/sentryTypes';
1816
import TeamStore from 'app/stores/teamStore';
1917
import Tooltip from 'app/components/tooltip';
2018
import withApi from 'app/utils/withApi';
@@ -77,18 +75,6 @@ type FilterOption<T> = {
7775
* A component that allows you to select either members and/or teams
7876
*/
7977
class SelectMembers extends React.Component<Props, State> {
80-
static propTypes = {
81-
project: SentryTypes.Project,
82-
organization: SentryTypes.Organization,
83-
value: PropTypes.string,
84-
onChange: PropTypes.func.isRequired,
85-
onInputChange: PropTypes.func,
86-
disabled: PropTypes.bool,
87-
styles: PropTypes.shape({
88-
control: PropTypes.func,
89-
}),
90-
};
91-
9278
state: State = {
9379
loading: false,
9480
inputValue: '',

src/sentry/static/sentry/app/data/forms/projectGeneralSettings.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export const fields: Record<string, Field> = {
249249
`This can be used to modify the fingerprinting rules on the server with custom rules.
250250
Rules follow the pattern [pattern]. [docs:Read the docs] for more information.`,
251251
{
252-
pattern: <code>matcher:glob -> fingerprint, values</code>,
252+
pattern: <code>matcher:glob -&gt; fingerprint, values</code>,
253253
docs: (
254254
<ExternalLink href="https://docs.sentry.io/platform-redirect/?next=%2Fdata-management%2Fevent-grouping%2Fserver-side-fingerprinting%2F" />
255255
),

src/sentry/static/sentry/app/types/alerts.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export type UnsavedIssueAlertRule = {
5858
actions: IssueAlertRuleAction[];
5959
conditions: IssueAlertRuleCondition[];
6060
filters: IssueAlertRuleCondition[];
61-
environment: null | string;
61+
environment?: null | string;
6262
frequency: number;
6363
name: string;
6464
};

src/sentry/static/sentry/app/types/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ export type NewQuery = {
10821082
createdBy?: User;
10831083

10841084
// Query and Table
1085-
query: string;
1085+
query?: string;
10861086
fields: Readonly<string[]>;
10871087
widths?: Readonly<string[]>;
10881088
orderby?: string;

src/sentry/static/sentry/app/utils/discover/eventView.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ class EventView {
918918
const environment = this.environment as string[];
919919

920920
// generate event query
921-
const eventQuery: EventQuery & LocationQuery = Object.assign(
921+
const eventQuery = Object.assign(
922922
omit(picked, DATETIME_QUERY_STRING_KEYS),
923923
normalizedTimeWindowParams,
924924
{
@@ -929,7 +929,7 @@ class EventView {
929929
per_page: DEFAULT_PER_PAGE,
930930
query: this.query,
931931
}
932-
);
932+
) as EventQuery & LocationQuery;
933933

934934
if (!eventQuery.sort) {
935935
delete eventQuery.sort;

src/sentry/static/sentry/app/views/alerts/details/activity/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ class ActivityContainer extends React.PureComponent<Props, State> {
212212

213213
return (
214214
<Activity
215-
noteInputId={this.state.noteInputId}
216215
alertId={alertId}
217216
me={me}
218217
api={api}

src/sentry/static/sentry/app/views/eventsV2/eventDetails/content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class EventDetailsContent extends AsyncComponent<Props, State> {
127127
}
128128
const eventReference = {...event};
129129
if (eventReference.id) {
130-
delete eventReference.id;
130+
delete (eventReference as any).id;
131131
}
132132
const tagKey = this.generateTagKey(tag);
133133
const nextView = getExpandedResults(eventView, {[tagKey]: tag.value}, eventReference);

src/sentry/static/sentry/app/views/eventsV2/queryList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class QueryList extends React.Component<Props> {
235235
onCursor={(cursor: string, path: string, query: Query, direction: number) => {
236236
const offset = Number(cursor.split(':')[1]);
237237

238-
const newQuery = {...query, cursor};
238+
const newQuery: Query & {cursor?: string} = {...query, cursor};
239239
const isPrevious = direction === -1;
240240

241241
if (offset <= 0 && isPrevious) {

0 commit comments

Comments
 (0)