Skip to content

Commit 46817de

Browse files
authored
Merge pull request #66 from DenisaCG/refreshDrivesList
Remove drives list provider plugin
2 parents 811c12c + 7583a9b commit 46817de

File tree

3 files changed

+6
-37
lines changed

3 files changed

+6
-37
lines changed

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { JupyterFrontEndPlugin } from '@jupyterlab/application';
22
import {
33
driveFileBrowser,
4-
drivesListProvider,
54
openDriveDialogPlugin,
65
launcherPlugin
76
} from './plugins';
87

98
const plugins: JupyterFrontEndPlugin<any>[] = [
109
driveFileBrowser,
11-
drivesListProvider,
1210
openDriveDialogPlugin,
1311
launcherPlugin
1412
];

src/plugins/driveBrowserPlugin.ts

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import { Widget } from '@lumino/widgets';
2525

2626
import { driveBrowserIcon } from '../icons';
2727
import { Drive } from '../contents';
28-
import { getDrivesList, setListingLimit } from '../requests';
29-
import { IDriveInfo, IDrivesList, CommandIDs } from '../token';
28+
import { setListingLimit } from '../requests';
29+
import { CommandIDs } from '../token';
3030

3131
/**
3232
* The file browser factory ID.
@@ -48,24 +48,6 @@ const FILE_DIALOG_CLASS = 'jp-FileDialog';
4848
*/
4949
const CREATE_DRIVE_TITLE_CLASS = 'jp-new-drive-title';
5050

51-
/**
52-
* The drives list provider.
53-
*/
54-
export const drivesListProvider: JupyterFrontEndPlugin<IDriveInfo[]> = {
55-
id: 'jupyter-drives:drives-list',
56-
description: 'The drives list provider.',
57-
provides: IDrivesList,
58-
activate: async (_: JupyterFrontEnd): Promise<IDriveInfo[]> => {
59-
let drives: IDriveInfo[] = [];
60-
try {
61-
drives = await getDrivesList();
62-
} catch (error) {
63-
console.log('Failed loading available drives list, with error: ', error);
64-
}
65-
return drives;
66-
}
67-
};
68-
6951
/**
7052
* The drive file browser factory provider.
7153
*/
@@ -77,8 +59,7 @@ export const driveFileBrowser: JupyterFrontEndPlugin<void> = {
7759
IFileBrowserFactory,
7860
IToolbarWidgetRegistry,
7961
ISettingRegistry,
80-
ITranslator,
81-
IDrivesList
62+
ITranslator
8263
],
8364
optional: [
8465
IRouter,
@@ -92,7 +73,6 @@ export const driveFileBrowser: JupyterFrontEndPlugin<void> = {
9273
toolbarRegistry: IToolbarWidgetRegistry,
9374
settingsRegistry: ISettingRegistry,
9475
translator: ITranslator,
95-
drivesList: IDriveInfo[],
9676
router: IRouter | null,
9777
tree: JupyterFrontEnd.ITreeResolver | null,
9878
labShell: ILabShell | null,
@@ -105,8 +85,7 @@ export const driveFileBrowser: JupyterFrontEndPlugin<void> = {
10585

10686
// create drive for drive file browser
10787
const drive = new Drive({
108-
name: 's3',
109-
drivesList: drivesList
88+
name: 's3'
11089
});
11190

11291
app.serviceManager.contents.addDrive(drive);
@@ -266,7 +245,7 @@ namespace Private {
266245
/**
267246
* Create the node for a creating a new drive handler.
268247
*/
269-
const createNewDriveNode = (newDriveName: string): HTMLElement => {
248+
const createNewDriveNode = (): HTMLElement => {
270249
const body = document.createElement('div');
271250

272251
const drive = document.createElement('label');
@@ -295,7 +274,7 @@ namespace Private {
295274
* Construct a new "create-drive" dialog.
296275
*/
297276
constructor(newDriveName: string) {
298-
super({ node: createNewDriveNode(newDriveName) });
277+
super({ node: createNewDriveNode() });
299278
this.onAfterAttach();
300279
}
301280

src/token.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Token } from '@lumino/coreutils';
21
import { Contents } from '@jupyterlab/services';
32

43
/**
@@ -12,13 +11,6 @@ export namespace CommandIDs {
1211
export const launcher = 'launcher:create';
1312
}
1413

15-
/**
16-
* A token for the plugin that provides the list of drives.
17-
*/
18-
export const IDrivesList = new Token<IDriveInfo[]>(
19-
'jupyter-drives:drives-list-provider'
20-
);
21-
2214
/**
2315
* An interface that stores the drive information.
2416
*/

0 commit comments

Comments
 (0)