From 6d38176a74069e0091b54a89150c548625b13653 Mon Sep 17 00:00:00 2001 From: telamonian Date: Wed, 25 Dec 2019 06:08:01 -0500 Subject: [PATCH] post-rebase cleanup and bugfixes --- packages/application-extension/src/index.tsx | 12 +++++++----- packages/docregistry/src/mimedocument.ts | 2 +- packages/htmlviewer-extension/src/index.tsx | 2 +- packages/imageviewer-extension/src/index.ts | 2 +- packages/markdownviewer/src/widget.ts | 2 +- packages/notebook-extension/src/index.ts | 9 ++++++--- packages/ui-components/package.json | 2 +- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/application-extension/src/index.tsx b/packages/application-extension/src/index.tsx index a028990ccc28..ae3eaf616e41 100644 --- a/packages/application-extension/src/index.tsx +++ b/packages/application-extension/src/index.tsx @@ -26,15 +26,17 @@ import { import { PathExt, URLExt } from '@jupyterlab/coreutils'; -import { IStateDB } from '@jupyterlab/statedb'; - -import { ISettingRegistry } from '@jupyterlab/settingregistry'; - import { IPropertyInspectorProvider, SideBarPropertyInspectorProvider } from '@jupyterlab/property-inspector'; +import { ISettingRegistry } from '@jupyterlab/settingregistry'; + +import { IStateDB } from '@jupyterlab/statedb'; + +import { buildIcon } from "@jupyterlab/ui-components"; + import { each, iter, toArray } from '@lumino/algorithm'; import { PromiseDelegate } from '@lumino/coreutils'; @@ -799,7 +801,7 @@ const propertyInspector: JupyterFrontEndPlugin = { provides: IPropertyInspectorProvider, activate: (app: JupyterFrontEnd, labshell: ILabShell) => { const widget = new SideBarPropertyInspectorProvider(labshell); - widget.title.iconClass = 'jp-BuildIcon jp-SideBar-tabIcon'; + widget.title.iconRenderer = buildIcon; widget.title.caption = 'Property Inspector'; widget.id = 'jp-property-inspector'; labshell.add(widget, 'left'); diff --git a/packages/docregistry/src/mimedocument.ts b/packages/docregistry/src/mimedocument.ts index 70350183502d..9c751020ec6c 100644 --- a/packages/docregistry/src/mimedocument.ts +++ b/packages/docregistry/src/mimedocument.ts @@ -289,7 +289,7 @@ export class MimeDocumentFactory extends ABCWidgetFactory { content.title.iconClass = ft?.iconClass ?? ''; content.title.iconLabel = ft?.iconLabel ?? ''; - content.title.iconRenderer = ft?.iconRenderer; + content.title.iconRenderer = ft?.iconRenderer!; const widget = new MimeDocument({ content, context }); diff --git a/packages/htmlviewer-extension/src/index.tsx b/packages/htmlviewer-extension/src/index.tsx index 32993b32231f..9c9b267dde02 100644 --- a/packages/htmlviewer-extension/src/index.tsx +++ b/packages/htmlviewer-extension/src/index.tsx @@ -97,7 +97,7 @@ function activateHTMLViewer( widget.title.iconClass = ft.iconClass ?? ''; widget.title.iconLabel = ft.iconLabel ?? ''; - widget.title.iconRenderer = ft.iconRenderer; + widget.title.iconRenderer = ft.iconRenderer!; }); // Add a command to trust the active HTML document, diff --git a/packages/imageviewer-extension/src/index.ts b/packages/imageviewer-extension/src/index.ts index c83d79ce96fd..17dfefb3d5c1 100644 --- a/packages/imageviewer-extension/src/index.ts +++ b/packages/imageviewer-extension/src/index.ts @@ -107,7 +107,7 @@ function activate( if (types.length > 0) { widget.title.iconClass = types[0].iconClass ?? ''; widget.title.iconLabel = types[0].iconLabel ?? ''; - widget.title.iconRenderer = types[0].iconRenderer; + widget.title.iconRenderer = types[0].iconRenderer!; } }); diff --git a/packages/markdownviewer/src/widget.ts b/packages/markdownviewer/src/widget.ts index 9d4d5e97d847..105608d9d2f4 100644 --- a/packages/markdownviewer/src/widget.ts +++ b/packages/markdownviewer/src/widget.ts @@ -311,7 +311,7 @@ export class MarkdownViewerFactory extends ABCWidgetFactory { const content = new MarkdownViewer({ context, renderer }); content.title.iconClass = this._fileType?.iconClass ?? ''; content.title.iconLabel = this._fileType?.iconLabel ?? ''; - content.title.iconRenderer = this._fileType?.iconRenderer; + content.title.iconRenderer = this._fileType?.iconRenderer!; const widget = new MarkdownDocument({ content, context }); return widget; diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index c1fe452fb6c7..bb95f0ff1cce 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -576,9 +576,12 @@ function activateNotebookHandler( factory.widgetCreated.connect((sender, widget) => { // If the notebook panel does not have an ID, assign it one. widget.id = widget.id || `notebook-${++id}`; - widget.title.iconClass = ft.iconClass; - widget.title.iconLabel = ft.iconLabel; - widget.title.iconRenderer = ft.iconRenderer; + + // Set up the title icon + widget.title.iconClass = ft?.iconClass ?? ''; + widget.title.iconLabel = ft?.iconLabel ?? ''; + widget.title.iconRenderer = ft?.iconRenderer!; + // Notify the widget tracker if restore data needs to update. widget.context.pathChanged.connect(() => { void tracker.save(widget); diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 06e7edb699ce..e409db50dbed 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -51,7 +51,7 @@ "@storybook/addon-actions": "^5.2.5", "@storybook/react": "^5.2.5", "@types/react": "~16.9.16", - "@types/react-dom": "^16.9.4", + "@types/react-dom": "~16.9.4", "@types/webpack-env": "^1.14.1", "awesome-typescript-loader": "^5.2.1", "babel-loader": "^8.0.6",