Hook up generateScriptButton to lastPageValidation (#13339)

This commit is contained in:
Arvind Ranasaria
2020-11-10 13:16:25 -08:00
committed by GitHub
parent 3dd74971d8
commit d7a6b55f82
4 changed files with 51 additions and 30 deletions

View File

@@ -57,10 +57,20 @@ export class NotebookWizardModel extends ResourceTypeModel {
public onCancel(): void {
}
public async onGenerateScript(): Promise<void> {
const notebook = await this.prepareNotebookAndEnvironment();
await this.openNotebook(notebook);
/**
* Generates the notebook and returns true on successful generation
**/
public async onGenerateScript(): Promise<boolean> {
const lastPage = this.wizard.lastPage! as NotebookWizardPage;
if (lastPage.validatePage()) {
const notebook = await this.prepareNotebookAndEnvironment();
await this.openNotebook(notebook);
return true;
} else {
return false;
}
}
public async onOk(): Promise<void> {
const notebook = await this.prepareNotebookAndEnvironment();
const openedNotebook = await this.openNotebook(notebook);