Skip to content

Commit

Permalink
Merge the dialog and the filebrowser plugins into one single called A…
Browse files Browse the repository at this point in the history
…ddDrivesPlugin and moved hard coded inputs mimicking backend side inputs , outside from the plugins and methods.
  • Loading branch information
HaudinFlorence committed Nov 9, 2023
1 parent 1385aaf commit 3fce615
Show file tree
Hide file tree
Showing 3 changed files with 329 additions and 233 deletions.
196 changes: 99 additions & 97 deletions src/contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,104 @@ import { DocumentRegistry } from '@jupyterlab/docregistry';

import { Contents, ServerConnection } from '@jupyterlab/services';

const drive1Contents: Contents.IModel = {
name: 'Drive1',
path: 'Drive1',
last_modified: '2023-10-31T12:39:42.832781Z',
created: '2023-10-31T12:39:42.832781Z',
content: [
{
name: 'voila2.ipynb',
path: 'Drive1/voila2.ipynb',
last_modified: '2022-10-12T21:33:04.798185Z',
created: '2022-11-09T12:37:21.020396Z',
content: null,
format: null,
mimetype: null,
size: 5377,
writable: true,
type: 'notebook'
},
{
name: 'Untitled.ipynb',
path: 'Drive1/Untitled.ipynb',
last_modified: '2023-10-25T08:20:09.395167Z',
created: '2023-10-25T08:20:09.395167Z',
content: null,
format: null,
mimetype: null,
size: 4772,
writable: true,
type: 'notebook'
},
{
name: 'voila.ipynb',
path: 'Drive1/voila.ipynb',
last_modified: '2023-10-31T09:43:05.235448Z',
created: '2023-10-31T09:43:05.235448Z',
content: null,
format: null,
mimetype: null,
size: 2627,
writable: true,
type: 'notebook'
},
{
name: 'b.ipynb',
path: 'Drive1/b.ipynb',
last_modified: '2023-10-26T15:21:06.152419Z',
created: '2023-10-26T15:21:06.152419Z',
content: null,
format: null,
mimetype: null,
size: 1198,
writable: true,
type: 'notebook'
},
{
name: '_output',
path: '_output',
last_modified: '2023-10-31T12:39:41.222780Z',
created: '2023-10-31T12:39:41.222780Z',
content: null,
format: null,
mimetype: null,
size: null,
writable: true,
type: 'directory'
},
{
name: 'a.ipynb',
path: 'Drive1/a.ipynb',
last_modified: '2023-10-25T10:07:09.141206Z',
created: '2023-10-25T10:07:09.141206Z',
content: null,
format: null,
mimetype: null,
size: 8014,
writable: true,
type: 'notebook'
},
{
name: 'environment.yml',
path: 'Drive1/environment.yml',
last_modified: '2023-10-31T09:33:57.415583Z',
created: '2023-10-31T09:33:57.415583Z',
content: null,
format: null,
mimetype: null,
size: 153,
writable: true,
type: 'file'
}
],
format: 'json',
mimetype: '',
size: undefined,
writable: true,
type: 'directory'
};

