55} from '@jupyterlab/application' ;
66import { MainAreaWidget , WidgetTracker } from '@jupyterlab/apputils' ;
77import { PageConfig } from '@jupyterlab/coreutils' ;
8- import { IFileBrowserFactory } from '@jupyterlab/filebrowser' ;
8+ import { IDocumentManager } from '@jupyterlab/docmanager' ;
9+ import { FileBrowserModel } from '@jupyterlab/filebrowser' ;
910import { ILauncher } from '@jupyterlab/launcher' ;
1011import { nullTranslator } from '@jupyterlab/translation' ;
1112import { offlineBoltIcon } from '@jupyterlab/ui-components' ;
@@ -47,14 +48,17 @@ namespace CommandIDs {
4748const plugin : JupyterFrontEndPlugin < void > = {
4849 id : '@jupyterlab/ui-profiler:plugin' ,
4950 autoStart : true ,
50- requires : [ IFileBrowserFactory ] ,
51+ requires : [ IDocumentManager ] ,
5152 optional : [ ILauncher , ILayoutRestorer ] ,
5253 activate : (
5354 app : JupyterFrontEnd ,
54- factory : IFileBrowserFactory ,
55+ docManager : IDocumentManager ,
5556 launcher : ILauncher | null ,
5657 restorer : ILayoutRestorer | null
5758 ) => {
59+ const fileBrowserModel = new FileBrowserModel ( {
60+ manager : docManager
61+ } ) ;
5862 const options = {
5963 benchmarks : [
6064 executionTimeBenchmark ,
@@ -76,11 +80,8 @@ const plugin: JupyterFrontEndPlugin<void> = {
7680 ] ,
7781 translator : nullTranslator ,
7882 upload : ( file : File ) => {
79- // this.manager = new ServiceManager();
80- // this.manager.contents.uploadFile - only exists in galata...
81- // TODO: this is actually an upstream issue, services should offer upload method
82- // rather than each place re-implmenting it
83- return factory . defaultBrowser . model . upload ( file ) ;
83+ // https://github.com/jupyterlab/jupyterlab/issues/11416
84+ return fileBrowserModel . upload ( file ) ;
8485 } ,
8586 getJupyterState : ( ) => {
8687 const state : IJupyterState = {
0 commit comments