Skip to content

Commit 53300ba

Browse files
Take comments into account concerning adding the toolbar of the browser.
1 parent 1f51bce commit 53300ba

File tree

4 files changed

+98
-256
lines changed

4 files changed

+98
-256
lines changed

schema/browser.json

Lines changed: 0 additions & 237 deletions
This file was deleted.

schema/widget.json

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,66 @@
1919
"title": "'@jupyter/drives",
2020
"description": "jupyter-drives settings.",
2121
"type": "object",
22-
"properties": {},
23-
"additionalProperties": false
22+
"properties": {
23+
"toolbar": {
24+
"title": "File browser toolbar items",
25+
"description": "Note: To disable a toolbar item,\ncopy it to User Preferences and add the\n\"disabled\" key. The following example will disable the uploader button:\n{\n \"toolbar\": [\n {\n \"name\": \"uploader\",\n \"disabled\": true\n }\n ]\n}\n\nToolbar description:",
26+
"items": {
27+
"$ref": "#/definitions/toolbarItem"
28+
},
29+
"type": "array",
30+
"default": []
31+
}
32+
},
33+
"additionalProperties": false,
34+
"definitions": {
35+
"toolbarItem": {
36+
"properties": {
37+
"name": {
38+
"title": "Unique name",
39+
"type": "string"
40+
},
41+
"args": {
42+
"title": "Command arguments",
43+
"type": "object"
44+
},
45+
"command": {
46+
"title": "Command id",
47+
"type": "string",
48+
"default": ""
49+
},
50+
"disabled": {
51+
"title": "Whether the item is ignored or not",
52+
"type": "boolean",
53+
"default": false
54+
},
55+
"icon": {
56+
"title": "Item icon id",
57+
"description": "If defined, it will override the command icon",
58+
"type": "string"
59+
},
60+
"label": {
61+
"title": "Item label",
62+
"description": "If defined, it will override the command label",
63+
"type": "string"
64+
},
65+
"caption": {
66+
"title": "Item caption",
67+
"description": "If defined, it will override the command caption",
68+
"type": "string"
69+
},
70+
"type": {
71+
"title": "Item type",
72+
"type": "string",
73+
"enum": ["command", "spacer"]
74+
},
75+
"rank": {
76+
"title": "Item rank",
77+
"type": "number",
78+
"minimum": 0,
79+
"default": 50
80+
}
81+
}
82+
}
83+
}
2484
}

src/drivelistmanager.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
//import { requestAPI } from './handler';
23
import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
34
import {
45
Button,
@@ -43,6 +44,7 @@ export function DriveInputComponent(props: IDriveInputProps) {
4344
</div>
4445
);
4546
}
47+
4648
interface ISearchListProps {
4749
isName: boolean;
4850
value: string;
@@ -177,9 +179,7 @@ export function DriveListManagerComponent(props: IProps) {
177179

178180
setSelectedDrives(updatedSelectedDrives);
179181
props.model.setSelectedDrives(updatedSelectedDrives);
180-
props.model.stateChanged.connect(() =>
181-
console.log('selectedDrive has been changed')
182-
);
182+
props.model.stateChanged.emit();
183183
};
184184

185185
const getValue = (event: any) => {
@@ -257,6 +257,23 @@ export class DriveListModel extends VDomModel {
257257
setSelectedDrives(selectedDrives: IDrive[]) {
258258
this.selectedDrives = selectedDrives;
259259
}
260+
sendPostRequest(): boolean {
261+
const response = true;
262+
/*requestAPI('send_connectionRequest', {
263+
method: 'POST'
264+
})
265+
.then(data => {
266+
console.log('data:', data);
267+
return data;
268+
})
269+
.catch(reason => {
270+
console.error(
271+
`The jupyter_drive server extension appears to be missing.\n${reason}`
272+
);
273+
return;
274+
});*/
275+
return response;
276+
}
260277
}
261278

262279
export class DriveListView extends VDomRenderer<DriveListModel> {

0 commit comments

Comments
 (0)