mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-01 15:22:08 +00:00
fixe typescript issues for two files
This commit is contained in:
@@ -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<HTMLElement>, option: IChoiceGroupOption): void =>
|
||||
private onChoiceGroupChange = (
|
||||
_: React.FormEvent<HTMLElement | HTMLInputElement> | 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<HTMLElement | HTMLInputElement> | undefined,
|
||||
options: IChoiceGroupOption | undefined
|
||||
) => this.onChoiceGroupChange(_, options),
|
||||
};
|
||||
|
||||
const buttonProps: IButtonProps = {
|
||||
|
||||
@@ -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<InfoComponentProps> {
|
||||
</Stack.Item>
|
||||
{this.props.onReportAbuseClick && (
|
||||
<Stack.Item>
|
||||
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, () => this.props.onReportAbuseClick())}
|
||||
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, this.props.onReportAbuseClick)}
|
||||
</Stack.Item>
|
||||
)}
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user