Skip to content

Commit

Permalink
Move upload status item to filebrowser extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-r-rose committed Oct 18, 2018
1 parent 86ef3df commit 8d87385
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/codemirror-extension/src/syntaxstatus.tsx
Expand Up @@ -209,7 +209,7 @@ export namespace IEditorSyntax {
}

export const editorSyntaxStatus: JupyterLabPlugin<void> = {
id: '@jupyterlab/statusbar:editor-syntax-item',
id: '@jupyterlab/codemirror-extension:editor-syntax-status',
autoStart: true,
requires: [IStatusBar, IEditorTracker],
activate: (
Expand Down
6 changes: 3 additions & 3 deletions packages/codemirror-extension/tsconfig.json
Expand Up @@ -9,6 +9,9 @@
{
"path": "../application"
},
{
"path": "../apputils"
},
{
"path": "../codeeditor"
},
Expand All @@ -27,9 +30,6 @@
{
"path": "../mainmenu"
},
{
"path": "../apputils"
},
{
"path": "../statusbar"
}
Expand Down
6 changes: 5 additions & 1 deletion packages/filebrowser-extension/package.json
Expand Up @@ -37,10 +37,14 @@
"@jupyterlab/filebrowser": "^0.19.3",
"@jupyterlab/launcher": "^0.19.1",
"@jupyterlab/services": "^3.2.1",
"@jupyterlab/statusbar": "^0.7.1",
"@phosphor/algorithm": "^1.1.2",
"@phosphor/commands": "^1.6.1",
"@phosphor/disposable": "^1.1.2",
"@phosphor/messaging": "^1.2.2",
"@phosphor/widgets": "^1.6.0"
"@phosphor/signaling": "^1.2.2",
"@phosphor/widgets": "^1.6.0",
"react": "~16.4.2"
},
"devDependencies": {
"rimraf": "~2.6.2",
Expand Down
9 changes: 8 additions & 1 deletion packages/filebrowser-extension/src/index.ts
Expand Up @@ -25,6 +25,8 @@ import {
IFileBrowserFactory
} from '@jupyterlab/filebrowser';

import { fileUploadStatus } from './uploadstatus';

import { Launcher } from '@jupyterlab/launcher';

import { Contents } from '@jupyterlab/services';
Expand Down Expand Up @@ -131,7 +133,12 @@ const namespace = 'filebrowser';
/**
* Export the plugins as default.
*/
const plugins: JupyterLabPlugin<any>[] = [factory, browser, shareFile];
const plugins: JupyterLabPlugin<any>[] = [
factory,
browser,
shareFile,
fileUploadStatus
];
export default plugins;

/**
Expand Down
@@ -1,9 +1,3 @@
/**
* Default item to display file upload progress.
*/
/**
* Part of Jupyterlab status bar defaults.
*/
import React from 'react';
import { TextItem } from '@jupyterlab/statusbar';

Expand All @@ -19,7 +13,6 @@ import {
import { IChangedArgs } from '@jupyterlab/coreutils';
import { ISignal } from '@phosphor/signaling';
import { IDisposable } from '@phosphor/disposable';
import { Token } from '@phosphor/coreutils';

import { ProgressBar } from '@jupyterlab/statusbar';
import { VDomRenderer, InstanceTracker, VDomModel } from '@jupyterlab/apputils';
Expand Down Expand Up @@ -48,6 +41,9 @@ namespace FileUploadComponent {

const UPLOAD_COMPLETE_MESSAGE_MILLIS: number = 2000;

/**
* Status bar item to display file upload progress.
*/
class FileUpload extends VDomRenderer<FileUpload.Model> implements IFileUpload {
constructor(opts: FileUpload.IOptions) {
super();
Expand Down Expand Up @@ -181,11 +177,6 @@ export interface IFileUpload extends IDisposable {
readonly modelChanged: ISignal<this, void>;
}

// tslint:disable-next-line:variable-name
export const IFileUpload = new Token<IFileUpload>(
'@jupyterlab/statusbar:IFileUpload'
);

export namespace IFileUpload {
export interface IModel {
readonly items: Array<IFileUpload.IItem>;
Expand All @@ -199,10 +190,9 @@ export namespace IFileUpload {
}
}

export const fileUploadItem: JupyterLabPlugin<IFileUpload> = {
id: '@jupyterlab/statusbar:file-upload-item',
export const fileUploadStatus: JupyterLabPlugin<void> = {
id: '@jupyterlab/filebrowser-extension:file-upload-item',
autoStart: true,
provides: IFileUpload,
requires: [IStatusBar, IFileBrowserFactory],
activate: (
app: JupyterLab,
Expand All @@ -220,7 +210,5 @@ export const fileUploadItem: JupyterLabPlugin<IFileUpload> = {
},
stateChanged: item.model!.stateChanged
});

return item;
}
};
3 changes: 3 additions & 0 deletions packages/filebrowser-extension/tsconfig.json
Expand Up @@ -26,6 +26,9 @@
},
{
"path": "../services"
},
{
"path": "../statusbar"
}
]
}
2 changes: 1 addition & 1 deletion packages/notebook-extension/src/modestatus.tsx
Expand Up @@ -156,7 +156,7 @@ export namespace ICommandEdit {
}

export const commandEditItem: JupyterLabPlugin<void> = {
id: '@jupyterlab/statusbar:command-edit-item',
id: '@jupyterlab/notebook-extension:mode-status',
autoStart: true,
requires: [IStatusBar, INotebookTracker],
activate: (
Expand Down
2 changes: 1 addition & 1 deletion packages/notebook-extension/src/truststatus.tsx
Expand Up @@ -272,7 +272,7 @@ export namespace INotebookTrust {
}

export const notebookTrustItem: JupyterLabPlugin<void> = {
id: '@jupyterlab/statusbar:trusted-notebook-item',
id: '@jupyterlab/notebook-extension:trust-status',
autoStart: true,
requires: [IStatusBar, INotebookTracker],
activate: (
Expand Down

0 comments on commit 8d87385

Please sign in to comment.