Compare commits

...

1 Commits

Author SHA1 Message Date
Jordi Bunster
9ba434a1ac So. MUCH. override 2021-05-06 00:49:03 -07:00
107 changed files with 3127 additions and 1301 deletions

3924
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -101,10 +101,10 @@
"utility-types": "3.10.0" "utility-types": "3.10.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.9.0", "@babel/core": "7.14.0",
"@babel/preset-env": "7.9.0", "@babel/preset-env": "7.14.1",
"@babel/preset-react": "7.9.4", "@babel/preset-react": "7.13.13",
"@babel/preset-typescript": "7.9.0", "@babel/preset-typescript": "7.13.0",
"@testing-library/react": "11.2.3", "@testing-library/react": "11.2.3",
"@types/applicationinsights-js": "1.0.7", "@types/applicationinsights-js": "1.0.7",
"@types/codemirror": "0.0.56", "@types/codemirror": "0.0.56",
@@ -127,10 +127,10 @@
"@types/sinon": "2.3.3", "@types/sinon": "2.3.3",
"@types/styled-components": "5.1.1", "@types/styled-components": "5.1.1",
"@types/underscore": "1.7.36", "@types/underscore": "1.7.36",
"@typescript-eslint/eslint-plugin": "4.22.0", "@typescript-eslint/eslint-plugin": "4.22.1",
"@typescript-eslint/parser": "4.22.0", "@typescript-eslint/parser": "4.22.1",
"babel-jest": "24.9.0", "babel-jest": "26.6.3",
"babel-loader": "8.1.0", "babel-loader": "8.2.2",
"buffer": "5.1.0", "buffer": "5.1.0",
"case-sensitive-paths-webpack-plugin": "2.3.0", "case-sensitive-paths-webpack-plugin": "2.3.0",
"create-file-webpack": "1.0.2", "create-file-webpack": "1.0.2",
@@ -138,7 +138,7 @@
"enzyme": "3.11.0", "enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.5", "enzyme-adapter-react-16": "1.15.5",
"enzyme-to-json": "3.6.1", "enzyme-to-json": "3.6.1",
"eslint": "7.8.1", "eslint": "7.25.0",
"eslint-cli": "1.1.1", "eslint-cli": "1.1.1",
"eslint-plugin-no-null": "1.0.2", "eslint-plugin-no-null": "1.0.2",
"eslint-plugin-prefer-arrow": "1.2.2", "eslint-plugin-prefer-arrow": "1.2.2",
@@ -152,7 +152,7 @@
"html-loader": "0.5.5", "html-loader": "0.5.5",
"html-loader-jest": "0.2.1", "html-loader-jest": "0.2.1",
"html-webpack-plugin": "4.5.2", "html-webpack-plugin": "4.5.2",
"jest": "25.5.4", "jest": "26.6.3",
"jest-canvas-mock": "2.1.0", "jest-canvas-mock": "2.1.0",
"jest-playwright-preset": "1.5.1", "jest-playwright-preset": "1.5.1",
"jest-trx-results-processor": "0.0.7", "jest-trx-results-processor": "0.0.7",
@@ -169,10 +169,10 @@
"rimraf": "3.0.0", "rimraf": "3.0.0",
"sinon": "3.2.1", "sinon": "3.2.1",
"style-loader": "0.23.0", "style-loader": "0.23.0",
"ts-loader": "6.2.2", "ts-loader": "9.1.2",
"tslint": "5.11.0", "tslint": "6.1.3",
"tslint-microsoft-contrib": "6.0.0", "tslint-microsoft-contrib": "6.2.0",
"typescript": "4.2.4", "typescript": "4.3.0-beta",
"url-loader": "1.1.1", "url-loader": "1.1.1",
"wait-on": "4.0.2", "wait-on": "4.0.2",
"webpack": "4.46.0", "webpack": "4.46.0",

View File

