mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 10:51:30 +00:00
Compare commits
1 Commits
eslint/fix
...
eslint/fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ff5efcea4 |
@@ -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
|
||||
@@ -104,7 +106,7 @@ src/Explorer/Tabs/ScriptTabBase.ts
|
||||
src/Explorer/Tabs/TabComponents.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
|
||||
@@ -115,14 +117,12 @@ src/Explorer/Tree/TreeComponents.ts
|
||||
src/Explorer/Tree/Trigger.ts
|
||||
src/Explorer/WaitsForTemplateViewModel.ts
|
||||
src/GitHub/GitHubClient.test.ts
|
||||
src/GitHub/GitHubClient.ts
|
||||
src/GitHub/GitHubConnector.ts
|
||||
src/GitHub/GitHubOAuthService.ts
|
||||
src/Index.ts
|
||||
src/Juno/JunoClient.test.ts
|
||||
src/Juno/JunoClient.ts
|
||||
src/Platform/Hosted/Authorization.ts
|
||||
src/ReactDevTools.ts
|
||||
src/Shared/Constants.ts
|
||||
src/Shared/DefaultExperienceUtility.test.ts
|
||||
src/Shared/DefaultExperienceUtility.ts
|
||||
@@ -154,7 +154,6 @@ src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
|
||||
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
||||
src/Explorer/Notebook/NotebookComponent/contents/index.tsx
|
||||
src/Explorer/Notebook/NotebookRenderer/NotebookReadOnlyRenderer.tsx
|
||||
src/Explorer/Notebook/NotebookRenderer/NotebookRenderer.tsx
|
||||
src/Explorer/Notebook/NotebookRenderer/decorators/draggable/index.tsx
|
||||
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
||||
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
|
||||
|
||||
@@ -37,8 +37,8 @@ module.exports = {
|
||||
global: {
|
||||
branches: 25,
|
||||
functions: 25,
|
||||
lines: 29,
|
||||
statements: 29,
|
||||
lines: 29.5,
|
||||
statements: 29.5,
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -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)`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,12 +31,13 @@ import StatusBar from "./StatusBar";
|
||||
import CellToolbar from "./Toolbar";
|
||||
|
||||
export interface NotebookRendererBaseProps {
|
||||
contentRef: any;
|
||||
contentRef: ContentRef;
|
||||
}
|
||||
|
||||
interface NotebookRendererDispatchProps {
|
||||
storeNotebookSnapshot: (imageSrc: string, requestId: string) => void;
|
||||
notebookSnapshotError: (error: string) => void;
|
||||
addTransform: (transform: React.ComponentType & { MIMETYPE: string }) => void;
|
||||
}
|
||||
|
||||
interface StateProps {
|
||||
@@ -73,7 +74,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
|
||||
componentDidMount() {
|
||||
if (!userContext.features.sandboxNotebookOutputs) {
|
||||
loadTransform(this.props as any);
|
||||
loadTransform(this.props as NotebookRendererProps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
}}
|
||||
</CodeCell>
|
||||
),
|
||||
markdown: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||
markdown: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) =>
|
||||
decorate(
|
||||
id,
|
||||
contentRef,
|
||||
@@ -155,7 +156,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
||||
</MarkdownCell>
|
||||
),
|
||||
|
||||
raw: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||
raw: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) =>
|
||||
decorate(
|
||||
id,
|
||||
contentRef,
|
||||
@@ -202,7 +203,8 @@ export const makeMapStateToProps = (
|
||||
return mapStateToProps;
|
||||
};
|
||||
|
||||
const makeMapDispatchToProps = (initialDispatch: Dispatch, initialProps: NotebookRendererBaseProps) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const makeMapDispatchToProps = (_initialDispatch: Dispatch, _initialProps: NotebookRendererBaseProps) => {
|
||||
const mapDispatchToProps = (dispatch: Dispatch) => {
|
||||
return {
|
||||
addTransform: (transform: React.ComponentType & { MIMETYPE: string }) =>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { HttpStatusCodes } from "../Common/Constants";
|
||||
import { getErrorMessage } from "../Common/ErrorHandlingUtils";
|
||||
import * as Logger from "../Common/Logger";
|
||||
import * as UrlUtility from "../Common/UrlUtility";
|
||||
import { NotebookUtil } from "../Explorer/Notebook/NotebookUtil";
|
||||
import { getErrorMessage } from "../Common/ErrorHandlingUtils";
|
||||
|
||||
export interface IGitHubPageInfo {
|
||||
endCursor: string;
|
||||
@@ -225,7 +225,7 @@ export class GitHubClient {
|
||||
private static readonly SelfErrorCode = 599;
|
||||
private ocktokit: Octokit;
|
||||
|
||||
constructor(private errorCallback: (error: any) => void) {
|
||||
constructor(private errorCallback: (error: Error) => void) {
|
||||
this.initOctokit();
|
||||
}
|
||||
|
||||
@@ -501,10 +501,11 @@ export class GitHubClient {
|
||||
this.ocktokit = new Octokit({
|
||||
auth: token,
|
||||
log: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
debug: () => {},
|
||||
info: (message?: any) => GitHubClient.log(Logger.logInfo, message),
|
||||
warn: (message?: any) => GitHubClient.log(Logger.logWarning, message),
|
||||
error: (error?: any) => Logger.logError(getErrorMessage(error), "GitHubClient.Octokit"),
|
||||
info: (message?: string) => GitHubClient.log(Logger.logInfo, message),
|
||||
warn: (message?: string) => GitHubClient.log(Logger.logWarning, message),
|
||||
error: (error?: Error) => Logger.logError(getErrorMessage(error), "GitHubClient.Octokit"),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -514,7 +515,7 @@ export class GitHubClient {
|
||||
});
|
||||
}
|
||||
|
||||
private static log(logger: (message: string, area: string) => void, message?: any) {
|
||||
private static log(logger: (message: string, area: string) => void, message?: string) {
|
||||
if (message) {
|
||||
message = typeof message === "string" ? message : JSON.stringify(message);
|
||||
logger(message, "GitHubClient.Octokit");
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
if (window.parent !== window) {
|
||||
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ describe("GalleryUtils", () => {
|
||||
});
|
||||
|
||||
it("downloadItem shows dialog in data explorer", () => {
|
||||
const container = new Explorer();
|
||||
const container = {} as Explorer;
|
||||
GalleryUtils.downloadItem(container, undefined, galleryItem, undefined);
|
||||
|
||||
expect(useDialog.getState().visible).toBe(true);
|
||||
|
||||
@@ -69,11 +69,7 @@ export const useTabs: UseStore<TabsState> = create((set, get) => ({
|
||||
if (tab.tabId === activeTab.tabId && tabIndex !== -1) {
|
||||
const tabToTheRight = updatedTabs[tabIndex];
|
||||
const lastOpenTab = updatedTabs[updatedTabs.length - 1];
|
||||
const newActiveTab = tabToTheRight ?? lastOpenTab;
|
||||
set({ activeTab: newActiveTab });
|
||||
if (newActiveTab) {
|
||||
newActiveTab.onActivate();
|
||||
}
|
||||
set({ activeTab: tabToTheRight || lastOpenTab });
|
||||
}
|
||||
|
||||
set({ openedTabs: updatedTabs });
|
||||
|
||||
Reference in New Issue
Block a user