mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-25 03:41:19 +00:00
Compare commits
2 Commits
eslint/fix
...
fix_eslint
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
244f3ff273 | ||
|
|
ed1ffb692f |
@@ -48,9 +48,11 @@ src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.test.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/ArraysByKeyCache.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.test.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.test.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GraphData.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.test.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GremlinClient.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.test.ts
|
||||
src/Explorer/Graph/GraphExplorerComponent/GremlinSimpleClient.ts
|
||||
src/Explorer/Menus/ContextMenu.ts
|
||||
@@ -102,9 +104,10 @@ src/Explorer/Tabs/MongoDocumentsTab.ts
|
||||
src/Explorer/Tabs/NotebookV2Tab.ts
|
||||
src/Explorer/Tabs/ScriptTabBase.ts
|
||||
src/Explorer/Tabs/TabComponents.ts
|
||||
src/Explorer/Tabs/TabsBase.ts
|
||||
# src/Explorer/Tabs/TabsBase.ts
|
||||
src/Explorer/Tabs/TriggerTab.ts
|
||||
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
||||
src/Explorer/Tree/AccessibleVerticalList.ts
|
||||
src/Explorer/Tree/Collection.ts
|
||||
src/Explorer/Tree/ConflictId.ts
|
||||
src/Explorer/Tree/DocumentId.ts
|
||||
@@ -129,7 +132,7 @@ src/Shared/DefaultExperienceUtility.ts
|
||||
src/Shared/appInsights.ts
|
||||
src/SparkClusterManager/ArcadiaResourceManager.ts
|
||||
src/SparkClusterManager/SparkClusterManager.ts
|
||||
src/Terminal/JupyterLabAppFactory.ts
|
||||
# src/Terminal/JupyterLabAppFactory.ts
|
||||
src/Terminal/NotebookAppContracts.d.ts
|
||||
src/applyExplorerBindings.ts
|
||||
src/global.d.ts
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/**
|
||||
* Wrapper around GremlinSimpleClient using Q promises and tailored to cosmosdb authentication
|
||||
*/
|
||||
@@ -56,7 +55,7 @@ export class GremlinClient {
|
||||
this.flushResult(result.requestId);
|
||||
}
|
||||
},
|
||||
failureCallback: (result: Result, error: string) => {
|
||||
failureCallback: (result: Result, error: any) => {
|
||||
const errorMessage = getErrorMessage(error);
|
||||
const requestId = result.requestId;
|
||||
|
||||
@@ -69,7 +68,7 @@ export class GremlinClient {
|
||||
// Fail all pending requests if no request id (fatal)
|
||||
if (!requestId) {
|
||||
for (const reqId of this.pendingResults.keys()) {
|
||||
this.abortPendingRequest(reqId, errorMessage, undefined);
|
||||
this.abortPendingRequest(reqId, errorMessage, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -90,7 +89,7 @@ export class GremlinClient {
|
||||
},
|
||||
deferred: deferred,
|
||||
timeoutId: window.setTimeout(
|
||||
() => this.abortPendingRequest(requestId, GremlinClient.TIMEOUT_ERROR_MSG, undefined),
|
||||
() => this.abortPendingRequest(requestId, GremlinClient.TIMEOUT_ERROR_MSG, null),
|
||||
GremlinClient.PENDING_REQUEST_TIMEOUT_MS
|
||||
),
|
||||
});
|
||||
@@ -102,7 +101,7 @@ export class GremlinClient {
|
||||
return;
|
||||
}
|
||||
this.client.close();
|
||||
this.client = undefined;
|
||||
this.client = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,8 +110,7 @@ export class GremlinClient {
|
||||
* @return request charge or empty string
|
||||
*/
|
||||
public static getRequestChargeString(requestCharge: string | number): string {
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
return requestCharge === undefined || requestCharge === null ? "" : `(${requestCharge} RUs)`;
|
||||
return requestCharge == undefined || requestCharge == null ? "" : `(${requestCharge} RUs)`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -307,11 +307,18 @@ function createOpenSynapseLinkDialogButton(container: Explorer): CommandButtonCo
|
||||
|
||||
function createNewDatabase(container: Explorer): CommandButtonComponentProps {
|
||||
const label = "New " + getDatabaseName();
|
||||
const newDatabaseButton = document.activeElement as HTMLElement;
|
||||
|
||||
return {
|
||||
iconSrc: AddDatabaseIcon,
|
||||
iconAlt: label,
|
||||
onCommandClick: () =>
|
||||
useSidePanel.getState().openSidePanel("New " + getDatabaseName(), <AddDatabasePanel explorer={container} />),
|
||||
useSidePanel
|
||||
.getState()
|
||||
.openSidePanel(
|
||||
"New " + getDatabaseName(),
|
||||
<AddDatabasePanel explorer={container} buttonElement={newDatabaseButton} />
|
||||
),
|
||||
commandButtonLabel: label,
|
||||
ariaLabel: label,
|
||||
hasPopup: true,
|
||||
|
||||
@@ -44,7 +44,7 @@ function TabNav({ tab, active }: { tab: Tab; active: boolean }) {
|
||||
onMouseOver={() => setHovering(true)}
|
||||
onMouseLeave={() => setHovering(false)}
|
||||
onClick={() => tab.onTabClick()}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onKeyPressActivate(undefined, e)}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onKeyPressActivate(e)}
|
||||
className={active ? "active tabList" : "tabList"}
|
||||
title={useObservable(tab.tabPath)}
|
||||
aria-selected={active}
|
||||
@@ -83,7 +83,7 @@ const CloseButton = ({ tab, active, hovering }: { tab: Tab; active: boolean; hov
|
||||
className="cancelButton"
|
||||
onClick={() => tab.onCloseTabButtonClick()}
|
||||
tabIndex={active ? 0 : undefined}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onKeyPressClose(undefined, e)}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onKeyPressClose(e)}
|
||||
>
|
||||
<span className="tabIcon close-Icon">
|
||||
<img src={errorIcon} title="Close" alt="Close" />
|
||||
@@ -98,8 +98,8 @@ const ErrorIcon = ({ tab, active }: { tab: Tab; active: boolean }) => (
|
||||
title="Click to view more details"
|
||||
tabIndex={active ? 0 : undefined}
|
||||
className={active ? "actionsEnabled errorIconContainer" : "errorIconContainer"}
|
||||
onClick={({ nativeEvent: e }) => tab.onErrorDetailsClick(undefined, e)}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onErrorDetailsKeyPress(undefined, e)}
|
||||
onClick={() => tab.onErrorDetailsClick()}
|
||||
onKeyPress={({ nativeEvent: e }) => tab.onErrorDetailsKeyPress(e)}
|
||||
>
|
||||
<span className="errorIcon" />
|
||||
</div>
|
||||
|
||||
@@ -94,11 +94,11 @@ export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
public onKeyPressActivate = (source: any, event: KeyboardEvent): boolean => {
|
||||
public onKeyPressActivate = (event: KeyboardEvent): boolean => {
|
||||
return this.onSpaceOrEnterKeyPress(event, () => this.onTabClick());
|
||||
};
|
||||
|
||||
public onKeyPressClose = (source: any, event: KeyboardEvent): boolean => {
|
||||
public onKeyPressClose = (event: KeyboardEvent): boolean => {
|
||||
return this.onSpaceOrEnterKeyPress(event, () => this.onCloseTabButtonClick());
|
||||
};
|
||||
|
||||
@@ -120,22 +120,22 @@ export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
public onErrorDetailsClick = (src: any, event: MouseEvent): boolean => {
|
||||
public onErrorDetailsClick = (): boolean => {
|
||||
useNotificationConsole.getState().expandConsole();
|
||||
useNotificationConsole.getState().expandConsole();
|
||||
return false;
|
||||
};
|
||||
|
||||
public onErrorDetailsKeyPress = (src: any, event: KeyboardEvent): boolean => {
|
||||
public onErrorDetailsKeyPress = (event: KeyboardEvent): boolean => {
|
||||
if (event.keyCode === Constants.KeyCodes.Space || event.keyCode === Constants.KeyCodes.Enter) {
|
||||
this.onErrorDetailsClick(src, null);
|
||||
this.onErrorDetailsClick();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
public refresh() {
|
||||
public refresh(): void {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ export default class TabsBase extends WaitsForTemplateViewModel {
|
||||
}
|
||||
|
||||
/** Renders a Javascript object to be displayed inside Monaco Editor */
|
||||
//eslint-disable-next-line
|
||||
public renderObjectForEditor(value: any, replacer: any, space: string | number): string {
|
||||
return JSON.stringify(value, replacer, space);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as ko from "knockout";
|
||||
import * as _ from "underscore";
|
||||
import * as ko from "knockout";
|
||||
|
||||
enum ScrollPosition {
|
||||
Top,
|
||||
@@ -7,25 +7,25 @@ enum ScrollPosition {
|
||||
}
|
||||
|
||||
export class AccessibleVerticalList {
|
||||
private items: unknown[] = [];
|
||||
private onSelect?: (item: unknown) => void;
|
||||
private items: any[] = [];
|
||||
private onSelect?: (item: any) => void;
|
||||
|
||||
public currentItemIndex: ko.Observable<number>;
|
||||
public currentItem: ko.Computed<unknown>;
|
||||
public currentItem: ko.Computed<any>;
|
||||
|
||||
constructor(initialSetOfItems: unknown[]) {
|
||||
constructor(initialSetOfItems: any[]) {
|
||||
this.items = initialSetOfItems;
|
||||
this.currentItemIndex = this.items !== undefined && this.items.length > 0 ? ko.observable(0) : ko.observable(-1);
|
||||
this.currentItem = ko.computed<unknown>(() => this.items[this.currentItemIndex()]);
|
||||
this.currentItemIndex = this.items != null && this.items.length > 0 ? ko.observable(0) : ko.observable(-1);
|
||||
this.currentItem = ko.computed<any>(() => this.items[this.currentItemIndex()]);
|
||||
}
|
||||
|
||||
public setOnSelect(onSelect: (item: unknown) => void): void {
|
||||
public setOnSelect(onSelect: (item: any) => void): void {
|
||||
this.onSelect = onSelect;
|
||||
}
|
||||
|
||||
public onKeyDown = (_src: unknown, event: KeyboardEvent): boolean => {
|
||||
const targetContainer: Element = <Element>event.target;
|
||||
if (this.items === undefined || this.items.length === 0) {
|
||||
if (this.items == null || this.items.length === 0) {
|
||||
// no items so this should be a noop
|
||||
return true;
|
||||
}
|
||||
@@ -62,8 +62,8 @@ export class AccessibleVerticalList {
|
||||
return true;
|
||||
};
|
||||
|
||||
public updateItemList(newItemList: unknown[]): void {
|
||||
if (newItemList === undefined || newItemList.length === 0) {
|
||||
public updateItemList(newItemList: any[]) {
|
||||
if (newItemList == null || newItemList.length === 0) {
|
||||
this.currentItemIndex(-1);
|
||||
this.items = [];
|
||||
return;
|
||||
@@ -73,7 +73,7 @@ export class AccessibleVerticalList {
|
||||
this.items = newItemList;
|
||||
}
|
||||
|
||||
public updateCurrentItem(item: unknown): void {
|
||||
public updateCurrentItem(item: any) {
|
||||
const updatedIndex: number = this.isItemListEmpty() ? -1 : _.indexOf(this.items, item);
|
||||
this.currentItemIndex(updatedIndex);
|
||||
}
|
||||
@@ -118,6 +118,6 @@ export class AccessibleVerticalList {
|
||||
}
|
||||
|
||||
private isItemListEmpty(): boolean {
|
||||
return this.items === undefined || this.items.length === 0;
|
||||
return this.items == null || this.items.length === 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { ServerConnection, TerminalManager } from "@jupyterlab/services";
|
||||
import { Terminal } from "@jupyterlab/terminal";
|
||||
import { Panel, Widget } from "@phosphor/widgets";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
||||
export class JupyterLabAppFactory {
|
||||
public static async createTerminalApp(serverSettings: ServerConnection.ISettings) {
|
||||
const manager = new TerminalManager({
|
||||
@@ -21,8 +22,8 @@ export class JupyterLabAppFactory {
|
||||
term.title.closable = false;
|
||||
term.addClass("terminalWidget");
|
||||
|
||||
let panel = new Panel();
|
||||
panel.addWidget(term as any);
|
||||
const panel = new Panel();
|
||||
panel.addWidget((term as unknown) as Widget);
|
||||
panel.id = "main";
|
||||
|
||||
// Attach the widget to the dom.
|
||||
|
||||
Reference in New Issue
Block a user