Add workspace information in Import UI (#13648)

* Add workspace information in Import UI

* Addressed comments

* Reduced space between Workspace heading and the label
This commit is contained in:
Sakshi Sharma
2020-12-08 09:09:33 -08:00
committed by GitHub
parent e182649adc
commit 2f18753b1f
6 changed files with 98 additions and 16 deletions

View File

@@ -637,26 +637,29 @@ export class ProjectsController {
try {
const workspaceApi = utils.getDataWorkspaceExtensionApi();
const newProjFolderUri = model.filePath;
const validateWorkspace = await workspaceApi.validateWorkspace();
if (validateWorkspace) {
const newProjFolderUri = model.filePath;
const newProjFilePath = await this.createNewProject({
newProjName: model.projName,
folderUri: vscode.Uri.file(newProjFolderUri),
projectTypeId: constants.emptySqlDatabaseProjectTypeId
});
const newProjFilePath = await this.createNewProject({
newProjName: model.projName,
folderUri: vscode.Uri.file(newProjFolderUri),
projectTypeId: constants.emptySqlDatabaseProjectTypeId
});
model.filePath = path.dirname(newProjFilePath);
this.setFilePath(model);
model.filePath = path.dirname(newProjFilePath);
this.setFilePath(model);
const project = await Project.openProject(newProjFilePath);
await this.createProjectFromDatabaseApiCall(model); // Call ExtractAPI in DacFx Service
let fileFolderList: string[] = model.extractTarget === mssql.ExtractTarget.file ? [model.filePath] : await this.generateList(model.filePath); // Create a list of all the files and directories to be added to project
const project = await Project.openProject(newProjFilePath);
await this.createProjectFromDatabaseApiCall(model); // Call ExtractAPI in DacFx Service
let fileFolderList: string[] = model.extractTarget === mssql.ExtractTarget.file ? [model.filePath] : await this.generateList(model.filePath); // Create a list of all the files and directories to be added to project
await project.addToProject(fileFolderList); // Add generated file structure to the project
await project.addToProject(fileFolderList); // Add generated file structure to the project
// add project to workspace
workspaceApi.showProjectsView();
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
// add project to workspace
workspaceApi.showProjectsView();
await workspaceApi.addProjectsToWorkspace([vscode.Uri.file(newProjFilePath)]);
}
}
catch (err) {
vscode.window.showErrorMessage(utils.getErrorMessage(err));