Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions schema/drives-file-browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
"command": "drives:create-new-notebook",
"selector": ".jp-DirListing-content",
"rank": 54
},
{
"command": "filebrowser:rename",
"selector": ".jp-DirListing-item[data-isdir]",
"rank": 5,
"disabled": true
},
{
"command": "drives:rename",
"selector": ".jp-DirListing-item[data-isdir]",
"rank": 5
}
]
},
Expand All @@ -95,6 +106,13 @@
"default": []
}
},
"jupyter.lab.shortcuts": [
{
"command": "drives:rename",
"keys": ["F2"],
"selector": ".jp-DirListing-content .jp-DirListing-itemText"
}
],
"additionalProperties": false,
"definitions": {
"toolbarItem": {
Expand Down
14 changes: 13 additions & 1 deletion src/plugins/driveBrowserPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import {
IScore,
newFolderIcon,
fileIcon,
notebookIcon
notebookIcon,
editIcon
} from '@jupyterlab/ui-components';
import { CommandRegistry } from '@lumino/commands';
import { Widget } from '@lumino/widgets';
Expand Down Expand Up @@ -413,5 +414,16 @@ namespace Private {
icon: notebookIcon.bindprops({ stylesheet: 'menuItem' }),
label: 'New Notebook'
});

app.commands.addCommand(CommandIDs.rename, {
isEnabled: () => {
return browser.model.path !== 's3:';
},
execute: () => {
app.commands.execute('filebrowser:rename');
},
icon: editIcon.bindprops({ stylesheet: 'menuItem' }),
label: 'Rename'
});
}
}
1 change: 1 addition & 0 deletions src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export namespace CommandIDs {
export const createNewDirectory = 'drives:create-new-directory';
export const createNewFile = 'drives:create-new-file';
export const createNewNotebook = 'drives:create-new-notebook';
export const rename = 'drives:rename';
}

/**
Expand Down
Loading