diff --git a/src/Explorer/Controls/GitHub/AuthorizeAccessComponent.tsx b/src/Explorer/Controls/GitHub/AuthorizeAccessComponent.tsx index 2241bd081..c081444df 100644 --- a/src/Explorer/Controls/GitHub/AuthorizeAccessComponent.tsx +++ b/src/Explorer/Controls/GitHub/AuthorizeAccessComponent.tsx @@ -1,14 +1,14 @@ -import { ChoiceGroup, IButtonProps, IChoiceGroupProps, PrimaryButton, IChoiceGroupOption } from "@fluentui/react"; +import { ChoiceGroup, IButtonProps, IChoiceGroupOption, IChoiceGroupProps, PrimaryButton } from "@fluentui/react"; import * as React from "react"; import { ChildrenMargin } from "./GitHubStyleConstants"; export interface AuthorizeAccessComponentProps { scope: string; - authorizeAccess: (scope: string) => void; + authorizeAccess: (scope: string | undefined) => void; } export interface AuthorizeAccessComponentState { - scope: string; + scope: string | undefined; } export class AuthorizeAccessComponent extends React.Component< @@ -34,9 +34,12 @@ export class AuthorizeAccessComponent extends React.Component< "Complete setup by authorizing Azure Cosmos DB to access the repositories in your GitHub account: "; private static readonly AuthorizeButtonText = "Authorize access"; - private onChoiceGroupChange = (event: React.SyntheticEvent, option: IChoiceGroupOption): void => + private onChoiceGroupChange = ( + _: React.FormEvent | undefined, + option: IChoiceGroupOption | undefined + ): void => this.setState({ - scope: option.key, + scope: option ? option.key : undefined, }); private onButtonClick = (): void => this.props.authorizeAccess(this.state.scope); @@ -64,7 +67,10 @@ export class AuthorizeAccessComponent extends React.Component< }, ], selectedKey: this.state.scope, - onChange: this.onChoiceGroupChange, + onChange: ( + _: React.FormEvent | undefined, + options: IChoiceGroupOption | undefined + ) => this.onChoiceGroupChange(_, options), }; const buttonProps: IButtonProps = { diff --git a/src/Explorer/Controls/NotebookGallery/InfoComponent/InfoComponent.tsx b/src/Explorer/Controls/NotebookGallery/InfoComponent/InfoComponent.tsx index f2c5a2c6e..8bb20fc1d 100644 --- a/src/Explorer/Controls/NotebookGallery/InfoComponent/InfoComponent.tsx +++ b/src/Explorer/Controls/NotebookGallery/InfoComponent/InfoComponent.tsx @@ -1,5 +1,5 @@ +import { HoverCard, HoverCardType, Icon, Label, Link, Stack } from "@fluentui/react"; import * as React from "react"; -import { Icon, Label, Stack, HoverCard, HoverCardType, Link } from "@fluentui/react"; import { CodeOfConductEndpoints } from "../../../../Common/Constants"; import "./InfoComponent.less"; @@ -31,7 +31,7 @@ export class InfoComponent extends React.Component { {this.props.onReportAbuseClick && ( - {this.getInfoPanel("ReportHacked", "Report Abuse", undefined, () => this.props.onReportAbuseClick())} + {this.getInfoPanel("ReportHacked", "Report Abuse", undefined, this.props.onReportAbuseClick)} )} diff --git a/tsconfig.strict.json b/tsconfig.strict.json index 6b80784b5..2ba4793f4 100644 --- a/tsconfig.strict.json +++ b/tsconfig.strict.json @@ -141,7 +141,9 @@ "./src/userContext.test.ts", "src/Common/EntityValue.tsx", "./src/Platform/Hosted/Components/SwitchAccount.tsx", - "./src/Platform/Hosted/Components/SwitchSubscription.tsx" + "./src/Platform/Hosted/Components/SwitchSubscription.tsx", + "./src/Explorer/Controls/GitHub/AuthorizeAccessComponent.tsx", + "./src/Explorer/Controls/NotebookGallery/InfoComponent/InfoComponent.tsx" ], "include": [ "src/CellOutputViewer/transforms/**/*",