Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"i18next-resources-to-backend": "1.2.1",
"iframe-resizer-react": "1.1.0",
"immer": "9.0.6",
"immutable": "4.0.0-rc.12",
"immutable": "^4.3.8",
"is-ci": "2.0.0",
"jquery": "3.7.1",
"jquery-typeahead": "2.11.1",
Expand Down
73 changes: 73 additions & 0 deletions patches/@nteract+commutable+7.5.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/node_modules/@nteract/commutable/src/structures.ts b/node_modules/@nteract/commutable/src/structures.ts
index c0ff6cb..b0117b7 100644
--- a/node_modules/@nteract/commutable/src/structures.ts
+++ b/node_modules/@nteract/commutable/src/structures.ts
@@ -193,6 +193,7 @@ export function markCellDeleting(
["cellMap", cellId],
nb
.getIn(["cellMap", cellId])
+ // @ts-ignore - immutable v4 getIn returns unknown
.setIn(["metadata", "nteract", "transient", "deleting"], true)
)
);
@@ -215,6 +216,7 @@ export function markCellNotDeleting(
["cellMap", cellId],
nb
.getIn(["cellMap", cellId])
+ // @ts-ignore - immutable v4 getIn returns unknown
.setIn(["metadata", "nteract", "transient", "deleting"], false)
)
);
diff --git a/node_modules/@nteract/commutable/src/v3.ts b/node_modules/@nteract/commutable/src/v3.ts
index 1ffa956..4e9078d 100644
--- a/node_modules/@nteract/commutable/src/v3.ts
+++ b/node_modules/@nteract/commutable/src/v3.ts
@@ -114,7 +114,7 @@ function createImmutableMarkdownCell(
return makeMarkdownCell({
cell_type: cell.cell_type,
source: demultiline(cell.source),
- metadata: immutableFromJS(cell.metadata)
+ metadata: immutableFromJS(cell.metadata) as any
});
}

@@ -172,7 +172,7 @@ function createImmutableCodeCell(cell: CodeCell): ImmutableCodeCell {
source: demultiline(cell.input),
outputs: ImmutableList(cell.outputs.map(createImmutableOutput)),
execution_count: cell.prompt_number,
- metadata: immutableFromJS(cell.metadata)
+ metadata: immutableFromJS(cell.metadata) as any
});
}

@@ -180,7 +180,7 @@ function createImmutableRawCell(cell: RawCell): ImmutableRawCell {
return makeRawCell({
cell_type: cell.cell_type,
source: demultiline(cell.source),
- metadata: immutableFromJS(cell.metadata)
+ metadata: immutableFromJS(cell.metadata) as any
});
}

@@ -198,7 +198,7 @@ function createImmutableHeadingCell(cell: HeadingCell): ImmutableMarkdownCell {
)
)
: cell.source,
- metadata: immutableFromJS(cell.metadata)
+ metadata: immutableFromJS(cell.metadata) as any
});
}

diff --git a/node_modules/@nteract/commutable/src/v4.ts b/node_modules/@nteract/commutable/src/v4.ts
index a6dd478..dd9a741 100644
--- a/node_modules/@nteract/commutable/src/v4.ts
+++ b/node_modules/@nteract/commutable/src/v4.ts
@@ -227,7 +227,7 @@ export function fromJS(
cellMap: cellStructure.cellMap.asImmutable(),
nbformat_minor: notebook.nbformat_minor,
nbformat: 4,
- metadata: immutableFromJS(notebook.metadata)
+ metadata: immutableFromJS(notebook.metadata) as any
});
}

2 changes: 1 addition & 1 deletion src/Explorer/Notebook/NotebookRenderer/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const makeMapStateToProps = (_state: CdbAppState, ownProps: ComponentProps): ((s
let executionCount;

if (model && model.type === "notebook") {
status = model.transient.getIn(["cellMap", id, "status"]);
status = model.transient.getIn(["cellMap", id, "status"]) as string | undefined;
const cell = selectors.notebook.cellById(model, { id });
if (cell) {
executionCount = cell.get("execution_count", undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const makeMapStateToProps = (
const cell = selectors.notebook.cellById(model, { id });
if (cell) {
outputs = cell.get("outputs", Immutable.List());
hidden = cell.cell_type === "code" && cell.getIn(["metadata", "jupyter", "outputs_hidden"]);
hidden = cell.cell_type === "code" && (cell.getIn(["metadata", "jupyter", "outputs_hidden"]) as boolean);
expanded = cell.cell_type === "code" && cell.getIn(["metadata", "collapsed"]) === false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/Explorer/Notebook/NotebookUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export class NotebookUtil {
const cwd = (filepath && path.dirname(filepath)) || "/";

const kernelSpecName =
notebook.getIn(["metadata", "kernelspec", "name"]) || notebook.getIn(["metadata", "language_info", "name"]);
(notebook.getIn(["metadata", "kernelspec", "name"]) as string | undefined) ||
(notebook.getIn(["metadata", "language_info", "name"]) as string | undefined);

return {
cwd,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"jsx": "react",
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"noEmit": true,
"types": [
"jest"
Expand Down
Loading