extension-examples
extension-examples copied to clipboard
Example for showing save as dialog
Please provide an extension example for showing a "Save as ..." dialog. Also see
https://github.com/jupyterlab/jupyterlab/issues/9271
Thanks @stefaneidelloth for the suggestion.
Maybe this could be part of a more general dialog example that would also show other types of input dialogs:

Is this issue still open?? I want to work ..
@NoobMaster1999 You definitely can. Do you need pointers and/or suggestion?
Yes please
Ok a story could be the following:
- Open a file
test.exampleusinggetOpenFileshttps://github.com/jupyterlab/jupyterlab/blob/0820455e14586e75b27fc2de80ce30683ce6d7a7/packages/filebrowser/src/opendialog.ts#L73 - Open the picked up file
- ~~Click a :heavy_plus_sign: toolbar button~~
- Prompts to pick up the type of value to enter using
getItem
The possible value will be boolean, number, text or password https://github.com/jupyterlab/jupyterlab/blob/0820455e14586e75b27fc2de80ce30683ce6d7a7/packages/apputils/src/inputdialog.ts#L146 - Prompts with the appropriate
get...function for the value - Add the value to the file
- ~~Click a :floppy_disk: toolbar button~~
- Prompts with a save as dialog
That dialog does not exists but we could extendgetOpenFiles - Save the file
Tip: start by duplicating the hello-world example (and renaming dialogs).
Example of interest:
getOpenFile: https://github.com/fcollonval/jupyter-project/blob/91d208b729529b59d9a87f88c6977b46dd44e9c2/src/project.ts#L697getItem: https://github.com/jupyterlab/extension-examples/blob/92e08148a59ee18420cdc22abff279f52d15cc8c/state/src/index.ts#L36getText: https://github.com/jupyterlab/extension-examples/blob/92e08148a59ee18420cdc22abff279f52d15cc8c/kernel-output/src/index.ts#L97
Don't hesitate to open a draft PR early to get help.
Edited: remove toolbar buttons to simplify the example.
@fcollonval I just open a PR can you just review it?
I'm not sure to get where the PR was opened. Could you provide a link to it @NoobMaster1999 ?
PR: https://github.com/jupyterlab/jupyterlab/pull/10931
Hey I was wondering if/how easy it would be have an InputDialog that requests several values rather than just one