mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 23:16:56 +00:00
fixed typescript strict of accordianComponent.tsx and schemaAnalyser (#804)
This commit is contained in:
parent
735a81db47
commit
d06e27a037
@ -3,11 +3,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as Constants from "../../../Common/Constants";
|
|
||||||
import AnimateHeight from "react-animate-height";
|
import AnimateHeight from "react-animate-height";
|
||||||
|
|
||||||
import TriangleDownIcon from "../../../../images/Triangle-down.svg";
|
import TriangleDownIcon from "../../../../images/Triangle-down.svg";
|
||||||
import TriangleRightIcon from "../../../../images/Triangle-right.svg";
|
import TriangleRightIcon from "../../../../images/Triangle-right.svg";
|
||||||
|
import * as Constants from "../../../Common/Constants";
|
||||||
|
|
||||||
export interface AccordionComponentProps {}
|
export interface AccordionComponentProps {}
|
||||||
|
|
||||||
@ -27,12 +26,12 @@ export interface AccordionItemComponentProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface AccordionItemComponentState {
|
interface AccordionItemComponentState {
|
||||||
isExpanded: boolean;
|
isExpanded?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AccordionItemComponent extends React.Component<AccordionItemComponentProps, AccordionItemComponentState> {
|
export class AccordionItemComponent extends React.Component<AccordionItemComponentProps, AccordionItemComponentState> {
|
||||||
private static readonly durationMS = 500;
|
private static readonly durationMS = 500;
|
||||||
private isExpanded: boolean;
|
private isExpanded?: boolean;
|
||||||
|
|
||||||
constructor(props: AccordionItemComponentProps) {
|
constructor(props: AccordionItemComponentProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -79,7 +78,7 @@ export class AccordionItemComponent extends React.Component<AccordionItemCompone
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private onHeaderClick = (event: React.MouseEvent<HTMLDivElement>): void => {
|
private onHeaderClick = (_event: React.MouseEvent<HTMLDivElement>): void => {
|
||||||
this.setState({ isExpanded: !this.state.isExpanded });
|
this.setState({ isExpanded: !this.state.isExpanded });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import * as React from "react";
|
|||||||
type SchemaAnalyzerHeaderProps = {
|
type SchemaAnalyzerHeaderProps = {
|
||||||
isKernelIdle: boolean;
|
isKernelIdle: boolean;
|
||||||
isKernelBusy: boolean;
|
isKernelBusy: boolean;
|
||||||
onSampleSizeUpdated: (sampleSize: string) => void;
|
onSampleSizeUpdated: (sampleSize?: string) => void;
|
||||||
onAnalyzeButtonClick: (filter: string, sampleSize: string) => void;
|
onAnalyzeButtonClick: (filter: string, sampleSize: string) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -30,15 +30,15 @@ export const SchemaAnalyzerHeader = ({
|
|||||||
onSampleSizeUpdated,
|
onSampleSizeUpdated,
|
||||||
onAnalyzeButtonClick,
|
onAnalyzeButtonClick,
|
||||||
}: SchemaAnalyzerHeaderProps): JSX.Element => {
|
}: SchemaAnalyzerHeaderProps): JSX.Element => {
|
||||||
const [filter, setFilter] = React.useState<string>(DefaultFilter);
|
const [filter, setFilter] = React.useState<string | undefined>(DefaultFilter);
|
||||||
const [sampleSize, setSampleSize] = React.useState<string>(DefaultSampleSize);
|
const [sampleSize, setSampleSize] = React.useState<string | undefined>(DefaultSampleSize);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack horizontal tokens={{ childrenGap: 10 }}>
|
<Stack horizontal tokens={{ childrenGap: 10 }}>
|
||||||
<Stack.Item grow>
|
<Stack.Item grow>
|
||||||
<TextField
|
<TextField
|
||||||
value={filter}
|
value={filter}
|
||||||
onChange={(event, newValue) => setFilter(newValue)}
|
onChange={(_event, newValue?: string) => setFilter(newValue)}
|
||||||
label="Filter"
|
label="Filter"
|
||||||
placeholder={FilterPlaceholder}
|
placeholder={FilterPlaceholder}
|
||||||
disabled={!isKernelIdle}
|
disabled={!isKernelIdle}
|
||||||
@ -47,7 +47,7 @@ export const SchemaAnalyzerHeader = ({
|
|||||||
<Stack.Item>
|
<Stack.Item>
|
||||||
<TextField
|
<TextField
|
||||||
value={sampleSize}
|
value={sampleSize}
|
||||||
onChange={(event, newValue) => {
|
onChange={(_event, newValue?: string) => {
|
||||||
const num = Number(newValue);
|
const num = Number(newValue);
|
||||||
if (!newValue || (num >= MinSampleSize && num <= MaxSampleSize)) {
|
if (!newValue || (num >= MinSampleSize && num <= MaxSampleSize)) {
|
||||||
setSampleSize(newValue);
|
setSampleSize(newValue);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"noUnusedParameters": true
|
"noUnusedParameters": true
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
"./src/Explorer/Controls/Accordion/AccordionComponent.tsx",
|
||||||
"./src/AuthType.ts",
|
"./src/AuthType.ts",
|
||||||
"./src/Bindings/ReactBindingHandler.ts",
|
"./src/Bindings/ReactBindingHandler.ts",
|
||||||
"./src/Common/ArrayHashMap.ts",
|
"./src/Common/ArrayHashMap.ts",
|
||||||
|
Loading…
Reference in New Issue
Block a user