/**
* A Contents.IDrive implementation that serves as a read-only
* view onto the drive repositories.
Expand Down Expand Up @@ -125,103 +223,7 @@ export class Drive implements Contents.IDrive {
path: string,
options?: Contents.IFetchOptions
): Promise<Contents.IModel> {
return {
name: 'Drive1',
path: 'Drive1',
last_modified: '2023-10-31T12:39:42.832781Z',
created: '2023-10-31T12:39:42.832781Z',
content: [
{
name: 'voila2.ipynb',
path: 'Drive1/voila2.ipynb',
last_modified: '2022-10-12T21:33:04.798185Z',
created: '2022-11-09T12:37:21.020396Z',
content: null,
format: null,
mimetype: null,
size: 5377,
writable: true,
type: 'notebook'
},
{
name: 'Untitled.ipynb',
path: 'Drive1/Untitled.ipynb',
last_modified: '2023-10-25T08:20:09.395167Z',
created: '2023-10-25T08:20:09.395167Z',
content: null,
format: null,
mimetype: null,
size: 4772,
writable: true,
type: 'notebook'
},
{
name: 'voila.ipynb',
path: 'Drive1/voila.ipynb',
last_modified: '2023-10-31T09:43:05.235448Z',
created: '2023-10-31T09:43:05.235448Z',
content: null,
format: null,
mimetype: null,
size: 2627,
writable: true,
type: 'notebook'
},
{
name: 'b.ipynb',
path: 'Drive1/b.ipynb',
last_modified: '2023-10-26T15:21:06.152419Z',
created: '2023-10-26T15:21:06.152419Z',
content: null,
format: null,
mimetype: null,
size: 1198,
writable: true,
type: 'notebook'
},
{
name: '_output',
path: '_output',
last_modified: '2023-10-31T12:39:41.222780Z',
created: '2023-10-31T12:39:41.222780Z',
content: null,
format: null,
mimetype: null,
size: null,
writable: true,
type: 'directory'
},
{
name: 'a.ipynb',
path: 'Drive1/a.ipynb',
last_modified: '2023-10-25T10:07:09.141206Z',
created: '2023-10-25T10:07:09.141206Z',
content: null,
format: null,
mimetype: null,
size: 8014,
writable: true,
type: 'notebook'
},
{
name: 'environment.yml',
path: 'Drive1/environment.yml',
last_modified: '2023-10-31T09:33:57.415583Z',
created: '2023-10-31T09:33:57.415583Z',
content: null,
format: null,
mimetype: null,
size: 153,
writable: true,
type: 'file'
}
],
format: 'json',
mimetype: '',
size: undefined,
writable: true,
type: 'directory'
};
return drive1Contents;
}

/**
Expand Down
111 changes: 111 additions & 0 deletions src/drivelistmanager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,117 @@ import {
Search
} from '@jupyter/react-components';
import { useState } from 'react';
//import { Contents } from '@jupyterlab/services';

/*const emptyContents: Contents.IModel = {
name: '',
path: '',
type: '',
writable: true,
created: '',
last_modified: '',
mimetype: '',
format: null,
content: [{}]
};*/

/*const driveContents: Contents.IModel = {
name: 'Drive1',
path: 'Drive1',
last_modified: '2023-10-31T12:39:42.832781Z',
created: '2023-10-31T12:39:42.832781Z',
content: [
{
name: 'voila2.ipynb',
path: 'Drive1/voila2.ipynb',
last_modified: '2022-10-12T21:33:04.798185Z',
created: '2022-11-09T12:37:21.020396Z',
content: null,
format: null,
mimetype: null,
size: 5377,
writable: true,
type: 'notebook'
},
{
name: 'Untitled.ipynb',
path: 'Drive1/Untitled.ipynb',
last_modified: '2023-10-25T08:20:09.395167Z',
created: '2023-10-25T08:20:09.395167Z',
content: null,
format: null,
mimetype: null,
size: 4772,
writable: true,
type: 'notebook'
},
{
name: 'voila.ipynb',
path: 'Drive1/voila.ipynb',
last_modified: '2023-10-31T09:43:05.235448Z',
created: '2023-10-31T09:43:05.235448Z',
content: null,
format: null,
mimetype: null,
size: 2627,
writable: true,
type: 'notebook'
},
{
name: 'b.ipynb',
path: 'Drive1/b.ipynb',
last_modified: '2023-10-26T15:21:06.152419Z',
created: '2023-10-26T15:21:06.152419Z',
content: null,
format: null,
mimetype: null,
size: 1198,
writable: true,
type: 'notebook'
},
{
name: '_output',
path: '_output',
last_modified: '2023-10-31T12:39:41.222780Z',
created: '2023-10-31T12:39:41.222780Z',
content: null,
format: null,
mimetype: null,
size: null,
writable: true,
type: 'directory'
},
{
name: 'a.ipynb',
path: 'Drive1/a.ipynb',
last_modified: '2023-10-25T10:07:09.141206Z',
created: '2023-10-25T10:07:09.141206Z',
content: null,
format: null,
mimetype: null,
size: 8014,
writable: true,
type: 'notebook'
},
{
name: 'environment.yml',
path: 'Drive1/environment.yml',
last_modified: '2023-10-31T09:33:57.415583Z',
created: '2023-10-31T09:33:57.415583Z',
content: null,
format: null,
mimetype: null,
size: 153,
writable: true,
type: 'file'
}
],
format: 'json',
mimetype: '',
size: undefined,
writable: true,
type: 'directory'
};*/

interface IProps {
model: DriveListModel;
Expand Down
Loading

0 comments on commit 3fce615

Please sign in to comment.