mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-23 19:01:28 +00:00
Compare commits
1 Commits
eslint/fix
...
eslint/fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a1e9f7231 |
@@ -44,8 +44,6 @@ src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
|
|||||||
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
src/Explorer/DataSamples/ContainerSampleGenerator.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
src/Explorer/DataSamples/DataSamplesUtil.test.ts
|
||||||
src/Explorer/DataSamples/DataSamplesUtil.ts
|
src/Explorer/DataSamples/DataSamplesUtil.ts
|
||||||
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.test.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.ts
|
src/Explorer/Graph/GraphExplorerComponent/D3ForceGraph.ts
|
||||||
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
src/Explorer/Graph/GraphExplorerComponent/EdgeInfoCache.ts
|
||||||
@@ -106,6 +104,7 @@ src/Explorer/Tabs/ScriptTabBase.ts
|
|||||||
src/Explorer/Tabs/TabComponents.ts
|
src/Explorer/Tabs/TabComponents.ts
|
||||||
src/Explorer/Tabs/TabsBase.ts
|
src/Explorer/Tabs/TabsBase.ts
|
||||||
src/Explorer/Tabs/TriggerTab.ts
|
src/Explorer/Tabs/TriggerTab.ts
|
||||||
|
src/Explorer/Tabs/UserDefinedFunctionTab.ts
|
||||||
src/Explorer/Tree/AccessibleVerticalList.ts
|
src/Explorer/Tree/AccessibleVerticalList.ts
|
||||||
src/Explorer/Tree/Collection.ts
|
src/Explorer/Tree/Collection.ts
|
||||||
src/Explorer/Tree/ConflictId.ts
|
src/Explorer/Tree/ConflictId.ts
|
||||||
@@ -117,12 +116,14 @@ src/Explorer/Tree/TreeComponents.ts
|
|||||||
src/Explorer/Tree/Trigger.ts
|
src/Explorer/Tree/Trigger.ts
|
||||||
src/Explorer/WaitsForTemplateViewModel.ts
|
src/Explorer/WaitsForTemplateViewModel.ts
|
||||||
src/GitHub/GitHubClient.test.ts
|
src/GitHub/GitHubClient.test.ts
|
||||||
|
src/GitHub/GitHubClient.ts
|
||||||
src/GitHub/GitHubConnector.ts
|
src/GitHub/GitHubConnector.ts
|
||||||
src/GitHub/GitHubOAuthService.ts
|
src/GitHub/GitHubOAuthService.ts
|
||||||
src/Index.ts
|
src/Index.ts
|
||||||
src/Juno/JunoClient.test.ts
|
src/Juno/JunoClient.test.ts
|
||||||
src/Juno/JunoClient.ts
|
src/Juno/JunoClient.ts
|
||||||
src/Platform/Hosted/Authorization.ts
|
src/Platform/Hosted/Authorization.ts
|
||||||
|
src/ReactDevTools.ts
|
||||||
src/Shared/Constants.ts
|
src/Shared/Constants.ts
|
||||||
src/Shared/DefaultExperienceUtility.test.ts
|
src/Shared/DefaultExperienceUtility.test.ts
|
||||||
src/Shared/DefaultExperienceUtility.ts
|
src/Shared/DefaultExperienceUtility.ts
|
||||||
@@ -154,6 +155,7 @@ src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx
|
|||||||
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx
|
||||||
src/Explorer/Notebook/NotebookComponent/contents/index.tsx
|
src/Explorer/Notebook/NotebookComponent/contents/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/NotebookReadOnlyRenderer.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/draggable/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/hijack-scroll/index.tsx
|
||||||
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
|
src/Explorer/Notebook/NotebookRenderer/decorators/kbd-shortcuts/index.tsx
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe("Cache arrays by key", () => {
|
|||||||
const key = "key";
|
const key = "key";
|
||||||
cache.insert(key, 1, 0);
|
cache.insert(key, 1, 0);
|
||||||
cache.clear();
|
cache.clear();
|
||||||
expect(cache.retrieve(key, 0, 1)).toBe(null);
|
expect(cache.retrieve(key, 0, 1)).toBe(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should invalidate oldest key to keep cache size under maximum", () => {
|
it("should invalidate oldest key to keep cache size under maximum", () => {
|
||||||
@@ -21,7 +21,7 @@ describe("Cache arrays by key", () => {
|
|||||||
cache.insert(key1, 2, 4);
|
cache.insert(key1, 2, 4);
|
||||||
|
|
||||||
expect(cache.retrieve(key1, 0, 3)).toEqual([0, 2, 4]);
|
expect(cache.retrieve(key1, 0, 3)).toEqual([0, 2, 4]);
|
||||||
expect(cache.retrieve(key2, 1, 1)).toEqual(null);
|
expect(cache.retrieve(key2, 1, 1)).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should cache and retrieve cached page within boundaries", () => {
|
it("should cache and retrieve cached page within boundaries", () => {
|
||||||
@@ -39,7 +39,7 @@ describe("Cache arrays by key", () => {
|
|||||||
const key = "key";
|
const key = "key";
|
||||||
cache.insert(key, 0, 0);
|
cache.insert(key, 0, 0);
|
||||||
cache.insert(key, 1, 1);
|
cache.insert(key, 1, 1);
|
||||||
expect(cache.retrieve(key, 2, 1)).toEqual(null);
|
expect(cache.retrieve(key, 2, 1)).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not retrieve cached page overlapping boundaries", () => {
|
it("should not retrieve cached page overlapping boundaries", () => {
|
||||||
@@ -48,7 +48,7 @@ describe("Cache arrays by key", () => {
|
|||||||
cache.insert(key, 0, 0);
|
cache.insert(key, 0, 0);
|
||||||
cache.insert(key, 1, 1);
|
cache.insert(key, 1, 1);
|
||||||
cache.insert(key, 2, 2);
|
cache.insert(key, 2, 2);
|
||||||
expect(cache.retrieve(key, 2, 4)).toEqual(null);
|
expect(cache.retrieve(key, 2, 4)).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not insert non-contiguous element", () => {
|
it("should not insert non-contiguous element", () => {
|
||||||
@@ -57,7 +57,7 @@ describe("Cache arrays by key", () => {
|
|||||||
cache.insert(key, 0, 0);
|
cache.insert(key, 0, 0);
|
||||||
cache.insert(key, 1, 1);
|
cache.insert(key, 1, 1);
|
||||||
cache.insert(key, 3, 3);
|
cache.insert(key, 3, 3);
|
||||||
expect(cache.retrieve(key, 3, 1)).toEqual(null);
|
expect(cache.retrieve(key, 3, 1)).toEqual(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should cache multiple keys", () => {
|
it("should cache multiple keys", () => {
|
||||||
|
|||||||
@@ -61,12 +61,12 @@ export class ArraysByKeyCache<T> {
|
|||||||
* @param pageSize
|
* @param pageSize
|
||||||
*/
|
*/
|
||||||
public retrieve(key: string, startIndex: number, pageSize: number): T[] | null {
|
public retrieve(key: string, startIndex: number, pageSize: number): T[] | null {
|
||||||
if (!this.cache.hasOwnProperty(key)) {
|
if (!Object.prototype.hasOwnProperty.call(this.cache, key)) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
const elements = this.cache[key];
|
const elements = this.cache[key];
|
||||||
if (startIndex + pageSize > elements.length) {
|
if (startIndex + pageSize > elements.length) {
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return elements.slice(startIndex, startIndex + pageSize);
|
return elements.slice(startIndex, startIndex + pageSize);
|
||||||
|
|||||||
@@ -31,13 +31,12 @@ import StatusBar from "./StatusBar";
|
|||||||
import CellToolbar from "./Toolbar";
|
import CellToolbar from "./Toolbar";
|
||||||
|
|
||||||
export interface NotebookRendererBaseProps {
|
export interface NotebookRendererBaseProps {
|
||||||
contentRef: ContentRef;
|
contentRef: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface NotebookRendererDispatchProps {
|
interface NotebookRendererDispatchProps {
|
||||||
storeNotebookSnapshot: (imageSrc: string, requestId: string) => void;
|
storeNotebookSnapshot: (imageSrc: string, requestId: string) => void;
|
||||||
notebookSnapshotError: (error: string) => void;
|
notebookSnapshotError: (error: string) => void;
|
||||||
addTransform: (transform: React.ComponentType & { MIMETYPE: string }) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface StateProps {
|
interface StateProps {
|
||||||
@@ -74,7 +73,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!userContext.features.sandboxNotebookOutputs) {
|
if (!userContext.features.sandboxNotebookOutputs) {
|
||||||
loadTransform(this.props as NotebookRendererProps);
|
loadTransform(this.props as any);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +138,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
|||||||
}}
|
}}
|
||||||
</CodeCell>
|
</CodeCell>
|
||||||
),
|
),
|
||||||
markdown: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) =>
|
markdown: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||||
decorate(
|
decorate(
|
||||||
id,
|
id,
|
||||||
contentRef,
|
contentRef,
|
||||||
@@ -156,7 +155,7 @@ class BaseNotebookRenderer extends React.Component<NotebookRendererProps> {
|
|||||||
</MarkdownCell>
|
</MarkdownCell>
|
||||||
),
|
),
|
||||||
|
|
||||||
raw: ({ id, contentRef }: { id: CellId; contentRef: ContentRef }) =>
|
raw: ({ id, contentRef }: { id: any; contentRef: ContentRef }) =>
|
||||||
decorate(
|
decorate(
|
||||||
id,
|
id,
|
||||||
contentRef,
|
contentRef,
|
||||||
@@ -203,8 +202,7 @@ export const makeMapStateToProps = (
|
|||||||
return mapStateToProps;
|
return mapStateToProps;
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
const makeMapDispatchToProps = (initialDispatch: Dispatch, initialProps: NotebookRendererBaseProps) => {
|
||||||
const makeMapDispatchToProps = (_initialDispatch: Dispatch, _initialProps: NotebookRendererBaseProps) => {
|
|
||||||
const mapDispatchToProps = (dispatch: Dispatch) => {
|
const mapDispatchToProps = (dispatch: Dispatch) => {
|
||||||
return {
|
return {
|
||||||
addTransform: (transform: React.ComponentType & { MIMETYPE: string }) =>
|
addTransform: (transform: React.ComponentType & { MIMETYPE: string }) =>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Octokit } from "@octokit/rest";
|
import { Octokit } from "@octokit/rest";
|
||||||
import { HttpStatusCodes } from "../Common/Constants";
|
import { HttpStatusCodes } from "../Common/Constants";
|
||||||
import { getErrorMessage } from "../Common/ErrorHandlingUtils";
|
|
||||||
import * as Logger from "../Common/Logger";
|
import * as Logger from "../Common/Logger";
|
||||||
import * as UrlUtility from "../Common/UrlUtility";
|
import * as UrlUtility from "../Common/UrlUtility";
|
||||||
import { NotebookUtil } from "../Explorer/Notebook/NotebookUtil";
|
import { NotebookUtil } from "../Explorer/Notebook/NotebookUtil";
|
||||||
|
import { getErrorMessage } from "../Common/ErrorHandlingUtils";
|
||||||
|
|
||||||
export interface IGitHubPageInfo {
|
export interface IGitHubPageInfo {
|
||||||
endCursor: string;
|
endCursor: string;
|
||||||
@@ -225,7 +225,7 @@ export class GitHubClient {
|
|||||||
private static readonly SelfErrorCode = 599;
|
private static readonly SelfErrorCode = 599;
|
||||||
private ocktokit: Octokit;
|
private ocktokit: Octokit;
|
||||||
|
|
||||||
constructor(private errorCallback: (error: Error) => void) {
|
constructor(private errorCallback: (error: any) => void) {
|
||||||
this.initOctokit();
|
this.initOctokit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,11 +501,10 @@ export class GitHubClient {
|
|||||||
this.ocktokit = new Octokit({
|
this.ocktokit = new Octokit({
|
||||||
auth: token,
|
auth: token,
|
||||||
log: {
|
log: {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
||||||
debug: () => {},
|
debug: () => {},
|
||||||
info: (message?: string) => GitHubClient.log(Logger.logInfo, message),
|
info: (message?: any) => GitHubClient.log(Logger.logInfo, message),
|
||||||
warn: (message?: string) => GitHubClient.log(Logger.logWarning, message),
|
warn: (message?: any) => GitHubClient.log(Logger.logWarning, message),
|
||||||
error: (error?: Error) => Logger.logError(getErrorMessage(error), "GitHubClient.Octokit"),
|
error: (error?: any) => Logger.logError(getErrorMessage(error), "GitHubClient.Octokit"),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -515,7 +514,7 @@ export class GitHubClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static log(logger: (message: string, area: string) => void, message?: string) {
|
private static log(logger: (message: string, area: string) => void, message?: any) {
|
||||||
if (message) {
|
if (message) {
|
||||||
message = typeof message === "string" ? message : JSON.stringify(message);
|
message = typeof message === "string" ? message : JSON.stringify(message);
|
||||||
logger(message, "GitHubClient.Octokit");
|
logger(message, "GitHubClient.Octokit");
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
if (window.parent !== window) {
|
if (window.parent !== window) {
|
||||||
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user