@@ -3,11 +3,11 @@ export class ObjectCache<T> extends Map<string, T> {
super(); super();
} }
public get(key: string): T | undefined { public override get(key: string): T | undefined {
return this.touch(key); return this.touch(key);
} }
public set(key: string, value: T): this { public override set(key: string, value: T): this {
if (this.size === this.limit) { if (this.size === this.limit) {
this.delete(this.keys().next().value); this.delete(this.keys().next().value);
} }

View File

@@ -20,7 +20,7 @@ export class AccessibleElement extends React.Component<AccessibleElementProps> {
} }
}; };
public render(): JSX.Element { public override render(): JSX.Element {
const elementProps = { ...this.props }; const elementProps = { ...this.props };
delete elementProps.as; delete elementProps.as;
delete elementProps.onActivated; delete elementProps.onActivated;

View File

@@ -12,7 +12,7 @@ import TriangleRightIcon from "../../../../images/Triangle-right.svg";
export interface AccordionComponentProps {} export interface AccordionComponentProps {}
export class AccordionComponent extends React.Component<AccordionComponentProps> { export class AccordionComponent extends React.Component<AccordionComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return <div className="accordion">{this.props.children}</div>; return <div className="accordion">{this.props.children}</div>;
} }
} }
@@ -42,7 +42,7 @@ export class AccordionItemComponent extends React.Component<AccordionItemCompone
}; };
} }
componentDidUpdate() { public override componentDidUpdate() {
if (this.props.isExpanded !== this.isExpanded) { if (this.props.isExpanded !== this.isExpanded) {
this.isExpanded = this.props.isExpanded; this.isExpanded = this.props.isExpanded;
this.setState({ this.setState({
@@ -51,7 +51,7 @@ export class AccordionItemComponent extends React.Component<AccordionItemCompone
} }
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="accordionItemContainer"> <div className="accordionItemContainer">
<div className="accordionItemHeader" onClick={this.onHeaderClick} onKeyPress={this.onHeaderKeyPress}> <div className="accordionItemHeader" onClick={this.onHeaderClick} onKeyPress={this.onHeaderKeyPress}>

View File

@@ -62,7 +62,7 @@ export class ArcadiaMenuPicker extends React.Component<ArcadiaMenuPickerProps, A
this.props.onCreateNewSparkPoolClicked(item.key); this.props.onCreateNewSparkPoolClicked(item.key);
}; };
public render() { public override render() {
const { workspaces } = this.props; const { workspaces } = this.props;
let workspaceMenuItems: IContextualMenuItem[] = workspaces.map((workspace) => { let workspaceMenuItems: IContextualMenuItem[] = workspaces.map((workspace) => {
let sparkPoolsMenuProps: IContextualMenuProps = { let sparkPoolsMenuProps: IContextualMenuProps = {

View File

@@ -19,7 +19,7 @@ export interface CollapsiblePanelProps {
} }
export class CollapsiblePanel extends React.Component<CollapsiblePanelProps> { export class CollapsiblePanel extends React.Component<CollapsiblePanelProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className={`collapsiblePanel ${this.props.isCollapsed ? "paneCollapsed" : ""}`}> <div className={`collapsiblePanel ${this.props.isCollapsed ? "paneCollapsed" : ""}`}>
{!this.props.isCollapsed ? this.getExpandedFragment() : this.getCollapsedFragment()} {!this.props.isCollapsed ? this.getExpandedFragment() : this.getCollapsedFragment()}

View File

@@ -24,13 +24,13 @@ export class CollapsibleSectionComponent extends React.Component<CollapsibleSect
this.setState({ isExpanded: !this.state.isExpanded }); this.setState({ isExpanded: !this.state.isExpanded });
}; };
public componentDidUpdate(): void { public override componentDidUpdate(): void {
if (this.state.isExpanded && this.props.onExpand) { if (this.state.isExpanded && this.props.onExpand) {
this.props.onExpand(); this.props.onExpand();
} }
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<> <>
<Stack <Stack

View File

@@ -129,7 +129,7 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
private dropdownElt: HTMLElement; private dropdownElt: HTMLElement;
private expandButtonElt: HTMLElement; private expandButtonElt: HTMLElement;
public componentDidUpdate(): void { public override componentDidUpdate(): void {
if (!this.dropdownElt || !this.expandButtonElt) { if (!this.dropdownElt || !this.expandButtonElt) {
return; return;
} }
@@ -243,7 +243,7 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
); );
} }
public render(): JSX.Element { public override render(): JSX.Element {
let mainClassName = "commandButtonComponent"; let mainClassName = "commandButtonComponent";
if (this.props.disabled) { if (this.props.disabled) {
mainClassName += " commandDisabled"; mainClassName += " commandDisabled";

View File

@@ -16,7 +16,7 @@ export interface DefaultDirectoryDropdownProps {
export class DefaultDirectoryDropdownComponent extends React.Component<DefaultDirectoryDropdownProps> { export class DefaultDirectoryDropdownComponent extends React.Component<DefaultDirectoryDropdownProps> {
public static readonly lastVisitedKey: string = "lastVisited"; public static readonly lastVisitedKey: string = "lastVisited";
public render(): JSX.Element { public override render(): JSX.Element {
const lastVisitedOption: IDropdownOption = { const lastVisitedOption: IDropdownOption = {
key: DefaultDirectoryDropdownComponent.lastVisitedKey, key: DefaultDirectoryDropdownComponent.lastVisitedKey,
text: "Sign in to your last visited directory", text: "Sign in to your last visited directory",

View File

@@ -36,7 +36,7 @@ export class DirectoryListComponent extends React.Component<DirectoryListProps,
}; };
} }
public render(): JSX.Element { public override render(): JSX.Element {
const { directories: originalItems, selectedDirectoryId } = this.props; const { directories: originalItems, selectedDirectoryId } = this.props;
const { filterText } = this.state; const { filterText } = this.state;
const filteredItems = const filteredItems =

View File

@@ -56,7 +56,7 @@ export class DynamicListViewModel extends WaitsForTemplateViewModel {
public ariaLabel: string; public ariaLabel: string;
public buttonText: string; public buttonText: string;
public newItem: ko.Observable<string>; public newItem: ko.Observable<string>;
public isTemplateReady: ko.Observable<boolean>; public override isTemplateReady: ko.Observable<boolean>;
public listItems: ko.ObservableArray<DynamicListItem>; public listItems: ko.ObservableArray<DynamicListItem>;
public constructor(options: DynamicListParams) { public constructor(options: DynamicListParams) {

View File

@@ -26,7 +26,7 @@ export interface EditorParams extends JsonEditorParams {
*/ */
// TODO: Ideally, JsonEditorViewModel should extend EditorViewModel and not the other way around // TODO: Ideally, JsonEditorViewModel should extend EditorViewModel and not the other way around
class EditorViewModel extends JsonEditorViewModel { class EditorViewModel extends JsonEditorViewModel {
public params: EditorParams; public override params: EditorParams;
private static providerRegistered: string[] = []; private static providerRegistered: string[] = [];
public constructor(params: EditorParams) { public constructor(params: EditorParams) {
@@ -44,11 +44,11 @@ class EditorViewModel extends JsonEditorViewModel {
}); });
} }
protected getEditorLanguage(): string { protected override getEditorLanguage(): string {
return this.params.contentType; return this.params.contentType;
} }
protected async registerCompletionItemProvider() { protected override async registerCompletionItemProvider() {
if (EditorViewModel.providerRegistered.indexOf("sql") < 0) { if (EditorViewModel.providerRegistered.indexOf("sql") < 0) {
const { SqlCompletionItemProvider } = await import("@azure/cosmos-language-service"); const { SqlCompletionItemProvider } = await import("@azure/cosmos-language-service");
const monaco = await loadMonaco(); const monaco = await loadMonaco();
@@ -57,7 +57,7 @@ class EditorViewModel extends JsonEditorViewModel {
} }
} }
protected async getErrorMarkers(input: string): Promise<monaco.editor.IMarkerData[]> { protected override async getErrorMarkers(input: string): Promise<monaco.editor.IMarkerData[]> {
const { ErrorMarkProvider } = await import("@azure/cosmos-language-service"); const { ErrorMarkProvider } = await import("@azure/cosmos-language-service");
return ErrorMarkProvider.getErrorMark(input); return ErrorMarkProvider.getErrorMark(input);
} }

View File

@@ -21,20 +21,20 @@ export class EditorReact extends React.Component<EditorReactProps> {
super(props); super(props);
} }
public componentDidMount(): void { public override componentDidMount(): void {
this.createEditor(this.configureEditor.bind(this)); this.createEditor(this.configureEditor.bind(this));
} }
public shouldComponentUpdate(): boolean { public override shouldComponentUpdate(): boolean {
// Prevents component re-rendering // Prevents component re-rendering
return false; return false;
} }
public componentWillUnmount(): void { public override componentWillUnmount(): void {
this.selectionListener && this.selectionListener.dispose(); this.selectionListener && this.selectionListener.dispose();
} }
public render(): JSX.Element { public override render(): JSX.Element {
return <div className="jsonEditor" ref={(elt: HTMLElement) => this.setRef(elt)} />; return <div className="jsonEditor" ref={(elt: HTMLElement) => this.setRef(elt)} />;
} }

View File

@@ -38,7 +38,7 @@ export class AddRepoComponent extends React.Component<AddRepoComponentProps, Add
}; };
} }
public render(): JSX.Element { public override render(): JSX.Element {
const textFieldProps: ITextFieldProps = { const textFieldProps: ITextFieldProps = {
placeholder: AddRepoComponent.TextFieldPlaceholder, placeholder: AddRepoComponent.TextFieldPlaceholder,
autoFocus: true, autoFocus: true,

View File

@@ -49,7 +49,7 @@ export class AuthorizeAccessComponent extends React.Component<
}; };
} }
public render(): JSX.Element { public override render(): JSX.Element {
const choiceGroupProps: IChoiceGroupProps = { const choiceGroupProps: IChoiceGroupProps = {
options: [ options: [
{ {

View File

@@ -29,7 +29,7 @@ export class GitHubReposComponent extends React.Component<GitHubReposComponentPr
private static readonly OKButtonText = "OK"; private static readonly OKButtonText = "OK";
private static readonly CancelButtonText = "Cancel"; private static readonly CancelButtonText = "Cancel";
public render(): JSX.Element { public override render(): JSX.Element {
const content: JSX.Element = this.props.showAuthorizeAccess ? ( const content: JSX.Element = this.props.showAuthorizeAccess ? (
<AuthorizeAccessComponent {...this.props.authorizeAccessProps} /> <AuthorizeAccessComponent {...this.props.authorizeAccessProps} />
) : ( ) : (

View File

@@ -67,7 +67,7 @@ export class ReposListComponent extends React.Component<ReposListComponentProps>
private static readonly DefaultBranchName = "master"; private static readonly DefaultBranchName = "master";
private static readonly FooterIndex = -1; private static readonly FooterIndex = -1;
public render(): JSX.Element { public override render(): JSX.Element {
const pinnedReposListProps: IDetailsListProps = { const pinnedReposListProps: IDetailsListProps = {
styles: { styles: {
contentWrapper: { contentWrapper: {

View File

@@ -30,7 +30,7 @@ export class GalleryHeaderComponent extends React.Component {
); );
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack <Stack
tokens={{ childrenGap: 10 }} tokens={{ childrenGap: 10 }}

View File

@@ -113,7 +113,7 @@ export class InputTypeaheadComponent extends React.Component<
* @param prevState * @param prevState
* @param snapshot * @param snapshot
*/ */
public componentDidUpdate( public override componentDidUpdate(
prevProps: InputTypeaheadComponentProps, prevProps: InputTypeaheadComponentProps,
prevState: InputTypeaheadComponentState, prevState: InputTypeaheadComponentState,
snapshot: any snapshot: any
@@ -127,11 +127,11 @@ export class InputTypeaheadComponent extends React.Component<
/** /**
* Executed once react is done building the DOM for this component * Executed once react is done building the DOM for this component
*/ */
public componentDidMount(): void { public override componentDidMount(): void {
this.initializeTypeahead(); this.initializeTypeahead();
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<span className="input-typeahead-container"> <span className="input-typeahead-container">
<div <div

View File

@@ -19,7 +19,7 @@ export class NotebookTerminalComponent extends React.Component<NotebookTerminalC
super(props); super(props);
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="notebookTerminalContainer"> <div className="notebookTerminalContainer">
<iframe <iframe

View File

@@ -42,7 +42,7 @@ export class GalleryAndNotebookViewerComponent extends React.Component<
}; };
} }
public render(): JSX.Element { public override render(): JSX.Element {
if (this.state.notebookUrl) { if (this.state.notebookUrl) {
const props: NotebookViewerComponentProps = { const props: NotebookViewerComponentProps = {
container: this.props.container, container: this.props.container,

View File

@@ -149,7 +149,7 @@ export class GalleryViewerComponent extends React.Component<GalleryViewerCompone
this.loadFavoriteNotebooks(this.state.searchText, this.state.sortBy, false); // Need this to show correct favorite button state this.loadFavoriteNotebooks(this.state.searchText, this.state.sortBy, false); // Need this to show correct favorite button state
} }
public render(): JSX.Element { public override render(): JSX.Element {
this.traceViewGallery(); this.traceViewGallery();
const tabs: GalleryTabInfo[] = [ const tabs: GalleryTabInfo[] = [

View File

@@ -38,7 +38,7 @@ export class InfoComponent extends React.Component<InfoComponentProps> {
); );
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<HoverCard plainCardProps={{ onRenderPlainCard: this.onHover }} instantOpenOnClick type={HoverCardType.plain}> <HoverCard plainCardProps={{ onRenderPlainCard: this.onHover }} instantOpenOnClick type={HoverCardType.plain}>
<div className="infoPanelMain"> <div className="infoPanelMain">

View File

@@ -41,7 +41,7 @@ export class NotebookMetadataComponent extends React.Component<NotebookMetadataC
); );
}; };
public render(): JSX.Element { public override render(): JSX.Element {
const options: Intl.DateTimeFormatOptions = { const options: Intl.DateTimeFormatOptions = {
year: "numeric", year: "numeric",
month: "short", month: "short",

View File

@@ -132,7 +132,7 @@ export class NotebookViewerComponent
} }
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="notebookViewerContainer"> <div className="notebookViewerContainer">
{this.props.backNavigationText !== undefined ? ( {this.props.backNavigationText !== undefined ? (

View File

@@ -62,7 +62,7 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
this.selection.setItems(this.state.filteredResults); this.selection.setItems(this.state.filteredResults);
} }
public componentDidUpdate(prevProps: QueriesGridComponentProps, prevState: QueriesGridComponentState): void { public override componentDidUpdate(prevProps: QueriesGridComponentProps, prevState: QueriesGridComponentState): void {
this.selection.setItems( this.selection.setItems(
this.state.filteredResults, this.state.filteredResults,
!_.isEqual(prevState.filteredResults, this.state.filteredResults) !_.isEqual(prevState.filteredResults, this.state.filteredResults)
@@ -79,11 +79,11 @@ export class QueriesGridComponent extends React.Component<QueriesGridComponentPr
} }
// fetched saved queries when panel open // fetched saved queries when panel open
public componentDidMount() { public override componentDidMount() {
this.fetchSavedQueries(); this.fetchSavedQueries();
} }
public render(): JSX.Element { public override render(): JSX.Element {
if (this.state.queries.length === 0) { if (this.state.queries.length === 0) {
return this.renderBannerComponent(); return this.renderBannerComponent();
} }

View File

@@ -20,7 +20,7 @@ export interface RadioSwitchComponentProps {
} }
export class RadioSwitchComponent extends React.Component<RadioSwitchComponentProps> { export class RadioSwitchComponent extends React.Component<RadioSwitchComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="radioSwitchComponent"> <div className="radioSwitchComponent">
{this.props.choices.map((choice: Choice) => ( {this.props.choices.map((choice: Choice) => (

View File

@@ -17,7 +17,7 @@ export abstract class ResizeSensorComponent<P, S> extends React.Component<P, S>
protected abstract onDimensionsChanged(width: number, height: number): void; protected abstract onDimensionsChanged(width: number, height: number): void;
protected abstract getSensorTarget(): HTMLElement; protected abstract getSensorTarget(): HTMLElement;
public componentDidUpdate(): void { public override componentDidUpdate(): void {
if (this.isSensing) { if (this.isSensing) {
return; return;
} }
@@ -37,7 +37,7 @@ export abstract class ResizeSensorComponent<P, S> extends React.Component<P, S>
} }
} }
public componentWillUnmount(): void { public override componentWillUnmount(): void {
if (!!this.resizeSensor) { if (!!this.resizeSensor) {
this.resizeSensor.detach(); this.resizeSensor.detach();
} }

View File

@@ -213,7 +213,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
}; };
} }
componentDidMount(): void { public override componentDidMount(): void {
if (this.isCollectionSettingsTab) { if (this.isCollectionSettingsTab) {
this.refreshIndexTransformationProgress(); this.refreshIndexTransformationProgress();
this.loadMongoIndexes(); this.loadMongoIndexes();
@@ -226,7 +226,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
} }
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
if (this.props.settingsTab.isActive()) { if (this.props.settingsTab.isActive()) {
this.props.settingsTab.getContainer().onUpdateTabsButtons(this.getTabsButtons()); this.props.settingsTab.getContainer().onUpdateTabsButtons(this.getTabsButtons());
} }
@@ -879,7 +879,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
return mongoIndexingPolicyAADError; return mongoIndexingPolicyAADError;
}; };
public render(): JSX.Element { public override render(): JSX.Element {
const scaleComponentProps: ScaleComponentProps = { const scaleComponentProps: ScaleComponentProps = {
collection: this.collection, collection: this.collection,
database: this.database, database: this.database,

View File

@@ -26,7 +26,7 @@ import {
} from "./SettingsRenderUtils"; } from "./SettingsRenderUtils";
class SettingsRenderUtilsTestComponent extends React.Component { class SettingsRenderUtilsTestComponent extends React.Component {
public render(): JSX.Element { public override render(): JSX.Element {
const estimatedSpendingColumns: IColumn[] = [ const estimatedSpendingColumns: IColumn[] = [
{ key: "costType", name: "", fieldName: "costType", minWidth: 100, maxWidth: 200, isResizable: true }, { key: "costType", name: "", fieldName: "costType", minWidth: 100, maxWidth: 200, isResizable: true },
{ key: "hourly", name: "Hourly", fieldName: "hourly", minWidth: 100, maxWidth: 200, isResizable: true }, { key: "hourly", name: "Hourly", fieldName: "hourly", minWidth: 100, maxWidth: 200, isResizable: true },

View File

@@ -40,11 +40,11 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
{ key: DataModels.ConflictResolutionMode.Custom, text: "Merge Procedure (custom)" }, { key: DataModels.ConflictResolutionMode.Custom, text: "Merge Procedure (custom)" },
]; ];
componentDidMount(): void { public override componentDidMount(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
@@ -135,7 +135,7 @@ export class ConflictResolutionComponent extends React.Component<ConflictResolut
/> />
); );
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...subComponentStackProps}> <Stack {...subComponentStackProps}>
{this.getConflictResolutionModeComponent()} {this.getConflictResolutionModeComponent()}

View File

@@ -38,7 +38,7 @@ export class IndexingPolicyComponent extends React.Component<
}; };
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
if (this.props.shouldDiscardIndexingPolicy) { if (this.props.shouldDiscardIndexingPolicy) {
this.resetIndexingPolicyEditor(); this.resetIndexingPolicyEditor();
this.props.resetShouldDiscardIndexingPolicy(); this.props.resetShouldDiscardIndexingPolicy();
@@ -46,7 +46,7 @@ export class IndexingPolicyComponent extends React.Component<
this.onComponentUpdate(); this.onComponentUpdate();
} }
componentDidMount(): void { public override componentDidMount(): void {
this.resetIndexingPolicyEditor(); this.resetIndexingPolicyEditor();
this.onComponentUpdate(); this.onComponentUpdate();
} }
@@ -112,7 +112,7 @@ export class IndexingPolicyComponent extends React.Component<
} }
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...titleAndInputStackProps}> <Stack {...titleAndInputStackProps}>
<IndexingPolicyRefreshComponent <IndexingPolicyRefreshComponent

View File

@@ -52,7 +52,7 @@ export class IndexingPolicyRefreshComponent extends React.Component<
} }
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return this.renderIndexTransformationWarning() ? ( return this.renderIndexTransformationWarning() ? (
<MessageBar messageBarType={MessageBarType.warning}>{this.renderIndexTransformationWarning()}</MessageBar> <MessageBar messageBarType={MessageBarType.warning}>{this.renderIndexTransformationWarning()}</MessageBar>
) : ( ) : (

View File

@@ -61,7 +61,7 @@ export class AddMongoIndexComponent extends React.Component<AddMongoIndexCompone
this.descriptionTextField.focus(); this.descriptionTextField.focus();
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...mongoWarningStackProps}> <Stack {...mongoWarningStackProps}>
<Stack horizontal tokens={addMongoIndexSubElementsTokens}> <Stack horizontal tokens={addMongoIndexSubElementsTokens}>

View File

@@ -89,14 +89,14 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
}, },
]; ];
componentDidUpdate(prevProps: MongoIndexingPolicyComponentProps): void { public override componentDidUpdate(prevProps: MongoIndexingPolicyComponentProps): void {
if (this.props.indexesToAdd.length > prevProps.indexesToAdd.length) { if (this.props.indexesToAdd.length > prevProps.indexesToAdd.length) {
this.addMongoIndexComponentRefs[prevProps.indexesToAdd.length]?.current?.focus(); this.addMongoIndexComponentRefs[prevProps.indexesToAdd.length]?.current?.focus();
} }
this.onComponentUpdate(); this.onComponentUpdate();
} }
componentDidMount(): void { public override componentDidMount(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
@@ -311,7 +311,7 @@ export class MongoIndexingPolicyComponent extends React.Component<MongoIndexingP
); );
}; };
public render(): JSX.Element { public override render(): JSX.Element {
if (this.props.mongoIndexes) { if (this.props.mongoIndexes) {
if (this.hasCompoundIndex()) { if (this.hasCompoundIndex()) {
return mongoCompoundIndexNotSupportedMessage; return mongoCompoundIndexNotSupportedMessage;

View File

@@ -216,7 +216,7 @@ export class ScaleComponent extends React.Component<ScaleComponentProps> {
); );
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...subComponentStackProps}> <Stack {...subComponentStackProps}>
{this.isFreeTierAccount() && ( {this.isFreeTierAccount() && (

View File

@@ -72,11 +72,11 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
this.partitionKeyName = userContext.apiType === "Mongo" ? "Shard key" : "Partition key"; this.partitionKeyName = userContext.apiType === "Mongo" ? "Shard key" : "Partition key";
} }
componentDidMount(): void { public override componentDidMount(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
@@ -323,7 +323,7 @@ export class SubSettingsComponent extends React.Component<SubSettingsComponentPr
public isLargePartitionKeyEnabled = (): boolean => this.props.collection.partitionKey?.version >= 2; public isLargePartitionKeyEnabled = (): boolean => this.props.collection.partitionKey?.version >= 2;
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...subComponentStackProps}> <Stack {...subComponentStackProps}>
{userContext.apiType !== "Cassandra" && this.getTtlComponent()} {userContext.apiType !== "Cassandra" && this.getTtlComponent()}

View File

@@ -96,11 +96,11 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
{ key: "false", text: "Manual" }, { key: "false", text: "Manual" },
]; ];
componentDidMount(): void { public override componentDidMount(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
this.onComponentUpdate(); this.onComponentUpdate();
} }
@@ -627,7 +627,7 @@ export class ThroughputInputAutoPilotV3Component extends React.Component<
); );
}; };
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<Stack {...checkBoxAndInputStackProps}> <Stack {...checkBoxAndInputStackProps}>
{this.renderWarningMessage()} {this.renderWarningMessage()}

View File

@@ -10,7 +10,7 @@ export interface ToolTipLabelComponentProps {
const iconButtonStyles: Partial<IIconStyles> = { root: { marginBottom: -3 } }; const iconButtonStyles: Partial<IIconStyles> = { root: { marginBottom: -3 } };
export class ToolTipLabelComponent extends React.Component<ToolTipLabelComponentProps> { export class ToolTipLabelComponent extends React.Component<ToolTipLabelComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<> <>
<Stack horizontal verticalAlign="center" tokens={toolTipLabelStackTokens}> <Stack horizontal verticalAlign="center" tokens={toolTipLabelStackTokens}>

View File

@@ -115,7 +115,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
fontSize: 12, fontSize: 12,
}; };
componentDidUpdate(): void { public override componentDidUpdate(): void {
if (!this.shouldCheckErrors) { if (!this.shouldCheckErrors) {
this.shouldCheckErrors = true; this.shouldCheckErrors = true;
return; return;
@@ -407,7 +407,7 @@ export class SmartUiComponent extends React.Component<SmartUiComponentProps, Sma
); );
} }
render(): JSX.Element { public override render(): JSX.Element {
return this.renderNode(this.props.descriptor.root); return this.renderNode(this.props.descriptor.root);
} }
} }

View File

@@ -68,7 +68,7 @@ export class TabComponent extends React.Component<TabComponentProps> {
}); });
} }
public render(): JSX.Element { public override render(): JSX.Element {
const currentTabContent = this.props.tabs[this.props.currentTabIndex].content; const currentTabContent = this.props.tabs[this.props.currentTabIndex].content;
let className = "tabComponentContent"; let className = "tabComponentContent";
if (currentTabContent.className) { if (currentTabContent.className) {

View File

@@ -38,7 +38,7 @@ export class ThroughputInput extends React.Component<ThroughputInputProps, Throu
this.props.setIsAutoscale(true); this.props.setIsAutoscale(true);
} }
render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="throughputInputContainer throughputInputSpacing"> <div className="throughputInputContainer throughputInputSpacing">
<Stack horizontal> <Stack horizontal>

View File

@@ -56,7 +56,7 @@ export interface TreeComponentProps {
} }
export class TreeComponent extends React.Component<TreeComponentProps> { export class TreeComponent extends React.Component<TreeComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div style={this.props.style} className={`treeComponent ${this.props.className}`}> <div style={this.props.style} className={`treeComponent ${this.props.className}`}>
<TreeNodeComponent paddingLeft={0} node={this.props.rootNode} generation={0} /> <TreeNodeComponent paddingLeft={0} node={this.props.rootNode} generation={0} />
@@ -93,7 +93,7 @@ export class TreeNodeComponent extends React.Component<TreeNodeComponentProps, T
}; };
} }
componentDidUpdate(prevProps: TreeNodeComponentProps, prevState: TreeNodeComponentState) { public override componentDidUpdate(prevProps: TreeNodeComponentProps, prevState: TreeNodeComponentState) {
// Only call when expand has actually changed // Only call when expand has actually changed
if (this.state.isExpanded !== prevState.isExpanded) { if (this.state.isExpanded !== prevState.isExpanded) {
if (this.state.isExpanded) { if (this.state.isExpanded) {
@@ -110,7 +110,7 @@ export class TreeNodeComponent extends React.Component<TreeNodeComponentProps, T
} }
} }
public render(): JSX.Element { public override render(): JSX.Element {
return this.renderNode(this.props.node, this.props.generation); return this.renderNode(this.props.node, this.props.generation);
} }

View File

@@ -34,7 +34,7 @@ export class EditorNeighborsComponent extends React.Component<EditorNeighborsCom
this.addNewEdgeToNeighbor = this.props.isSource ? this.addNewEdgeToSource : this.addNewEdgeToTarget; this.addNewEdgeToNeighbor = this.props.isSource ? this.addNewEdgeToSource : this.addNewEdgeToTarget;
} }
public componentDidMount(): void { public override componentDidMount(): void {
// Show empty text boxes by default if no neighbor for convenience // Show empty text boxes by default if no neighbor for convenience
if (this.props.editedNeighbors.currentNeighbors.length === 0) { if (this.props.editedNeighbors.currentNeighbors.length === 0) {
if (this.props.isSource) { if (this.props.isSource) {
@@ -45,7 +45,7 @@ export class EditorNeighborsComponent extends React.Component<EditorNeighborsCom
} }
} }
public render(): JSX.Element { public override render(): JSX.Element {
const neighborTitle = this.props.isSource const neighborTitle = this.props.isSource
? EditorNeighborsComponent.SOURCE_TITLE ? EditorNeighborsComponent.SOURCE_TITLE
: EditorNeighborsComponent.TARGET_TITLE; : EditorNeighborsComponent.TARGET_TITLE;

View File

@@ -20,7 +20,7 @@ export class EditorNodePropertiesComponent extends React.Component<EditorNodePro
public static readonly VERTEX_PROPERTY_TYPES = ["string", "number", "boolean" /* 'null' */]; // TODO Enable null when fully supported by backend public static readonly VERTEX_PROPERTY_TYPES = ["string", "number", "boolean" /* 'null' */]; // TODO Enable null when fully supported by backend
private static readonly DEFAULT_PROPERTY_TYPE = "string"; private static readonly DEFAULT_PROPERTY_TYPE = "string";
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<table className="propertyTable"> <table className="propertyTable">
<tbody> <tbody>

View File

@@ -965,7 +965,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} }
/* ************* React life-cycle methods *********** */ /* ************* React life-cycle methods *********** */
public render(): JSX.Element { public override render(): JSX.Element {
const currentTabIndex = ((resultDisplay: ResultDisplay): number => { const currentTabIndex = ((resultDisplay: ResultDisplay): number => {
switch (resultDisplay) { switch (resultDisplay) {
case ResultDisplay.Graph: case ResultDisplay.Graph:
@@ -1022,10 +1022,10 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
); );
} }
public componentWillUnmount(): void { public override componentWillUnmount(): void {
this.gremlinClient.destroy(); this.gremlinClient.destroy();
} }
public componentDidMount(): void { public override componentDidMount(): void {
if (this.props.onLoadStartKey != null && this.props.onLoadStartKey != undefined) { if (this.props.onLoadStartKey != null && this.props.onLoadStartKey != undefined) {
TelemetryProcessor.traceSuccess( TelemetryProcessor.traceSuccess(
Action.Tab, Action.Tab,
@@ -1069,7 +1069,7 @@ export class GraphExplorer extends React.Component<GraphExplorerProps, GraphExpl
} }
} }
public componentDidUpdate(): void { public override componentDidUpdate(): void {
this.onIsPropertyPaneEditing(this.isPropertyPaneEditing()); this.onIsPropertyPaneEditing(this.isPropertyPaneEditing());
this.onIsNewVertexDisabledChange(this.isNewVertexDisabled()); this.onIsNewVertexDisabledChange(this.isNewVertexDisabled());
} }

View File

@@ -18,20 +18,20 @@ export class GraphVizComponent extends React.Component<GraphVizComponentProps> {
this.forceGraph = new D3ForceGraph(this.props.forceGraphParams); this.forceGraph = new D3ForceGraph(this.props.forceGraphParams);
} }
public componentDidMount(): void { public override componentDidMount(): void {
this.forceGraph.init(this.rootNode); this.forceGraph.init(this.rootNode);
} }
public shouldComponentUpdate(): boolean { public override shouldComponentUpdate(): boolean {
// Prevents component re-rendering // Prevents component re-rendering
return false; return false;
} }
public componentWillUnmount(): void { public override componentWillUnmount(): void {
this.forceGraph.destroy(); this.forceGraph.destroy();
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<svg id="maingraph" ref={(elt: Element) => this.setRef(elt)}> <svg id="maingraph" ref={(elt: Element) => this.setRef(elt)}>
<title>Main Graph</title> <title>Main Graph</title>

View File

@@ -18,7 +18,7 @@ interface LeftPaneComponentProps {
} }
export class LeftPaneComponent extends React.Component<LeftPaneComponentProps> { export class LeftPaneComponent extends React.Component<LeftPaneComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="leftPane"> <div className="leftPane">
<div className="paneTitle leftPaneResults">Results</div> <div className="paneTitle leftPaneResults">Results</div>

View File

@@ -12,7 +12,7 @@ interface MiddlePaneComponentProps {
} }
export class MiddlePaneComponent extends React.Component<MiddlePaneComponentProps> { export class MiddlePaneComponent extends React.Component<MiddlePaneComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="middlePane"> <div className="middlePane">
<div className="graphTitle"> <div className="graphTitle">

View File

@@ -104,7 +104,7 @@ export class NodePropertiesComponent extends React.Component<
return null; return null;
} }
public render(): JSX.Element { public override render(): JSX.Element {
if (!this.props.node) { if (!this.props.node) {
return <span />; return <span />;
} else { } else {

View File

@@ -25,7 +25,7 @@ export class QueryContainerComponent extends React.Component<
}; };
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="queryContainer"> <div className="queryContainer">
<InputTypeaheadComponent.InputTypeaheadComponent <InputTypeaheadComponent.InputTypeaheadComponent

View File

@@ -20,7 +20,7 @@ export class ReadOnlyNeighborsComponent extends React.Component<ReadOnlyNeighbor
private static readonly NO_TARGETS_LABEL = "No targets found"; private static readonly NO_TARGETS_LABEL = "No targets found";
private static readonly TARGET_TITLE = "Target"; private static readonly TARGET_TITLE = "Target";
public render(): JSX.Element { public override render(): JSX.Element {
const neighbors = this.props.isSource ? this.props.node.sources : this.props.node.targets; const neighbors = this.props.isSource ? this.props.node.sources : this.props.node.targets;
const noNeighborsLabel = this.props.isSource const noNeighborsLabel = this.props.isSource
? ReadOnlyNeighborsComponent.NO_SOURCES_LABEL ? ReadOnlyNeighborsComponent.NO_SOURCES_LABEL

View File

@@ -12,7 +12,7 @@ export interface ReadOnlyNodePropertiesComponentProps {
} }
export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNodePropertiesComponentProps> { export class ReadOnlyNodePropertiesComponent extends React.Component<ReadOnlyNodePropertiesComponentProps> {
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<table className="roPropertyTable propertyTable"> <table className="roPropertyTable propertyTable">
<tbody> <tbody>

View File

@@ -10,17 +10,17 @@ interface MemoryTrackerProps {
export class MemoryTrackerComponent extends React.Component<MemoryTrackerProps> { export class MemoryTrackerComponent extends React.Component<MemoryTrackerProps> {
private memoryUsageInfoSubscription: Subscription; private memoryUsageInfoSubscription: Subscription;
public componentDidMount(): void { public override componentDidMount(): void {
this.memoryUsageInfoSubscription = this.props.memoryUsageInfo.subscribe(() => { this.memoryUsageInfoSubscription = this.props.memoryUsageInfo.subscribe(() => {
this.forceUpdate(); this.forceUpdate();
}); });
} }
public componentWillUnmount(): void { public override componentWillUnmount(): void {
this.memoryUsageInfoSubscription && this.memoryUsageInfoSubscription.dispose(); this.memoryUsageInfoSubscription && this.memoryUsageInfoSubscription.dispose();
} }
public render(): JSX.Element { public override render(): JSX.Element {
const memoryUsageInfo: MemoryUsageInfo = this.props.memoryUsageInfo(); const memoryUsageInfo: MemoryUsageInfo = this.props.memoryUsageInfo();
if (!memoryUsageInfo) { if (!memoryUsageInfo) {
return ( return (

View File

@@ -23,7 +23,7 @@ export class ControlBarComponent extends React.Component<ControlBarComponentProp
); );
} }
public render(): JSX.Element { public override render(): JSX.Element {
if (!this.props.buttons || this.props.buttons.length < 1) { if (!this.props.buttons || this.props.buttons.length < 1) {
return <React.Fragment />; return <React.Fragment />;
} }

View File

@@ -74,7 +74,7 @@ export class NotificationConsoleComponent extends React.Component<
this.prevHeaderStatus = undefined; this.prevHeaderStatus = undefined;
} }
public componentDidUpdate( public override componentDidUpdate(
prevProps: NotificationConsoleComponentProps, prevProps: NotificationConsoleComponentProps,
prevState: NotificationConsoleComponentState prevState: NotificationConsoleComponentState
): void { ): void {
@@ -102,7 +102,7 @@ export class NotificationConsoleComponent extends React.Component<
this.consoleHeaderElement = element; this.consoleHeaderElement = element;
}; };
public render(): JSX.Element { public override render(): JSX.Element {
const numInProgress = this.state.allConsoleData.filter( const numInProgress = this.state.allConsoleData.filter(
(data: ConsoleData) => data.type === ConsoleDataType.InProgress (data: ConsoleData) => data.type === ConsoleDataType.InProgress
).length; ).length;

View File

@@ -6,11 +6,11 @@ import { default as Contents } from "./contents";
export class NotebookComponent extends React.Component<{ contentRef: ContentRef }> { export class NotebookComponent extends React.Component<{ contentRef: ContentRef }> {
notificationSystem!: ReactNotificationSystem; notificationSystem!: ReactNotificationSystem;
shouldComponentUpdate(nextProps: { contentRef: ContentRef }): boolean { public override shouldComponentUpdate(nextProps: { contentRef: ContentRef }): boolean {
return nextProps.contentRef !== this.props.contentRef; return nextProps.contentRef !== this.props.contentRef;
} }
public render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="notebookComponentContainer"> <div className="notebookComponentContainer">
<Contents contentRef={this.props.contentRef} /> <Contents contentRef={this.props.contentRef} />

View File

@@ -53,7 +53,7 @@ export class NotebookComponentAdapter extends NotebookComponentBootstrapper impl
}; };
} }
protected renderExtraComponent = (): JSX.Element => { protected override renderExtraComponent = (): JSX.Element => {
return <VirtualCommandBarComponent contentRef={this.contentRef} onRender={this.onUpdateKernelInfo} />; return <VirtualCommandBarComponent contentRef={this.contentRef} onRender={this.onUpdateKernelInfo} />;
}; };
} }

View File

@@ -16,7 +16,7 @@ class VirtualCommandBarComponent extends React.Component<VirtualCommandBarCompon
this.state = {}; this.state = {};
} }
shouldComponentUpdate(nextProps: VirtualCommandBarComponentProps): boolean { public override shouldComponentUpdate(nextProps: VirtualCommandBarComponentProps): boolean {
return ( return (
this.props.kernelStatus !== nextProps.kernelStatus || this.props.kernelStatus !== nextProps.kernelStatus ||
this.props.kernelSpecName !== nextProps.kernelSpecName || this.props.kernelSpecName !== nextProps.kernelSpecName ||
@@ -24,7 +24,7 @@ class VirtualCommandBarComponent extends React.Component<VirtualCommandBarCompon
); );
} }
public render(): JSX.Element { public override render(): JSX.Element {
this.props.onRender && this.props.onRender(); this.props.onRender && this.props.onRender();
return <></>; return <></>;
} }

View File

@@ -55,7 +55,7 @@ export class File extends React.PureComponent<FileProps> {
return choice; return choice;
}; };
render(): JSX.Element { public override render(): JSX.Element {
const choice = this.getChoice(); const choice = this.getChoice();
// Right now we only handle one kind of editor // Right now we only handle one kind of editor

View File

@@ -35,7 +35,7 @@ interface TextFileState {
} }
class EditorPlaceholder extends React.PureComponent<MonacoEditorProps> { class EditorPlaceholder extends React.PureComponent<MonacoEditorProps> {
render(): JSX.Element { public override render(): JSX.Element {
// TODO: Show a little blocky placeholder // TODO: Show a little blocky placeholder
return null; return null;
} }
@@ -53,13 +53,13 @@ export class TextFile extends React.PureComponent<TextFileProps, TextFileState>
this.props.handleChange(source); this.props.handleChange(source);
}; };
componentDidMount(): void { public override componentDidMount(): void {
import(/* webpackChunkName: "monaco-editor" */ "@nteract/monaco-editor").then((module) => { import(/* webpackChunkName: "monaco-editor" */ "@nteract/monaco-editor").then((module) => {
this.setState({ Editor: module.default }); this.setState({ Editor: module.default });
}); });
} }
render(): JSX.Element { public override render(): JSX.Element {
const Editor = this.state.Editor; const Editor = this.state.Editor;
return ( return (

View File

@@ -54,7 +54,7 @@ class Contents extends React.PureComponent<ContentsProps> {
SAVE: ["ctrl+s", "ctrl+shift+s", "meta+s", "meta+shift+s"], SAVE: ["ctrl+s", "ctrl+shift+s", "meta+s", "meta+shift+s"],
}; };
render(): JSX.Element { public override render(): JSX.Element {
const { contentRef, handlers } = this.props; const { contentRef, handlers } = this.props;
if (!contentRef) { if (!contentRef) {

View File

@@ -25,7 +25,7 @@ export interface NotebookRendererProps {
* This is the class that uses nteract to render a read-only notebook. * This is the class that uses nteract to render a read-only notebook.
*/ */
class NotebookReadOnlyRenderer extends React.Component<NotebookRendererProps> { class NotebookReadOnlyRenderer extends React.Component<NotebookRendererProps> {
componentDidMount() { public override componentDidMount() {
if (!userContext.features.sandboxNotebookOutputs) { if (!userContext.features.sandboxNotebookOutputs) {
loadTransform(this.props as any); loadTransform(this.props as any);
} }
@@ -54,7 +54,7 @@ class NotebookReadOnlyRenderer extends React.Component<NotebookRendererProps> {
); );
} }
render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<div className="NotebookReadOnlyRender"> <div className="NotebookReadOnlyRender">
<Cells contentRef={this.props.contentRef}> <Cells contentRef={this.props.contentRef}>

View File

@@ -68,22 +68,22 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
}; };
} }
componentDidMount() { public override componentDidMount() {
if (!userContext.features.sandboxNotebookOutputs) { if (!userContext.features.sandboxNotebookOutputs) {
loadTransform(this.props as any); loadTransform(this.props as any);
} }
this.props.updateNotebookParentDomElt(this.props.contentRef, this.notebookRendererRef.current); this.props.updateNotebookParentDomElt(this.props.contentRef, this.notebookRendererRef.current);
} }
componentDidUpdate() { public override componentDidUpdate() {
this.props.updateNotebookParentDomElt(this.props.contentRef, this.notebookRendererRef.current); this.props.updateNotebookParentDomElt(this.props.contentRef, this.notebookRendererRef.current);
} }
componentWillUnmount() { public override componentWillUnmount() {
this.props.updateNotebookParentDomElt(this.props.contentRef, undefined); this.props.updateNotebookParentDomElt(this.props.contentRef, undefined);
} }
render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<> <>
<div className="NotebookRendererContainer"> <div className="NotebookRendererContainer">

View File

@@ -36,7 +36,7 @@ interface DispatchProps {
type Props = StateProps & DispatchProps & ComponentProps; type Props = StateProps & DispatchProps & ComponentProps;
export class PromptPure extends React.Component<Props> { export class PromptPure extends React.Component<Props> {
render() { public override render() {
return ( return (
<div className="nteract-cell-prompt"> <div className="nteract-cell-prompt">
{this.props.children({ {this.props.children({

View File

@@ -45,14 +45,14 @@ const BarContainer = styled.div`
`; `;
export class StatusBar extends React.Component<Props> { export class StatusBar extends React.Component<Props> {
shouldComponentUpdate(nextProps: Props): boolean { public override shouldComponentUpdate(nextProps: Props): boolean {
if (this.props.lastSaved !== nextProps.lastSaved || this.props.kernelStatus !== nextProps.kernelStatus) { if (this.props.lastSaved !== nextProps.lastSaved || this.props.kernelStatus !== nextProps.kernelStatus) {
return true; return true;
} }
return false; return false;
} }
render() { public override render() {
const name = this.props.kernelSpecDisplayName || "Loading..."; const name = this.props.kernelSpecDisplayName || "Loading...";
return ( return (

View File

@@ -37,7 +37,7 @@ interface StateProps {
class BaseToolbar extends React.PureComponent<ComponentProps & DispatchProps & StateProps> { class BaseToolbar extends React.PureComponent<ComponentProps & DispatchProps & StateProps> {
static contextType = CellToolbarContext; static contextType = CellToolbarContext;
render(): JSX.Element { public override render(): JSX.Element {
let items: IContextualMenuItem[] = []; let items: IContextualMenuItem[] = [];
if (this.props.cellType === "code") { if (this.props.cellType === "code") {

View File

@@ -132,7 +132,7 @@ export class PureCellCreator extends React.PureComponent<CellCreatorProps> {
this.props.createCell("code", this.props.above); this.props.createCell("code", this.props.above);
}; };
render() { public override render() {
return ( return (
<CreatorHoverMask> <CreatorHoverMask>
<CreatorHoverRegion> <CreatorHoverRegion>
@@ -171,7 +171,7 @@ class CellCreator extends React.PureComponent<ComponentProps & DispatchProps & S
: createCellBelow({ cellType: type, id, source: "", contentRef }); : createCellBelow({ cellType: type, id, source: "", contentRef });
}; };
render() { public override render() {
return ( return (
<React.Fragment> <React.Fragment>
{this.props.isFirstCell && ( {this.props.isFirstCell && (

View File

@@ -19,7 +19,7 @@ interface StateProps {
* Displays "Cell <index>" * Displays "Cell <index>"
*/ */
class CellLabeler extends React.Component<ComponentProps & StateProps> { class CellLabeler extends React.Component<ComponentProps & StateProps> {
render() { public override render() {
return ( return (
<div className="CellLabeler"> <div className="CellLabeler">
<div className="CellLabel">Cell {this.props.cellIndex + 1}</div> <div className="CellLabel">Cell {this.props.cellIndex + 1}</div>

View File

@@ -20,7 +20,7 @@ interface DispatchProps {
* HoverableCell sets the hovered cell * HoverableCell sets the hovered cell
*/ */
class HoverableCell extends React.Component<ComponentProps & DispatchProps> { class HoverableCell extends React.Component<ComponentProps & DispatchProps> {
render() { public override render() {
return ( return (
<div className="HoverableCell" onMouseEnter={this.props.hover} onMouseLeave={this.props.unHover}> <div className="HoverableCell" onMouseEnter={this.props.hover} onMouseLeave={this.props.unHover}>
{this.props.children} {this.props.children}

View File

@@ -173,11 +173,11 @@ function collectTarget(
export class DraggableCellView extends React.Component<Props & DnDSourceProps & DnDTargetProps, State> { export class DraggableCellView extends React.Component<Props & DnDSourceProps & DnDTargetProps, State> {
el?: HTMLDivElement | null; el?: HTMLDivElement | null;
state = { public override state = {
hoverUpperHalf: true, hoverUpperHalf: true,
}; };
componentDidMount(): void { public override componentDidMount(): void {
const connectDragPreview = this.props.connectDragPreview; const connectDragPreview = this.props.connectDragPreview;
const img = new (window as any).Image(); const img = new (window as any).Image();
@@ -193,7 +193,7 @@ export class DraggableCellView extends React.Component<Props & DnDSourceProps &
focusCell({ id, contentRef }); focusCell({ id, contentRef });
}; };
render() { public override render() {
return this.props.connectDropTarget( return this.props.connectDropTarget(
// Sadly connectDropTarget _has_ to take a React element for a DOM element (no styled-divs) // Sadly connectDropTarget _has_ to take a React element for a DOM element (no styled-divs)
<div> <div>

View File

@@ -47,15 +47,15 @@ export class HijackScroll extends React.Component<Props> {
} }
} }
componentDidUpdate(prevProps: Props) { public override componentDidUpdate(prevProps: Props) {
this.scrollIntoViewIfNeeded(prevProps.focused); this.scrollIntoViewIfNeeded(prevProps.focused);
} }
componentDidMount(): void { public override componentDidMount(): void {
this.scrollIntoViewIfNeeded(); this.scrollIntoViewIfNeeded();
} }
render() { public override render() {
return ( return (
<div <div
onClick={this.props.selectCell} onClick={this.props.selectCell}

View File

@@ -31,18 +31,18 @@ export class KeyboardShortcuts extends React.Component<Props> {
this.keyDown = this.keyDown.bind(this); this.keyDown = this.keyDown.bind(this);
} }
shouldComponentUpdate(nextProps: Props) { public override shouldComponentUpdate(nextProps: Props) {
const newContentRef = this.props.contentRef !== nextProps.contentRef; const newContentRef = this.props.contentRef !== nextProps.contentRef;
const newFocusedCell = this.props.focusedCell !== nextProps.focusedCell; const newFocusedCell = this.props.focusedCell !== nextProps.focusedCell;
const newCellOrder = this.props.cellOrder && this.props.cellOrder.size !== nextProps.cellOrder.size; const newCellOrder = this.props.cellOrder && this.props.cellOrder.size !== nextProps.cellOrder.size;
return newContentRef || newFocusedCell || newCellOrder; return newContentRef || newFocusedCell || newCellOrder;
} }
componentDidMount(): void { public override componentDidMount(): void {
document.addEventListener("keydown", this.keyDown); document.addEventListener("keydown", this.keyDown);
} }
componentWillUnmount(): void { public override componentWillUnmount(): void {
document.removeEventListener("keydown", this.keyDown); document.removeEventListener("keydown", this.keyDown);
} }
@@ -102,7 +102,7 @@ export class KeyboardShortcuts extends React.Component<Props> {
} }
} }
render() { public override render() {
return <React.Fragment>{this.props.children}</React.Fragment>; return <React.Fragment>{this.props.children}</React.Fragment>;
} }
} }

View File

@@ -54,7 +54,7 @@ export const Source = styled(BareSource)`
width: -moz-available; width: -moz-available;
`; `;
export class PureMarkdownCell extends React.Component<ComponentProps & DispatchProps & StateProps> { export class PureMarkdownCell extends React.Component<ComponentProps & DispatchProps & StateProps> {
render() { public override render() {
const { contentRef, id, cell, children } = this.props; const { contentRef, id, cell, children } = this.props;
const { isEditorFocused, isCellFocused, markdownOptions } = this.props; const { isEditorFocused, isCellFocused, markdownOptions } = this.props;

View File

@@ -33,7 +33,7 @@ interface DispatchProps {
export class SandboxOutputs extends React.PureComponent<ComponentProps & StateProps & DispatchProps> { export class SandboxOutputs extends React.PureComponent<ComponentProps & StateProps & DispatchProps> {
private childWindow: Window; private childWindow: Window;
render(): JSX.Element { public override render(): JSX.Element {
// Using min-width to set the width of the iFrame, works around an issue in iOS that can prevent the iFrame from sizing correctly. // Using min-width to set the width of the iFrame, works around an issue in iOS that can prevent the iFrame from sizing correctly.
return ( return (
<IframeResizer <IframeResizer
@@ -72,11 +72,11 @@ export class SandboxOutputs extends React.PureComponent<ComponentProps & StatePr
postRobot.send(this.childWindow, "props", props); postRobot.send(this.childWindow, "props", props);
} }
componentDidMount(): void { public override componentDidMount(): void {
this.sendPropsToFrame(); this.sendPropsToFrame();
} }
componentDidUpdate(): void { public override componentDidUpdate(): void {
this.sendPropsToFrame(); this.sendPropsToFrame();
} }
} }

View File

@@ -46,7 +46,7 @@ export class SchemaAnalyzerComponent extends React.Component<
}; };
} }
componentDidMount(): void { public override componentDidMount(): void {
loadTransform(this.props); loadTransform(this.props);
} }
@@ -78,7 +78,7 @@ export class SchemaAnalyzerComponent extends React.Component<
this.props.runCell(this.props.contentRef, this.props.firstCellId); this.props.runCell(this.props.contentRef, this.props.firstCellId);
}; };
render(): JSX.Element { public override render(): JSX.Element {
const { firstCellId: id, contentRef, kernelStatus, outputs } = this.props; const { firstCellId: id, contentRef, kernelStatus, outputs } = this.props;
if (!id) { if (!id) {
return <></>; return <></>;

View File

@@ -71,7 +71,7 @@ export class SchemaAnalyzerComponentAdapter extends NotebookComponentBootstrappe
} }
} }
public renderComponent(): JSX.Element { public override renderComponent(): JSX.Element {
const props = { const props = {
contentRef: this.contentRef, contentRef: this.contentRef,
kernelRef: this.kernelRef, kernelRef: this.kernelRef,

View File

@@ -36,7 +36,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
public collectionWithThroughputInShared: ko.Observable<boolean>; public collectionWithThroughputInShared: ko.Observable<boolean>;
public databaseCreateNewShared: ko.Observable<boolean>; public databaseCreateNewShared: ko.Observable<boolean>;
public databaseHasSharedOffer: ko.Observable<boolean>; public databaseHasSharedOffer: ko.Observable<boolean>;
public formErrorsDetails: ko.Observable<string>; public override formErrorsDetails: ko.Observable<string>;
public formWarnings: ko.Observable<string>; public formWarnings: ko.Observable<string>;
public partitionKey: ko.Observable<string>; public partitionKey: ko.Observable<string>;
public partitionKeyName: ko.Computed<string>; public partitionKeyName: ko.Computed<string>;
@@ -658,7 +658,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
return true; return true;
}; };
public async open(databaseId?: string) { public override async open(databaseId?: string) {
super.open(); super.open();
// TODO: Figure out if a database level partition split is about to happen once shared throughput read is available // TODO: Figure out if a database level partition split is about to happen once shared throughput read is available
this.formWarnings(""); this.formWarnings("");
@@ -752,7 +752,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
return this._getThroughput(); return this._getThroughput();
} }
public submit() { public override submit() {
if (!this.isValid()) { if (!this.isValid()) {
return; return;
} }
@@ -912,7 +912,7 @@ export default class AddCollectionPane extends ContextualPaneBase {
); );
} }
public resetData() { public override resetData() {
this.collectionId(""); this.collectionId("");
this.databaseId(""); this.databaseId("");
this.partitionKey(""); this.partitionKey("");

View File

@@ -91,7 +91,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
}; };
} }
render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<form className="panelFormWrapper" onSubmit={this.submit.bind(this)}> <form className="panelFormWrapper" onSubmit={this.submit.bind(this)}>
{this.state.errorMessage && ( {this.state.errorMessage && (

View File

@@ -23,7 +23,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
public databaseIdTooltipText: ko.Computed<string>; public databaseIdTooltipText: ko.Computed<string>;
public databaseLevelThroughputTooltipText: ko.Computed<string>; public databaseLevelThroughputTooltipText: ko.Computed<string>;
public databaseCreateNewShared: ko.Observable<boolean>; public databaseCreateNewShared: ko.Observable<boolean>;
public formErrorsDetails: ko.Observable<string>; public override formErrorsDetails: ko.Observable<string>;
public throughput: ViewModels.Editable<number>; public throughput: ViewModels.Editable<number>;
public maxThroughputRU: ko.Observable<number>; public maxThroughputRU: ko.Observable<number>;
public minThroughputRU: ko.Observable<number>; public minThroughputRU: ko.Observable<number>;
@@ -255,7 +255,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
return true; return true;
}; };
public open() { public override open() {
super.open(); super.open();
this.resetData(); this.resetData();
const addDatabasePaneOpenMessage = { const addDatabasePaneOpenMessage = {
@@ -272,7 +272,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
TelemetryProcessor.trace(Action.CreateDatabase, ActionModifiers.Open, addDatabasePaneOpenMessage); TelemetryProcessor.trace(Action.CreateDatabase, ActionModifiers.Open, addDatabasePaneOpenMessage);
} }
public submit() { public override submit() {
if (!this._isValid()) { if (!this._isValid()) {
return; return;
} }
@@ -317,7 +317,7 @@ export default class AddDatabasePane extends ContextualPaneBase {
); );
} }
public resetData() { public override resetData() {
this.databaseId(""); this.databaseId("");
this.databaseCreateNewShared(this.getSharedThroughputDefault()); this.databaseCreateNewShared(this.getSharedThroughputDefault());
this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled()); this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled());

View File

@@ -279,7 +279,7 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
} }
} }
public open() { public override open() {
super.open(); super.open();
if (!this.container.isServerlessEnabled()) { if (!this.container.isServerlessEnabled()) {
this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled()); this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled());
@@ -306,7 +306,7 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
TelemetryProcessor.trace(Action.CreateCollection, ActionModifiers.Open, addCollectionPaneOpenMessage); TelemetryProcessor.trace(Action.CreateCollection, ActionModifiers.Open, addCollectionPaneOpenMessage);
} }
public submit() { public override submit() {
if (!this._isValid()) { if (!this._isValid()) {
return; return;
} }
@@ -436,7 +436,7 @@ export default class CassandraAddCollectionPane extends ContextualPaneBase {
); );
} }
public resetData() { public override resetData() {
super.resetData(); super.resetData();
const throughputDefaults = this.container.collectionCreationDefaults.throughput; const throughputDefaults = this.container.collectionCreationDefaults.throughput;
this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled()); this.isAutoPilotSelected(this.container.isAutoscaleDefaultEnabled());

View File

@@ -98,7 +98,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
this.junoClient = this.props.junoClientProp; this.junoClient = this.props.junoClientProp;
} }
componentDidMount(): void { public override componentDidMount(): void {
this.open(); this.open();
} }
@@ -431,7 +431,7 @@ export class GitHubReposPanel extends React.Component<IGitHubReposPanelProps, IG
this.props.explorer.notebookManager?.gitHubOAuthService.startOAuth(scope); this.props.explorer.notebookManager?.gitHubOAuthService.startOAuth(scope);
} }
render(): JSX.Element { public override render(): JSX.Element {
return ( return (
<form className="panelFormWrapper"> <form className="panelFormWrapper">
{this.state.errorMessage && ( {this.state.errorMessage && (

View File

@@ -61,7 +61,7 @@ export default class GraphStylingPane extends ContextualPaneBase {
this.remoteConfig = config; this.remoteConfig = config;
} }
public close() { public override close() {
this.remoteConfig = null; this.remoteConfig = null;
super.close(); super.close();
} }

View File

@@ -27,15 +27,15 @@ export class PanelContainerComponent extends React.Component<PanelContainerProps
}; };
} }
componentDidMount(): void { public override componentDidMount(): void {
window.addEventListener("resize", () => this.setState({ height: this.getPanelHeight() })); window.addEventListener("resize", () => this.setState({ height: this.getPanelHeight() }));
} }
componentWillUnmount(): void { public override componentWillUnmount(): void {
window.removeEventListener("resize", () => this.setState({ height: this.getPanelHeight() })); window.removeEventListener("resize", () => this.setState({ height: this.getPanelHeight() }));
} }
render(): JSX.Element { public override render(): JSX.Element {
if (!this.props.panelContent) { if (!this.props.panelContent) {
return <></>; return <></>;
} }

View File

@@ -51,7 +51,7 @@ class KeyValidator implements ValueValidator {
class BooleanValueValidator extends ValueValidator { class BooleanValueValidator extends ValueValidator {
private detailedHelp = "Enter true or false."; // localize private detailedHelp = "Enter true or false."; // localize
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var success: boolean = false; var success: boolean = false;
var help: string = noHelp; var help: string = noHelp;
@@ -66,7 +66,7 @@ class BooleanValueValidator extends ValueValidator {
return { isInvalid: !success, help: help }; return { isInvalid: !success, help: help };
} }
public parseValue(value: string): boolean { public override parseValue(value: string): boolean {
// OData seems to require lowercase boolean values, see http://www.odata.org/documentation/odata-version-2-0/overview/ // OData seems to require lowercase boolean values, see http://www.odata.org/documentation/odata-version-2-0/overview/
return value.toString().toLowerCase() === "true"; return value.toString().toLowerCase() === "true";
} }
@@ -75,7 +75,7 @@ class BooleanValueValidator extends ValueValidator {
class DateTimeValueValidator extends ValueValidator { class DateTimeValueValidator extends ValueValidator {
private detailedHelp = "Enter a date and time."; // localize private detailedHelp = "Enter a date and time."; // localize
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var success: boolean = false; var success: boolean = false;
var help: string = noHelp; var help: string = noHelp;
@@ -93,7 +93,7 @@ class DateTimeValueValidator extends ValueValidator {
return { isInvalid: !success, help: help }; return { isInvalid: !success, help: help };
} }
public parseValue(value: string): Date { public override parseValue(value: string): Date {
var millisecondTime = Date.parse(value); var millisecondTime = Date.parse(value);
var parsed: Date = new Date(millisecondTime); var parsed: Date = new Date(millisecondTime);
@@ -104,7 +104,7 @@ class DateTimeValueValidator extends ValueValidator {
class DoubleValueValidator extends ValueValidator { class DoubleValueValidator extends ValueValidator {
private detailedHelp = "Enter a 64-bit floating point value."; // localize private detailedHelp = "Enter a 64-bit floating point value."; // localize
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var success: boolean = false; var success: boolean = false;
var help: string = noHelp; var help: string = noHelp;
@@ -119,7 +119,7 @@ class DoubleValueValidator extends ValueValidator {
return { isInvalid: !success, help: help }; return { isInvalid: !success, help: help };
} }
public parseValue(value: string): number { public override parseValue(value: string): number {
return parseFloat(value); return parseFloat(value);
} }
} }
@@ -127,7 +127,7 @@ class DoubleValueValidator extends ValueValidator {
class GuidValueValidator extends ValueValidator { class GuidValueValidator extends ValueValidator {
private detailedHelp = "Enter a 16-byte (128-bit) GUID value."; // localize private detailedHelp = "Enter a 16-byte (128-bit) GUID value."; // localize
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var success: boolean = false; var success: boolean = false;
var help: string = noHelp; var help: string = noHelp;
@@ -155,7 +155,7 @@ class IntegerValueValidator extends ValueValidator {
this.isInt64 = isInt64; this.isInt64 = isInt64;
} }
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var success: boolean = false; var success: boolean = false;
var help: string = noHelp; var help: string = noHelp;
@@ -180,7 +180,7 @@ class IntegerValueValidator extends ValueValidator {
return { isInvalid: !success, help: help }; return { isInvalid: !success, help: help };
} }
public parseValue(value: string): number { public override parseValue(value: string): number {
return parseInt(value, 10); return parseInt(value, 10);
} }
} }
@@ -198,7 +198,7 @@ class StringValidator extends ValueValidator {
this.isRequired = isRequired; this.isRequired = isRequired;
} }
public validate(value: string): IValidationResult { public override validate(value: string): IValidationResult {
var help: string = this.isRequired ? this.isRequiredHelp : this.detailedHelp; var help: string = this.isRequired ? this.isRequiredHelp : this.detailedHelp;
if (value === null) { if (value === null) {
return { isInvalid: false, help: help }; return { isInvalid: false, help: help };
@@ -219,7 +219,7 @@ class StringValidator extends ValueValidator {
return { isInvalid: !success, help: help }; return { isInvalid: !success, help: help };
} }
public parseValue(value: string): string { public override parseValue(value: string): string {
return String(value); // Ensure value is converted to string. return String(value); // Ensure value is converted to string.
} }
} }
@@ -233,12 +233,12 @@ class NotSupportedValidator extends ValueValidator {
this.type = type; this.type = type;
} }
public validate(ignoredValue: string): IValidationResult { public override validate(ignoredValue: string): IValidationResult {
//throw new Errors.NotSupportedError(this.getMessage()); //throw new Errors.NotSupportedError(this.getMessage());
return null; return null;
} }
public parseValue(ignoredValue: string): any { public override parseValue(ignoredValue: string): any {
//throw new Errors.NotSupportedError(this.getMessage()); //throw new Errors.NotSupportedError(this.getMessage());
return null; return null;
} }

View File

@@ -50,13 +50,13 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
this.subscriptions = []; this.subscriptions = [];
} }
public componentWillUnmount() { public override componentWillUnmount() {
while (this.subscriptions.length) { while (this.subscriptions.length) {
this.subscriptions.pop().dispose(); this.subscriptions.pop().dispose();
} }
} }
public componentDidMount() { public override componentDidMount() {
this.subscriptions.push( this.subscriptions.push(
this.container.selectedNode.subscribe(() => this.setState({})), this.container.selectedNode.subscribe(() => this.setState({})),
this.container.isNotebookEnabled.subscribe(() => this.setState({})) this.container.isNotebookEnabled.subscribe(() => this.setState({}))
@@ -68,7 +68,7 @@ export class SplashScreen extends React.Component<SplashScreenProps> {
this.setState({}); this.setState({});
}; };
public render(): JSX.Element { public override render(): JSX.Element {
const mainItems = this.createMainItems(); const mainItems = this.createMainItems();
const commonTaskItems = this.createCommonTaskItems(); const commonTaskItems = this.createCommonTaskItems();
const recentItems = this.createRecentItems(); const recentItems = this.createRecentItems();

View File

@@ -107,7 +107,7 @@ export default class TableEntityListViewModel extends DataTableViewModel {
public cqlQuery: ko.Observable<string>; public cqlQuery: ko.Observable<string>;
public oDataQuery: ko.Observable<string>; public oDataQuery: ko.Observable<string>;
public sqlQuery: ko.Observable<string>; public sqlQuery: ko.Observable<string>;
public cache: TableEntityCache; public override cache: TableEntityCache;
public isCancelled: boolean = false; public isCancelled: boolean = false;
public queryErrorMessage: ko.Observable<string>; public queryErrorMessage: ko.Observable<string>;
public id: string; public id: string;
@@ -386,7 +386,7 @@ export default class TableEntityListViewModel extends DataTableViewModel {
/** /**
* @override * @override
*/ */
protected matchesKeys(item: Entities.ITableEntity, itemKeys: Entities.IProperty[]): boolean { protected override matchesKeys(item: Entities.ITableEntity, itemKeys: Entities.IProperty[]): boolean {
return itemKeys.every((property: Entities.IProperty) => { return itemKeys.every((property: Entities.IProperty) => {
return this.stringCompare(item[property.key]._, property.value); return this.stringCompare(item[property.key]._, property.value);
}); });

View File

@@ -415,12 +415,12 @@ export default class ConflictsTab extends TabsBase {
return Q(); return Q();
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Conflicts); this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Conflicts);
} }
public async onActivate(): Promise<void> { public override async onActivate(): Promise<void> {
super.onActivate(); super.onActivate();
if (!this._documentsIterator) { if (!this._documentsIterator) {
@@ -587,7 +587,7 @@ export default class ConflictsTab extends TabsBase {
return Q(); return Q();
} }
protected getTabsButtons(): CommandButtonComponentProps[] { protected override getTabsButtons(): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
const label = this._acceptButtonLabel(); const label = this._acceptButtonLabel();
if (this.acceptChangesButton.visible()) { if (this.acceptChangesButton.visible()) {

View File

@@ -583,12 +583,12 @@ export default class DocumentsTab extends TabsBase {
return Q(); return Q();
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Documents); this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Documents);
} }
public async onActivate(): Promise<void> { public async override onActivate(): Promise<void> {
super.onActivate(); super.onActivate();
if (!this._documentsIterator) { if (!this._documentsIterator) {
@@ -788,7 +788,7 @@ export default class DocumentsTab extends TabsBase {
return QueryUtils.buildDocumentsQuery(filter, this.partitionKeyProperty, this.partitionKey); return QueryUtils.buildDocumentsQuery(filter, this.partitionKeyProperty, this.partitionKey);
} }
protected getTabsButtons(): CommandButtonComponentProps[] { protected override getTabsButtons(): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
const label = !this.isPreferredApiMongoDB ? "New Item" : "New Document"; const label = !this.isPreferredApiMongoDB ? "New Item" : "New Document";
if (this.newDocumentButton.visible()) { if (this.newDocumentButton.visible()) {

View File

@@ -27,7 +27,7 @@ export default class GalleryTab extends TabsBase {
return <GalleryViewer {...this.props} sortBy={SortBy.MostRecent} searchText={undefined} />; return <GalleryViewer {...this.props} sortBy={SortBy.MostRecent} searchText={undefined} />;
} }
public getContainer(): Explorer { public override getContainer(): Explorer {
return this.props.container; return this.props.container;
} }
} }

View File

@@ -126,7 +126,7 @@ export default class GraphTab extends TabsBase {
); );
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Graph); this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Graph);
} }
@@ -226,7 +226,7 @@ export default class GraphTab extends TabsBase {
this.graphConfigUiData.nodeIconChoice(this.graphConfigUiData.nodePropertiesWithNone()[0]); this.graphConfigUiData.nodeIconChoice(this.graphConfigUiData.nodePropertiesWithNone()[0]);
} }
} }
protected getTabsButtons(): CommandButtonComponentProps[] { protected override getTabsButtons(): CommandButtonComponentProps[] {
const label = "New Vertex"; const label = "New Vertex";
const buttons: CommandButtonComponentProps[] = [ const buttons: CommandButtonComponentProps[] = [
{ {

View File

@@ -21,7 +21,7 @@ import ObjectId from "../Tree/ObjectId";
import DocumentsTab from "./DocumentsTab"; import DocumentsTab from "./DocumentsTab";
export default class MongoDocumentsTab extends DocumentsTab { export default class MongoDocumentsTab extends DocumentsTab {
public collection: ViewModels.Collection; public override collection: ViewModels.Collection;
private continuationToken: string; private continuationToken: string;
constructor(options: ViewModels.DocumentsTabOptions) { constructor(options: ViewModels.DocumentsTabOptions) {
@@ -43,7 +43,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
super.buildCommandBarOptions(); super.buildCommandBarOptions();
} }
public onSaveNewDocumentClick = (): Promise<any> => { public override onSaveNewDocumentClick = (): Promise<any> => {
const documentContent = JSON.parse(this.selectedDocumentContent()); const documentContent = JSON.parse(this.selectedDocumentContent());
this.displayedError(""); this.displayedError("");
const startKey: number = TelemetryProcessor.traceStart(Action.CreateDocument, { const startKey: number = TelemetryProcessor.traceStart(Action.CreateDocument, {
@@ -127,7 +127,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
.finally(() => this.isExecuting(false)); .finally(() => this.isExecuting(false));
}; };
public onSaveExisitingDocumentClick = (): Promise<any> => { public override onSaveExisitingDocumentClick = (): Promise<any> => {
const selectedDocumentId = this.selectedDocumentId(); const selectedDocumentId = this.selectedDocumentId();
const documentContent = this.selectedDocumentContent(); const documentContent = this.selectedDocumentContent();
this.isExecutionError(false); this.isExecutionError(false);
@@ -185,17 +185,17 @@ export default class MongoDocumentsTab extends DocumentsTab {
.finally(() => this.isExecuting(false)); .finally(() => this.isExecuting(false));
}; };
public buildQuery(filter: string): string { public override buildQuery(filter: string): string {
return filter || "{}"; return filter || "{}";
} }
public async selectDocument(documentId: DocumentId): Promise<void> { public override async selectDocument(documentId: DocumentId): Promise<void> {
this.selectedDocumentId(documentId); this.selectedDocumentId(documentId);
const content = await readDocument(this.collection.databaseId, this.collection, documentId); const content = await readDocument(this.collection.databaseId, this.collection, documentId);
this.initDocumentEditor(documentId, content); this.initDocumentEditor(documentId, content);
} }
public loadNextPage(): Q.Promise<any> { public override loadNextPage(): Q.Promise<any> {
this.isExecuting(true); this.isExecuting(true);
this.isExecutionError(false); this.isExecutionError(false);
const filter: string = this.filterContent().trim(); const filter: string = this.filterContent().trim();
@@ -264,7 +264,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
.finally(() => this.isExecuting(false)); .finally(() => this.isExecuting(false));
} }
protected _onEditorContentChange(newContent: string) { protected override _onEditorContentChange(newContent: string) {
try { try {
if ( if (
this.editorState() === ViewModels.DocumentExplorerState.newDocumentValid || this.editorState() === ViewModels.DocumentExplorerState.newDocumentValid ||
@@ -281,7 +281,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
} }
/** Renders a Javascript object to be displayed inside Monaco Editor */ /** Renders a Javascript object to be displayed inside Monaco Editor */
protected renderObjectForEditor(value: any, replacer: any, space: string | number): string { protected override renderObjectForEditor(value: any, replacer: any, space: string | number): string {
return MongoUtility.tojson(value, null, false); return MongoUtility.tojson(value, null, false);
} }
@@ -310,7 +310,7 @@ export default class MongoDocumentsTab extends DocumentsTab {
return partitionKey; return partitionKey;
} }
protected __deleteDocument(documentId: DocumentId): Promise<void> { protected override __deleteDocument(documentId: DocumentId): Promise<void> {
return deleteDocument(this.collection.databaseId, this.collection, documentId); return deleteDocument(this.collection.databaseId, this.collection, documentId);
} }
} }

View File

@@ -7,7 +7,7 @@ import { queryIterator } from "../../Common/MongoProxyClient";
import { MinimalQueryIterator } from "../../Common/IteratorUtilities"; import { MinimalQueryIterator } from "../../Common/IteratorUtilities";
export default class MongoQueryTab extends QueryTab { export default class MongoQueryTab extends QueryTab {
public collection: ViewModels.Collection; public override collection: ViewModels.Collection;
constructor(options: ViewModels.QueryTabOptions) { constructor(options: ViewModels.QueryTabOptions) {
options.queryText = ""; // override sql query editor content for now so we only display mongo related help items options.queryText = ""; // override sql query editor content for now so we only display mongo related help items
@@ -16,11 +16,11 @@ export default class MongoQueryTab extends QueryTab {
this.monacoSettings = new ViewModels.MonacoEditorSettings("plaintext", false); this.monacoSettings = new ViewModels.MonacoEditorSettings("plaintext", false);
} }
/** Renders a Javascript object to be displayed inside Monaco Editor */ /** Renders a Javascript object to be displayed inside Monaco Editor */
protected renderObjectForEditor(value: any, replacer: any, space: string | number): string { protected override renderObjectForEditor(value: any, replacer: any, space: string | number): string {
return MongoUtility.tojson(value, null, false); return MongoUtility.tojson(value, null, false);
} }
protected _initIterator(): Q.Promise<MinimalQueryIterator> { protected override _initIterator(): Q.Promise<MinimalQueryIterator> {
let options: any = {}; let options: any = {};
options.enableCrossPartitionQuery = HeadersUtility.shouldEnableCrossPartitionKey(); options.enableCrossPartitionQuery = HeadersUtility.shouldEnableCrossPartitionKey();
this._iterator = queryIterator(this.collection.databaseId, this.collection, this.sqlStatementToExecute()); this._iterator = queryIterator(this.collection.databaseId, this.collection, this.sqlStatementToExecute());

View File

@@ -51,7 +51,7 @@ export default class MongoShellTab extends TabsBase {
// } // }
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Documents); this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Documents);
} }

View File

@@ -39,7 +39,7 @@ export default class NotebookTabBase extends TabsBase {
/** /**
* Override base behavior * Override base behavior
*/ */
public getContainer(): Explorer { public override getContainer(): Explorer {
return this.container; return this.container;
} }

View File

@@ -62,7 +62,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
}); });
} }
public onCloseTabButtonClick(): Q.Promise<any> { public override onCloseTabButtonClick(): Q.Promise<any> {
const cleanup = () => { const cleanup = () => {
this.notebookComponentAdapter.notebookShutdown(); this.notebookComponentAdapter.notebookShutdown();
super.onCloseTabButtonClick(); super.onCloseTabButtonClick();
@@ -92,7 +92,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
return await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()); return await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName());
} }
protected getTabsButtons(): CommandButtonComponentProps[] { public override getTabsButtons(): CommandButtonComponentProps[] {
const availableKernels = NotebookTabV2.clientManager.getAvailableKernelSpecs(); const availableKernels = NotebookTabV2.clientManager.getAvailableKernelSpecs();
const saveLabel = "Save"; const saveLabel = "Save";

View File

@@ -41,7 +41,7 @@ export default class QueryTab extends TabsBase implements ViewModels.WaitsForTem
public allResultsMetadata: ko.ObservableArray<ViewModels.QueryResultsMetadata>; public allResultsMetadata: ko.ObservableArray<ViewModels.QueryResultsMetadata>;
public showingDocumentsDisplayText: ko.Observable<string>; public showingDocumentsDisplayText: ko.Observable<string>;
public requestChargeDisplayText: ko.Observable<string>; public requestChargeDisplayText: ko.Observable<string>;
public isTemplateReady: ko.Observable<boolean>; public override isTemplateReady: ko.Observable<boolean>;
public splitterId: string; public splitterId: string;
public splitter: Splitter; public splitter: Splitter;
public isPreferredApiMongoDB: boolean; public isPreferredApiMongoDB: boolean;
@@ -165,7 +165,7 @@ export default class QueryTab extends TabsBase implements ViewModels.WaitsForTem
this._buildCommandBarOptions(); this._buildCommandBarOptions();
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Query); this.collection && this.collection.selectedSubnodeKind(ViewModels.CollectionTabKind.Query);
} }
@@ -197,13 +197,13 @@ export default class QueryTab extends TabsBase implements ViewModels.WaitsForTem
await this._executeQueryDocumentsPage(firstResultIndex + itemCount - 1); await this._executeQueryDocumentsPage(firstResultIndex + itemCount - 1);
} }
public onErrorDetailsClick = (src: any, event: MouseEvent): boolean => { public override onErrorDetailsClick = (src: any, event: MouseEvent): boolean => {
this.collection && this.collection.container.expandConsole(); this.collection && this.collection.container.expandConsole();
return false; return false;
}; };
public onErrorDetailsKeyPress = (src: any, event: KeyboardEvent): boolean => { public override onErrorDetailsKeyPress = (src: any, event: KeyboardEvent): boolean => {
if (event.keyCode === Constants.KeyCodes.Space || event.keyCode === Constants.KeyCodes.Enter) { if (event.keyCode === Constants.KeyCodes.Space || event.keyCode === Constants.KeyCodes.Enter) {
this.onErrorDetailsClick(src, null); this.onErrorDetailsClick(src, null);
return false; return false;
@@ -553,7 +553,7 @@ export default class QueryTab extends TabsBase implements ViewModels.WaitsForTem
return csvData; return csvData;
} }
protected getTabsButtons(): CommandButtonComponentProps[] { public override getTabsButtons(): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
if (this.executeQueryButton.visible()) { if (this.executeQueryButton.visible()) {
const label = this._executeQueryButtonTitle(); const label = this._executeQueryButtonTitle();

View File

@@ -20,7 +20,7 @@ import TabsBase from "./TabsBase";
// Will act as table explorer class // Will act as table explorer class
export default class QueryTablesTab extends TabsBase { export default class QueryTablesTab extends TabsBase {
public readonly html = template; public readonly html = template;
public collection: ViewModels.Collection; public override collection: ViewModels.Collection;
public tableEntityListViewModel = ko.observable<TableEntityListViewModel>(); public tableEntityListViewModel = ko.observable<TableEntityListViewModel>();
public queryViewModel = ko.observable<QueryViewModel>(); public queryViewModel = ko.observable<QueryViewModel>();
public tableCommands: TableCommands; public tableCommands: TableCommands;
@@ -160,7 +160,7 @@ export default class QueryTablesTab extends TabsBase {
return null; return null;
}; };
public onActivate(): void { public override onActivate(): void {
super.onActivate(); super.onActivate();
const columns = const columns =
!!this.tableEntityListViewModel() && !!this.tableEntityListViewModel() &&
@@ -172,7 +172,7 @@ export default class QueryTablesTab extends TabsBase {
} }
} }
protected getTabsButtons(): CommandButtonComponentProps[] { protected override getTabsButtons(): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
if (this.queryBuilderButton.visible()) { if (this.queryBuilderButton.visible()) {
const label = userContext.apiType === "Cassandra" ? "CQL Query Builder" : "Query Builder"; const label = userContext.apiType === "Cassandra" ? "CQL Query Builder" : "Query Builder";

View File

@@ -31,7 +31,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
public isNew: ko.Observable<boolean>; public isNew: ko.Observable<boolean>;
// TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct. // TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct.
public resource: ko.Observable<any>; public resource: ko.Observable<any>;
public isTemplateReady: ko.Observable<boolean>; public override isTemplateReady: ko.Observable<boolean>;
protected _partitionKey: DataModels.PartitionKey; protected _partitionKey: DataModels.PartitionKey;
constructor(options: ViewModels.ScriptTabOption) { constructor(options: ViewModels.ScriptTabOption) {
@@ -186,7 +186,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
this._setBaselines(); this._setBaselines();
} }
public onTabClick(): void { public override onTabClick(): void {
super.onTabClick(); super.onTabClick();
if (this.isNew()) { if (this.isNew()) {
this.collection.selectedSubnodeKind(this.tabKind); this.collection.selectedSubnodeKind(this.tabKind);
@@ -215,7 +215,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
return undefined; return undefined;
} }
protected getTabsButtons(): CommandButtonComponentProps[] { protected override getTabsButtons(): CommandButtonComponentProps[] {
const buttons: CommandButtonComponentProps[] = []; const buttons: CommandButtonComponentProps[] = [];
const label = "Save"; const label = "Save";
if (this.saveButton.visible()) { if (this.saveButton.visible()) {

Some files were not shown because too many files have changed in this diff Show More