[SQL Migration] Add buttons to allow saving assessment/recommendation reports (#20212)

* Implement save assessment report

* Implement save recommendation report
This commit is contained in:
Raymond Truong
2022-08-15 15:29:40 -07:00
committed by GitHub
parent 10f5b8b76e
commit e64171503a
7 changed files with 116 additions and 24 deletions

View File

@@ -197,7 +197,7 @@ export class GetAzureRecommendationDialog {
}
}).component();
this._disposables.push(browseButton.onDidClick(async (e) => {
let folder = await this.handleBrowse();
let folder = await utils.promptUserForFolder();
this._collectDataFolderInput.value = folder;
}));
@@ -259,7 +259,7 @@ export class GetAzureRecommendationDialog {
}
}).component();
this._disposables.push(openButton.onDidClick(async (e) => {
let folder = await this.handleBrowse();
let folder = await utils.promptUserForFolder();
this._openExistingFolderInput.value = folder;
}));
@@ -380,23 +380,4 @@ export class GetAzureRecommendationDialog {
public get isOpen(): boolean {
return this._isOpen;
}
// TO-DO: add validation
private async handleBrowse(): Promise<string> {
let path = '';
let options: vscode.OpenDialogOptions = {
defaultUri: vscode.Uri.file(utils.getUserHome()!),
canSelectFiles: false,
canSelectFolders: true,
canSelectMany: false,
};
let fileUris = await vscode.window.showOpenDialog(options);
if (fileUris && fileUris?.length > 0 && fileUris[0]) {
path = fileUris[0].fsPath;
}
return path;
}
}