mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 12:07:06 +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 * as React from "react";
|
||||||
import { ChildrenMargin } from "./GitHubStyleConstants";
|
import { ChildrenMargin } from "./GitHubStyleConstants";
|
||||||
|
|
||||||
export interface AuthorizeAccessComponentProps {
|
export interface AuthorizeAccessComponentProps {
|
||||||
scope: string;
|
scope: string;
|
||||||
authorizeAccess: (scope: string) => void;
|
authorizeAccess: (scope: string | undefined) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AuthorizeAccessComponentState {
|
export interface AuthorizeAccessComponentState {
|
||||||
scope: string;
|
scope: string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AuthorizeAccessComponent extends React.Component<
|
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: ";
|
"Complete setup by authorizing Azure Cosmos DB to access the repositories in your GitHub account: ";
|
||||||
private static readonly AuthorizeButtonText = "Authorize access";
|
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({
|
this.setState({
|
||||||
scope: option.key,
|
scope: option ? option.key : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
private onButtonClick = (): void => this.props.authorizeAccess(this.state.scope);
|
private onButtonClick = (): void => this.props.authorizeAccess(this.state.scope);
|
||||||
@@ -64,7 +67,10 @@ export class AuthorizeAccessComponent extends React.Component<
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
selectedKey: this.state.scope,
|
selectedKey: this.state.scope,
|
||||||
onChange: this.onChoiceGroupChange,
|
onChange: (
|
||||||
|
_: React.FormEvent<HTMLElement | HTMLInputElement> | undefined,
|
||||||
|
options: IChoiceGroupOption | undefined
|
||||||
|
) => this.onChoiceGroupChange(_, options),
|
||||||
};
|
};
|
||||||
|
|
||||||
const buttonProps: IButtonProps = {
|
const buttonProps: IButtonProps = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { HoverCard, HoverCardType, Icon, Label, Link, Stack } from "@fluentui/react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Icon, Label, Stack, HoverCard, HoverCardType, Link } from "@fluentui/react";
|
|
||||||
import { CodeOfConductEndpoints } from "../../../../Common/Constants";
|
import { CodeOfConductEndpoints } from "../../../../Common/Constants";
|
||||||
import "./InfoComponent.less";
|
import "./InfoComponent.less";
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ export class InfoComponent extends React.Component<InfoComponentProps> {
|
|||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
{this.props.onReportAbuseClick && (
|
{this.props.onReportAbuseClick && (
|
||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, () => this.props.onReportAbuseClick())}
|
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, this.props.onReportAbuseClick)}
|
||||||
</Stack.Item>
|
</Stack.Item>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -141,7 +141,9 @@
|
|||||||
"./src/userContext.test.ts",
|
"./src/userContext.test.ts",
|
||||||
"src/Common/EntityValue.tsx",
|
"src/Common/EntityValue.tsx",
|
||||||
"./src/Platform/Hosted/Components/SwitchAccount.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": [
|
"include": [
|
||||||
"src/CellOutputViewer/transforms/**/*",
|
"src/CellOutputViewer/transforms/**/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user