Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code duplication: Dialog.prompt and InputDialog #6378

Closed
fcollonval opened this issue May 20, 2019 · 3 comments
Closed

Code duplication: Dialog.prompt and InputDialog #6378

fcollonval opened this issue May 20, 2019 · 3 comments

Comments

@fcollonval
Copy link
Member

@fcollonval fcollonval commented May 20, 2019

There are duplicated functionalities between Dialog.prompt<T> (that I found only yesterday in the code 馃槩 ) and InputDialog introduced in #6326.

/**
* Simple dialog to prompt for a value
* @param prompt Text to show on the prompt
* @param defaultValue Initial value
* @returns a Promise which will resolve with the value entered by user.
*/
export function prompt<T extends PromptValue>(
prompt: string,
defaultValue: PromptValue
): Promise<Dialog.IResult<T>> {
return showDialog({
title: prompt,
body: new PromptWidget<T>(defaultValue as T),
buttons: [Dialog.cancelButton(), Dialog.okButton()],
focusNodeSelector: 'input'
});
}

https://github.com/jupyterlab/jupyterlab/blob/master/packages/apputils/src/inputdialog.ts

Reference

@jasongrout jasongrout added this to the 1.1 milestone May 21, 2019
@jasongrout jasongrout removed this from the 1.1 milestone May 21, 2019
@jasongrout jasongrout added this to the Future milestone May 21, 2019
@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented May 21, 2019

@fcollonval - would this be a good first issue?

Loading

@fcollonval
Copy link
Member Author

@fcollonval fcollonval commented May 22, 2019

@jasongrout thx for the suggestion. I think it's a good opportunity to list helper dialogs in the developer documentation.

Loading

@lock
Copy link

@lock lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion.

Loading

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants