mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-30 06:11:38 +00:00
Fix typescript strict issues for Toolbar and VirtualCommandBarComponent
This commit is contained in:
@@ -5,9 +5,9 @@ import { NotebookUtil } from "../NotebookUtil";
|
||||
import * as NteractUtil from "../NTeractUtil";
|
||||
|
||||
interface VirtualCommandBarComponentProps {
|
||||
kernelSpecName: string;
|
||||
kernelStatus: string;
|
||||
currentCellType: string;
|
||||
kernelSpecName: string | undefined;
|
||||
kernelStatus: string | undefined;
|
||||
currentCellType: string | undefined;
|
||||
isNotebookUntrusted: boolean;
|
||||
onRender: () => void;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ interface InitialProps {
|
||||
|
||||
// Redux
|
||||
const makeMapStateToProps = (
|
||||
initialState: AppState,
|
||||
_: AppState,
|
||||
initialProps: InitialProps
|
||||
): ((state: AppState) => VirtualCommandBarComponentProps) => {
|
||||
const { contentRef } = initialProps;
|
||||
@@ -70,8 +70,8 @@ const makeMapStateToProps = (
|
||||
|
||||
currentCellType = NteractUtil.getCurrentCellType(content);
|
||||
return {
|
||||
kernelStatus,
|
||||
kernelSpecName,
|
||||
kernelStatus: kernelStatus ? kernelStatus : "",
|
||||
kernelSpecName: kernelSpecName ? kernelSpecName : "",
|
||||
currentCellType,
|
||||
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, contentRef),
|
||||
onRender: initialProps.onRender,
|
||||
|
||||
@@ -12,7 +12,7 @@ export interface SnapshotFragment {
|
||||
export type SnapshotRequest = NotebookSnapshotRequest | CellSnapshotRequest;
|
||||
interface NotebookSnapshotRequestBase {
|
||||
requestId: string;
|
||||
aspectRatio: number;
|
||||
aspectRatio: number | undefined;
|
||||
notebookContentRef: string; // notebook redux contentRef
|
||||
downloadFilename?: string; // Optional: will download as a file
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ const mapDispatchToProps = (
|
||||
takeNotebookSnapshot: (request: SnapshotRequest) => dispatch(cdbActions.takeNotebookSnapshot(request)),
|
||||
});
|
||||
|
||||
const makeMapStateToProps = (state: AppState, ownProps: ComponentProps): ((state: AppState) => StateProps) => {
|
||||
const makeMapStateToProps = (_: AppState, ownProps: ComponentProps): ((state: AppState) => StateProps) => {
|
||||
const mapStateToProps = (state: AppState) => {
|
||||
const cell = selectors.cell.cellFromState(state, { id: ownProps.id, contentRef: ownProps.contentRef });
|
||||
const cellType = cell.cell_type;
|
||||
@@ -225,8 +225,8 @@ const makeMapStateToProps = (state: AppState, ownProps: ComponentProps): ((state
|
||||
|
||||
return {
|
||||
cellType,
|
||||
cellIdAbove,
|
||||
cellIdBelow,
|
||||
cellIdAbove: cellIdAbove ? cellIdAbove : "",
|
||||
cellIdBelow: cellIdBelow ? cellIdBelow : "",
|
||||
hasCodeOutput: cellType === "code" && NotebookUtil.hasCodeCellOutput(cell as ImmutableCodeCell),
|
||||
isNotebookUntrusted: NotebookUtil.isNotebookUntrusted(state, ownProps.contentRef),
|
||||
};
|
||||
|
||||
@@ -139,7 +139,9 @@
|
||||
"./src/userContext.test.ts",
|
||||
"src/Common/EntityValue.tsx",
|
||||
"./src/Platform/Hosted/Components/SwitchAccount.tsx",
|
||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx"
|
||||
"./src/Platform/Hosted/Components/SwitchSubscription.tsx",
|
||||
"./src/Explorer/Notebook/NotebookComponent/VirtualCommandBarComponent.tsx",
|
||||
"./src/Explorer/Notebook/NotebookRenderer/Toolbar.tsx"
|
||||
],
|
||||
"include": [
|
||||
"src/CellOutputViewer/transforms/**/*",
|
||||
|
||||
Reference in New Issue
Block a user