Compare commits

..

6 Commits

Author SHA1 Message Date
vaidankarswapnil
ed79737603 Merge branch 'master' of https://github.com/Azure/cosmos-explorer into fix_eslint_issues_2 2021-10-06 11:56:04 +05:30
vaidankarswapnil
92acc63103 Implemented few changes 2021-10-06 11:54:50 +05:30
Karthik chakravarthy
f7fa3f7c09 Fix Unit Test: Mock the class to its instance (#1117)
* mock to instance

* Update jest.config.js

Co-authored-by: Jordi Bunster <jbunster@microsoft.com>
2021-10-05 13:06:26 -07:00
Jordi Bunster
6ebf19c0c9 Close tab fixes (#1107)
* Close tab fixes

Ensure that when promoting a new tab to being the 'active' tab
(as a consequence of, say, closing the active tab) that the newly
promoted tab has a chance to install its buttons and what not.

* Set new active tab even if undefined
2021-10-05 09:25:35 -07:00
vaidankarswapnil
22f6670184 Fix ESLint for few files 2021-10-05 15:57:36 +05:30
vaidankarswapnil
315a67e4dd Fix eslint issue for NotebookComponentAdapter.tsx 2021-10-05 13:02:04 +05:30
7 changed files with 913 additions and 33465 deletions

View File

@@ -32,10 +32,7 @@ src/Definitions/jquery.d.ts
src/Definitions/plotly.js-cartesian-dist.d-min.ts
src/Definitions/png.d.ts
src/Definitions/svg.d.ts
src/Explorer/ComponentRegisterer.test.ts
src/Explorer/ComponentRegisterer.ts
src/Explorer/Controls/DiffEditor/DiffEditorComponent.ts
src/Explorer/Controls/DynamicList/DynamicList.test.ts
src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts
src/Explorer/DataSamples/ContainerSampleGenerator.test.ts
src/Explorer/DataSamples/ContainerSampleGenerator.ts

View File

@@ -37,8 +37,8 @@ module.exports = {
global: {
branches: 25,
functions: 25,
lines: 29.5,
statements: 29.5,
lines: 29,
statements: 29,
},
},

34351
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ export interface NotebookComponentAdapterOptions {
export class NotebookComponentAdapter extends NotebookComponentBootstrapper implements ReactAdapter {
private onUpdateKernelInfo: () => void;
public parameters: undefined;
public parameters: unknown;
constructor(options: NotebookComponentAdapterOptions) {
super({

View File

@@ -1,6 +1,3 @@
// /* eslint jsx-a11y/no-static-element-interactions: 0 */
// /* eslint jsx-a11y/click-events-have-key-events: 0 */
import { actions, AppState, ContentRef, selectors } from "@nteract/core";
import React from "react";
import { connect } from "react-redux";
@@ -38,8 +35,7 @@ export class HijackScroll extends React.Component<Props> {
) {
if (this.el && "scrollIntoViewIfNeeded" in this.el) {
// This is only valid in Chrome, WebKit
//eslint-disable-next-line
(this.el as any).scrollIntoViewIfNeeded();
((this.el as unknown) as HijackScroll).scrollIntoViewIfNeeded();
} else if (this.el) {
// Make a best guess effort for older platforms
this.el.scrollIntoView();
@@ -47,7 +43,7 @@ export class HijackScroll extends React.Component<Props> {
}
}
componentDidUpdate(prevProps: Props): void {
componentDidUpdate(prevProps: Props) {
this.scrollIntoViewIfNeeded(prevProps.focused);
}
@@ -55,7 +51,7 @@ export class HijackScroll extends React.Component<Props> {
this.scrollIntoViewIfNeeded();
}
render(): JSX.Element {
render() {
return (
<div
onClick={this.props.selectCell}

View File

@@ -30,7 +30,7 @@ describe("GalleryUtils", () => {
});
it("downloadItem shows dialog in data explorer", () => {
const container = {} as Explorer;
const container = new Explorer();
GalleryUtils.downloadItem(container, undefined, galleryItem, undefined);
expect(useDialog.getState().visible).toBe(true);

View File

@@ -69,7 +69,11 @@ 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];
set({ activeTab: tabToTheRight || lastOpenTab });
const newActiveTab = tabToTheRight ?? lastOpenTab;
set({ activeTab: newActiveTab });
if (newActiveTab) {
newActiveTab.onActivate();
}
}
set({ openedTabs: updatedTabs });