mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-29 08:56:52 +00:00
fix-eslint-NTeractUtil.ts (#493)
This commit is contained in:
parent
f192310697
commit
641dae30a1
@ -101,7 +101,6 @@ src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.ts
|
|||||||
src/Explorer/Menus/ContextMenu.ts
|
src/Explorer/Menus/ContextMenu.ts
|
||||||
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
src/Explorer/MostRecentActivity/MostRecentActivity.ts
|
||||||
src/Explorer/Notebook/FileSystemUtil.ts
|
src/Explorer/Notebook/FileSystemUtil.ts
|
||||||
src/Explorer/Notebook/NTeractUtil.ts
|
|
||||||
src/Explorer/Notebook/NotebookClientV2.ts
|
src/Explorer/Notebook/NotebookClientV2.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
src/Explorer/Notebook/NotebookComponent/NotebookContentProvider.ts
|
||||||
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
src/Explorer/Notebook/NotebookComponent/__mocks__/rx-jupyter.ts
|
||||||
|
@ -3,20 +3,18 @@ import { NotebookContentRecordProps, selectors } from "@nteract/core";
|
|||||||
/**
|
/**
|
||||||
* A bunch of utilities to interact with nteract
|
* A bunch of utilities to interact with nteract
|
||||||
*/
|
*/
|
||||||
export default class NTeractUtil {
|
export function getCurrentCellType(content: NotebookContentRecordProps): "markdown" | "code" | "raw" | undefined {
|
||||||
public static getCurrentCellType(content: NotebookContentRecordProps): "markdown" | "code" | "raw" | undefined {
|
if (!content) {
|
||||||
if (!content) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cellFocusedId = selectors.notebook.cellFocused(content.model);
|
|
||||||
if (cellFocusedId) {
|
|
||||||
const cell = selectors.notebook.cellById(content.model, { id: cellFocusedId });
|
|
||||||
if (cell) {
|
|
||||||
return cell.cell_type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cellFocusedId = selectors.notebook.cellFocused(content.model);
|
||||||
|
if (cellFocusedId) {
|
||||||
|
const cell = selectors.notebook.cellById(content.model, { id: cellFocusedId });
|
||||||
|
if (cell) {
|
||||||
|
return cell.cell_type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import "@nteract/styles/global-variables.css";
|
|||||||
import "react-table/react-table.css";
|
import "react-table/react-table.css";
|
||||||
|
|
||||||
import * as CdbActions from "./actions";
|
import * as CdbActions from "./actions";
|
||||||
import NteractUtil from "../NTeractUtil";
|
import * as NteractUtil from "../NTeractUtil";
|
||||||
|
|
||||||
export interface NotebookComponentBootstrapperOptions {
|
export interface NotebookComponentBootstrapperOptions {
|
||||||
notebookClient: NotebookClientV2;
|
notebookClient: NotebookClientV2;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { AppState, ContentRef, selectors } from "@nteract/core";
|
import { AppState, ContentRef, selectors } from "@nteract/core";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import NteractUtil from "../NTeractUtil";
|
import * as NteractUtil from "../NTeractUtil";
|
||||||
|
|
||||||
interface VirtualCommandBarComponentProps {
|
interface VirtualCommandBarComponentProps {
|
||||||
kernelSpecName: string;
|
kernelSpecName: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user